Hey Guys,
Great info on here, have been reading topics related to my issue and thought I'd see if anyone can help me.
Long story short is I am working with a Networked DVR which exports an interlaced .avi file. When I play back these files the lip-sync is off anywhere from 200-500 ms. Never the same. In reading a lot of posts I tried many different ways to line this back up easily, but haven't found anything that works. I was hoping using HandBrake may work, and run the file through "constant frame rate but it seems to be the audio that slips. Here are two different files, screen grabbed using MediaInfo.
VIDEO 1
General
Complete name : C:\Users\msennema\Desktop\CRC\new software remot3.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 3.88 MiB
Duration : 13 s 0 ms
Overall bit rate : 2 506 kb/s
IsTruncated : Yes
Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings : BVOP2
Format settings, BVOP : 2
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Muxing mode : Packed bitstream
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 12 s 700 ms
Bit rate : 2 427 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.039
Stream size : 3.67 MiB (95%)
Writing library : XviD 1.0.2 (UTC 2004-08-29)
Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 13 s 0 ms
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 1 channel
Sampling rate : 8 000 Hz
Bit depth : 16 bits
Stream size : 203 KiB (5%)
Alignment : Aligned on interleaves
Interleave, duration : 977 ms (29.31 video frames)
Interleave, preload duration : 1000 ms
VIDEO 2
General
Complete name : C:\Users\msennema\Desktop\CRC\friday.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 16.9 MiB
Duration : 1 min 22 s
Overall bit rate : 1 731 kb/s
IsTruncated : Yes
Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings : BVOP2
Format settings, BVOP : 2
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Muxing mode : Packed bitstream
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 1 min 21 s
Bit rate : 1 616 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.026
Stream size : 15.6 MiB (92%)
Writing library : XviD 1.0.2 (UTC 2004-08-29)
Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 1 min 22 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 1 channel
Sampling rate : 8 000 Hz
Bit depth : 16 bits
Stream size : 1.25 MiB (7%)
Alignment : Aligned on interleaves
Interleave, duration : 989 ms (29.66 video frames)
Interleave, preload duration : 1000 ms
As you can see the audio duration is always longer then the video, and the frame rate is variable and drops to 29.66fps and 29.31fps in these examples. (always different) Is there a way to easily get these in sync without doing it manually and aligning by sight?
Thanks in advance for any info, I'm not an expert in this field.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
Use VirtualDub or the newer VirtualDub2:
1) File -> Open Video File
2) Video -> Direct Stream Copy
3) Audio -> Direct Stream Copy (this is the default so you don't actually have to set it)
4) Audio -> Interleaving... set Audio Skew Correction to the required delay (negative value to advance)
5) File -> Save As AVI.
Audio and Video don't need to be the same length. -
Can you tell by looking at those interlaced properties (interlace duration etc) what the skew is? Or do I always have to manually find it within VLC or a player where I can adjust the skew on the fly?
Trouble I'm having is VLC and other programs I have only work in 50ms increments -
You mean the interleaves? No. The audio and video are interleaved. Ie, there's some audio then some video then some more audio then some more video... The interleave duration tells you how long those interleaves are. For example, one second of audio, one second of video... The preload is just how much audio appears before the first video packet. But it does not imply a delay or advance. There are separate flags for that.
You can use the play output function in VirtualDub to see the A/V sync. Or use an media player like MPCHC or MPCBE that lets you set the audio skew by pressing + or - on the numeric keypad, and shows you the delay currently being used. Once you've found the right delay/advance you can enter that in VirtualDub. -
Thanks guys, manual it is. I guess I was hoping there would be some sort of conversion i could do like :
video file 1 m 10 s
audio file 1 m 9 s
-----------------------
= 100ms skew
1000 preload duration
-984 interleave duration
-----------------------
= 16
=116ms skew
I know this is way off and was trying a few different ways, but no success. Thanks for your help, the 10ms increments are good enough for what I'm doing in MPC -
-
In general, a procedure like that won't work. The audio and video in an AV file don't have to start at the same time, end at the same time, or be the same length. The preload is not the same as the skew. That said, if you find that your particular recorder does something consistent you could take advantage of that consistency to automate the process.
Similar Threads
-
FFMPEG: how to encode audio for a target duration?
By marcorocchini in forum Newbie / General discussionsReplies: 2Last Post: 3rd Apr 2016, 00:08 -
F4F File Video Duration
By Tom Saurus in forum Video Streaming DownloadingReplies: 0Last Post: 20th Feb 2016, 09:41 -
Problems adding PAL audio track to NTSC video, both with the same duration
By Swordmaster512 in forum Newbie / General discussionsReplies: 5Last Post: 27th Jul 2015, 20:51 -
Split video by duration while encoding?
By Shaorin in forum Newbie / General discussionsReplies: 4Last Post: 19th Jan 2014, 03:27 -
MKVmerge extends total time if subtitle duration exceeds video duration
By ankutsa in forum SubtitleReplies: 1Last Post: 7th Sep 2013, 11:08