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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th June 2012, 12:19   #1  |  Link
Ash123
Registered User
 
Join Date: Nov 2003
Location: England
Posts: 25
encoding from flv to avi, audio sync issues

I seem to be running into problems when encoding from a flv file to an avi file.

I use avisynth to load the file into virtualdub and then encode to an xvid.avi. No probs there.

It's the audio that is the issue. What I normally do is load the original file into GoldWave and then save the wav. Then encode the wav to mp3 using RazorLame. Then mux the new video and audio together in Virtualdub.

What happens is the audio is in sync at the beginning of the new file but slowly goes out of sync throughout the file until at the end it's 9 seconds out of sync. (the audio is behind).

I thought it may be the way GoldWave handles flv files so I used FLVExtract to extract the mp3 but it's exactly the same. The audio slowly falls behind even though it's the correct time length.

I've searched on the net and it appears other people have had this issue but so far no reasonable solution has been found.

Can anybody here help? Has anybody had this experience?

Here's the MediaInfo on the video file. (just to note I've had the same problem with another flv file).

General
Complete name : E:\video1.flv
Format : Flash Video
File size : 259 MiB
Duration : 49mn 20s
Overall bit rate : 735 Kbps
Encoded date : Fri Feb 26 13:23:12 2010
Tagging application : On2 Flix SDK for Dshow_2.5.2.0
canseektoend : No
On2 : Technologies
profile : VP6-E

Video
Format : VP6
Codec ID : 4
Duration : 49mn 20s
Bit rate : 1 596 Kbps
Width : 720 pixels
Height : 405 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.219
Stream size : 563 MiB

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Mode : Joint stereo
Mode extension : MS Stereo
Codec ID : 2
Codec ID/Hint : MP3
Duration : 49mn 20s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 45.2 MiB (17%)

Last edited by Ash123; 25th June 2012 at 12:22.
Ash123 is offline   Reply With Quote
Old 25th June 2012, 16:01   #2  |  Link
hanfrunz
Registered User
 
hanfrunz's Avatar
 
Join Date: Feb 2002
Location: Germany
Posts: 534
I often use flvextract to demux the flv before working with it. That solved a lot of sync issues for me in the past.
hanfrunz is offline   Reply With Quote
Old 25th June 2012, 16:17   #3  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 989
A few possible reasons may occur.

The file may be corrupted during the recording. Happened to me a lot of time when I'm trying to record those rtsmp streams, there may be a delay in the process and all of a sudden you see repeating parts in the outputting video. However, the flv container is not going to report the errors, so you'll end up having syncing problems.

Another possibility might be a problem with the framerate accuracy with the video stream, in this case you can try to force a framerate on it with avisynth.
lansing is offline   Reply With Quote
Old 25th June 2012, 17:03   #4  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
Have you tried ffmpeg on the CLI to just remux?

ffmpeg -i myfile.flv -acodec copy -vcodec copy out.avi
Yellow_ is offline   Reply With Quote
Old 25th June 2012, 19:48   #5  |  Link
Ash123
Registered User
 
Join Date: Nov 2003
Location: England
Posts: 25
lansing: You could be right. vdub didn't recognise the frame rate originally so I used this script.

DirectShowSource("E:\video1.flv", fps=25)

Crop(2,2,-6,-4)

hanfrunz: Thanks. I'll try that.

Yellow_: Sorry I didn't understand that. Maybe a bit above my head

Last edited by Ash123; 25th June 2012 at 19:52.
Ash123 is offline   Reply With Quote
Old 25th June 2012, 19:59   #6  |  Link
Ash123
Registered User
 
Join Date: Nov 2003
Location: England
Posts: 25
OK I extracted the video using FLVExtract and the video now shows the frame rate as 24.936 fps.
Would this cause the desync with the audio if avisynth was set at 25fps?

I've also just noticed that MediaInfo incorrectly reported the video stream size with the flv as 563 MiB
but now it reports the size as 211 MB which looks correct and the resolution is different too. Originally reported as 720 by 405 and now it's 720 by 416.

General
Complete name : D:\Apps\FLV_Extract_v1.6.2\video1.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 213 MiB
Duration : 49mn 20s
Overall bit rate : 604 Kbps

Video
ID : 0
Format : VP6
Format profile : Heightened Sharpness
Codec ID : VP6F
Codec ID/Hint : On2
Duration : 49mn 20s
Bit rate : 599 Kbps
Width : 720 pixels
Height : 416 pixels
Display aspect ratio : 16:9
Frame rate : 24.936 fps
Bits/(Pixel*Frame) : 0.080
Stream size : 211 MiB (99%)

Last edited by Ash123; 25th June 2012 at 20:10.
Ash123 is offline   Reply With Quote
Old 26th June 2012, 10:25   #7  |  Link
ajk
Registered User
 
Join Date: Jan 2006
Location: Finland
Posts: 126
Well, if you calculate the error 25.0 / 24.936, over 49:20 minutes it amounts to about 8 seconds, so it would probably explain the difference you encountered.
ajk 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 01:26.


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