Page 1 of 1

Audio and video get slowly out of sync on captured stream

Posted: 27 Oct 2016 08:48
by tonwillekes
Hi all,
I am a volunteer at an internet broadcast foundation. We provide a live stream of 2 hours on every saturday. I am trying to archive these streams on my home computer with VLC player version 2.2.4
I use a batch file to start the capture every saturday at 11:00 and I capture every hour as a separate mp4 file
I use the following code:

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --run-time 3600 rtmp://<stream name> --sout="#std{access=file,mux=mp4,dst='E:\firsthour.mp4'}" vlc://quit

This works flawlessly except for 1 thing: The audio and video start in sync but at the end of the hour the audio is about 1 second ahead of the video so far from lip sync.
What I saw is that the original stream uses 25 frames per second but the captured file uses 24 frames per second. When I put the stream down to 24 frames per second the captured file claims to be in 23 frames per second so always 1 frame per second less.
However, the difference in frame rate cannot explain the sync problem because 1 frame difference per second should create 1 second difference in 25 seconds and that is far from the case.

Anybody an idea what causes this problem and how to correct this ?
I tested it also on other rtmp TV streams but the problem is there always.

Thanks in advance,

Ton

Re: Audio and video get slowly out of sync on captured stream

Posted: 06 Nov 2016 09:01
by tonwillekes
Eh nobody any thoughts ? Am I the only one with this problem or am I using VLC in a way nobody has experience with ?

Re: Audio and video get slowly out of sync on captured stream

Posted: 27 Dec 2016 11:31
by Jean-Baptiste Kempf
Yes, our mp4 muxer is broken in 2.2.4. Use 2.2.5 for this.

Re: Audio and video get slowly out of sync on captured stream

Posted: 18 Feb 2017 12:50
by tonwillekes
Thank you Jean-Baptiste.
I will try it but in the meanwhile I tried ffmpeg which is capturing streams flawlessly until now.