Audio and video get slowly out of sync on captured stream

About encoding, codec settings, muxers and filter usage
tonwillekes
New Cone
New Cone
Posts: 3
Joined: 27 Oct 2016 08:22

Audio and video get slowly out of sync on captured stream

Postby tonwillekes » 27 Oct 2016 08:48

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

tonwillekes
New Cone
New Cone
Posts: 3
Joined: 27 Oct 2016 08:22

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

Postby tonwillekes » 06 Nov 2016 09:01

Eh nobody any thoughts ? Am I the only one with this problem or am I using VLC in a way nobody has experience with ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 27 Dec 2016 11:31

Yes, our mp4 muxer is broken in 2.2.4. Use 2.2.5 for this.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

tonwillekes
New Cone
New Cone
Posts: 3
Joined: 27 Oct 2016 08:22

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

Postby tonwillekes » 18 Feb 2017 12:50

Thank you Jean-Baptiste.
I will try it but in the meanwhile I tried ffmpeg which is capturing streams flawlessly until now.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 15 guests