View Full Version : Keeping Audio in sync when encoding .flv
Akai-Shuichi
14th September 2012, 22:09
I have an h264 .flv file with aac audio. I'm trying to convert it with some filters to clean it up some to an h264 mkv via meGUI. The framerate is 29.97 and when I decimate it to 23.976 the audio goes out of sync.
I'm wondering is there any way to keep the audio in sync?
I've tried using DirectShowSource("video.flv",fps=29.97,convertfps=true,audio=false), but every couple of frames seem jumpy to me.
I've also tried FFVideoSource() and FFAudioSource() with audiodub, but the audio doesn't carry over to the video.
Some help would be greatly appreciated!
sneaker_ger
15th September 2012, 00:03
I've also tried FFVideoSource() and FFAudioSource() with audiodub, but the audio doesn't carry over to the video.
What do you mean by "doesn't carry over to the video"?
It should look something like this:
a=ffaudiosource("input.flv")
v=ffvideosource("input.flv", fpsnum=30000, fpsden=1001)
audiodub(v, a)
Is it still in sync after the source filters and the de-sync a result of the IVTC process? Post the complete script.
Akai-Shuichi
15th September 2012, 01:38
Whenever the video is finished encoding, there is still no audio on it.
FFVideoSource("Video.flv")
FFAudioSource("Vide.flv")
AudioDub(FFVideoSource("Video.flv"), FFAudioSource("Video.flv"))
AssumeFPS(30000/1001)
TDecimate()
ConvertToYV12()
DAA().MAA()
FFT3DFilter(sigma=2.0, plane=0, bw=32, bh=32, bt=3, ow=16, oh=16, sharpen=0, interlaced=false)
Gradfun2dbmod()
NerdWithNoLife
15th September 2012, 01:50
Remove lines 1&2. The AudioDub line should handle all the loading of audio and video.
sneaker_ger
15th September 2012, 02:43
You could demux the audio with flv extract and simply mux it into the mkv. Would also mean zero quality loss as a bonus. Otherwise post a sample in the ffms2 thread for potential bug fixing.
Akai-Shuichi
15th September 2012, 02:58
When I mux it with the video it is out of sync, I believe this is because of me decimating without altering the audio too, but I could be wrong.
sneaker_ger
15th September 2012, 08:26
The movie length does not change when IVTC is done correctly. Does the sync get progressively worse or is it a constant delay? Try using ffvideosource with the fpsnum and fpsden parameters as shown in my example.
Guest
15th September 2012, 12:41
Maybe the FLV is really 30fps. I mean, there's no need for the AssumeFPS() business if it is already 29.97.
IanB
16th September 2012, 00:18
AssumeFPS(30000/1001) is almost certainly wrong, the division will be integer division which will be "29".
The op wants either AssumeFPS(30000, 1001) for a correct rational pair answer,
Or AssumeFPS(30000.0/1001.0) # 29.97003 for a correct floating point answer,
Or not fiddle with it because the source filter got it right already.
Guest
16th September 2012, 00:25
Of course! Nice catch. :o
sneaker_ger
16th September 2012, 07:36
I noticed it, too, but didn't want to make things more complicated (and hoped he would just use fpsnum and fpsden). I didn't know it would just be an integer division...
But now that you mention it, I remember DirectShowSource (I guess every fraction in AviSynth?) having the same problem (and no fractional parameters on top of that).
Akai-Shuichi
16th September 2012, 14:10
fpsnum and fpsden seemed to work, thanks!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.