Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th January 2020, 14:11   #1  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Audio Development

Audio support is finally mostly done. See this blog post for a longer explanation and list of what's currently implemented.

Test5 installer (x64)
Test5 portable (x64)


Test4 installer (x64)
Test4 portable (x64)


BestAudioSource thread
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 2nd August 2020 at 14:12. Reason: New version
Myrsloik is offline   Reply With Quote
Old 26th January 2020, 15:14   #2  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 290
Looks like 1 audio frame has a length of 2 seconds and I can't trim less than that. clip2 = clip2.std.AudioTrim(0, 95999) works, while clip2 = clip2.std.AudioTrim(0, 47999) fails to output any data.
__________________
Me on GitHub
PC Specs: Ryzen 3900X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 26th January 2020, 15:36   #3  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by DJATOM View Post
Looks like 1 audio frame has a length of 2 seconds and I can't trim less than that. clip2 = clip2.std.AudioTrim(0, 95999) works, while clip2 = clip2.std.AudioTrim(0, 47999) fails to output any data.
Doh, the one case I forgot to test when passing through audio frames. The files in the first post have been discretely updated.

Audio frames are currently 96000 samples so that's well spotted.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th January 2020, 15:42   #4  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 290
Now it trims as intended. Great!
__________________
Me on GitHub
PC Specs: Ryzen 3900X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 26th January 2020, 19:00   #5  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,419
I got the "No attribute with the name bas exists" after running the installer
lansing is offline   Reply With Quote
Old 26th January 2020, 19:11   #6  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by lansing View Post
I got the "No attribute with the name bas exists" after running the installer
Did you actually get the plugin?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th January 2020, 19:17   #7  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,419
Quote:
Originally Posted by Myrsloik View Post
Did you actually get the plugin?
I don't think I have, I checked "core/plugins", there's no dll with the name "bas".
lansing is offline   Reply With Quote
Old 26th January 2020, 23:14   #8  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 136
Quote:
Originally Posted by lansing View Post
I don't think I have, I checked "core/plugins", there's no dll with the name "bas".
Did you... click the Best Audio Source Thread link in the OP and manually grab the plugin, which the question was phrased specifically to indicate was not actually built in and therefore would not be in core/plugins?
AzraelNewtype is offline   Reply With Quote
Old 27th January 2020, 01:20   #9  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,419
Quote:
Originally Posted by AzraelNewtype View Post
Did you... click the Best Audio Source Thread link in the OP and manually grab the plugin, which the question was phrased specifically to indicate was not actually built in and therefore would not be in core/plugins?
Ok I got it, I thought the plugin was included in the installer
lansing is offline   Reply With Quote
Old 27th January 2020, 07:15   #10  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,419
Playing back the vpy script in media player classic is choppy, audio constant skips
lansing is offline   Reply With Quote
Old 27th January 2020, 12:41   #11  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 290
That problem only occurs with w64 header, raw output is fine.
__________________
Me on GitHub
PC Specs: Ryzen 3900X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 2nd February 2020, 19:30   #12  |  Link
Pat357
Registered User
 
Join Date: Jun 2006
Posts: 452
How to choose to output W64 or raw ?
What can I use to play raw audio ? I suppose FFplay should do the trick ?
What extra <parameters> do I have to use in example below to play raw-audio ?

Here's what I have :

vspipe -i betteraudio_test.vpy -
[mp3float @ 000001B60C074C00] Could not update timestamps for skipped samples.
Samples: 12856320
Sample Rate: 48000
Format Name: Audio32F
Sample Type: Float
Bits: 32
Channels: 2
Layout:

ffplay -f f32le -sample_rate 48000 -channel_layout 3 -i rawaudio.raw
Code:
[pcm_f32le @ 000002ce23786700] Channel layout 'stereo' with 2 channels does not match specified number of channels 1: ignoring specified channel layout
[f32le @ 000002ce23779180] Estimating duration from bitrate, this may be inaccurate
Input #0, f32le, from 'rawaudio.raw':
  Duration: 00:08:55.68, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_f32le, 48000 Hz, 1 channels, flt, 1536 kb/s
[pcm_f32le @ 000002ce237d3280] Channel layout 'stereo' with 2 channels does not match specified number of channels 1: ignoring specified channel layout
  24.58 M-A:  0.000 fd=   0 aq=  184KB vq=    0KB sq=    0B f=0/0
Vspipe -i says 2 channels, but ffplay can only find one !
One channel produces only noise, while the other plays the music, but much to slow (tempo and pitch are both to low).
The woman in this song sounds like a man with a deep voice.

Last edited by Pat357; 2nd February 2020 at 20:27. Reason: Adding more information
Pat357 is offline   Reply With Quote
Old 2nd February 2020, 20:05   #13  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by Pat357 View Post
How to choose to output W64 or raw ?
What can I use to play raw audio ? I suppose FFplay should do the trick ?
What extra <parameters> do I have to use in example below to play raw-audio ?

ffplay -f rawaudio <parameters> -i rawaudio.raw

<parameters> = ??
You use -y or --y4m wo add w64 heqaders. A bit confusing but I've basically changed it to mean "add headers". Not sure how to play the raw audio in ffmpeg.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd February 2020, 17:43   #14  |  Link
Pat357
Registered User
 
Join Date: Jun 2006
Posts: 452
Finally I figured it out and give it here in case other users want to use ffmpeg to process the output :

To playback or process the raw audio output from Vspipe, do the following :

vspipe -i betteraudio_test.vpy -
[mp3float @ 000001B60C074C00] Could not update timestamps for skipped samples.
Samples: 12856320
Sample Rate: 48000
Format Name: Audio32F
Sample Type: Float
Bits: 32
Channels: 2
Layout:

Notice the following parameters :
Code:
Sample Rate: 48000    = -ar 48000
Format Name: Audio32F
Sample Type: Float
Bits: 32              3 above together = -f f32le
Channels: 2                   =  -ac 2
To playback :
Code:
vspipe betteraudio_test.vpy - | ffplay -f f32le -ac 2 -ar 48000 -i -
To process further using ffmpeg :
Code:
vspipe betteraudio_test.vpy - | ffmpeg -f f32le -ac 2 -ar 48000 -i - <filters> -acodec xxx ... outputfile
PS. In vapoursynth only raw audio works ok in this test version, output in w64 always gives a lot of skips with noise.
With Avisynth I've no problems found so far.

Last edited by Pat357; 3rd February 2020 at 18:11.
Pat357 is offline   Reply With Quote
Old 3rd February 2020, 21:45   #15  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by Pat357 View Post
...
PS. In vapoursynth only raw audio works ok in this test version, output in w64 always gives a lot of skips with noise.
With Avisynth I've no problems found so far.
I'll look into the bugs, must've gotten some value wrong in the w64 header. Expect a new version sometime next week since I'm quite busy.

Anyway, here's the general plan:
  • Try to fix all the reported issues.
  • Add the filters ShuffleChannels (audio equivalent of ShufflePlanes), MatrixMix, AssumeSampleRate and maybe AudioLoop.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th February 2020, 07:35   #16  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,992
Would it be possible to also include the SoundTouch library functionalities to allow adjusting pitch, tempo etc.?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th February 2020, 09:46   #17  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by Boulder View Post
Would it be possible to also include the SoundTouch library functionalities to allow adjusting pitch, tempo etc.?
Start writing a plugin!
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th February 2020, 17:30   #18  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,992
Quote:
Originally Posted by Myrsloik View Post
Start writing a plugin!
I'm just a little bit too dumb for that.. not much but enough to not push me over the edge
I was just thinking if it was possible to port the implementation already included in native Avisynth+.

Nevertheless, thanks for the work. I tested the plugin briefly in Avs+ to adjust audio (5.1ch FLAC file) tempo for an ugly 24.975 -> 25 fps conversion. It worked without a hitch
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th February 2020, 17:43   #19  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by Boulder View Post
I'm just a little bit too dumb for that.. not much but enough to not push me over the edge
I was just thinking if it was possible to port the implementation already included in native Avisynth+.

Nevertheless, thanks for the work. I tested the plugin briefly in Avs+ to adjust audio (5.1ch FLAC file) tempo for an ugly 24.975 -> 25 fps conversion. It worked without a hitch
I'm sure someone (maybe even me) will start to create/port the useful stuff seen in Avisynth once I get a little bit further with the official audio support.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th May 2020, 22:47   #20  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,279
Quote:
Originally Posted by DJATOM View Post
That problem only occurs with w64 header, raw output is fine.
You found an 11 year old bug from the original AVFS author. Congratulations!

So much for borrowing the w64 code from there. Will be fixed in the next version.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.