Audio/Video out of sync when encoding using h264 with mp4a

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
marcsto
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Sep 2008 15:27

Audio/Video out of sync when encoding using h264 with mp4a

Postby marcsto » 20 Feb 2010 10:46

When I try to transcode a video in VLC using the h264 video codec and mp4a audio codec, the audio and video is consistently out of sync by about 1 second. As part of my debugging process, I tried using MediaCoder with the same codecs and similar settings and the audio / video was also out of sync, which seems to hint at some incompatibility with some of the settings I'm using. Here is the command line:

vlc -v "myvideo.avi" -I dummy --sout "#transcode{soverlay, ab=64, samplerate=44100,channels=2, acodec=mp4a, vcodec=h264, width=480,height=320,fps=25,vb=400,venc=x264{vbv-bufsize=10000, partitions=all,level=12,no-cabac, subme=7, threads
=4, ref=2,mixed-refs=1,bframes=0,min-keyint=1,keyint=50,trellis=2, direct=auto,qcomp=0.0, qpmax=51}}:gather:rtp{mp4a-latm, sdp=rtsp://0.0.0.0:1234/stream.sdp}"

Anyone have an idea of what might be wrong?

Thanks!
Marc

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Audio/Video out of sync when encoding using h264 with mp4a

Postby VLC_help » 20 Feb 2010 17:10

Does adding audio-sync to transcode help at all?

marcsto
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Sep 2008 15:27

Re: Audio/Video out of sync when encoding using h264 with mp4a

Postby marcsto » 21 Feb 2010 09:31

Unfortunately no.

marcsto
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Sep 2008 15:27

Re: Audio/Video out of sync when encoding using h264 with mp4a

Postby marcsto » 22 Feb 2010 12:25

I did some more experiments and found the following results:

Encapsulation Video codec Audio codec Result
MP4/MOV h264 MPEG 4 Audio (AAC) out of sync
MP4/MOV h264 MPEG Audio out of sync
MP4/MOV h264 MP3 out of sync
MP4/MOV MPEG-4 MPEG Audio out of sync
MPEG-PS h264 MPEG Audio in sync
MPEG-TS h264 MPEG Audio in sync
MPEG-1 h264 MPEG Audio in sync

Unfortunately, I can't use the MPEG-* encapsulations as I am trying to play these on my android phone and it doesn't support those encapsulations.

Any other ideas? Seems like some of the other programs can do an mp4 - h262 - aac combination that works but I think they use faac to encode the audio which isn't in the downloadable binary of vlc. I suppose I could try to compile the source and add faac, but I'm still hoping there's a more straightforward way.

Thanks!
Marc

Master_Mister
New Cone
New Cone
Posts: 2
Joined: 20 Dec 2010 06:00

Re: Audio/Video out of sync when encoding using h264 with mp

Postby Master_Mister » 22 Dec 2010 19:59

I got the same problem !! Did you found a solution to fix it ??

tomask50
New Cone
New Cone
Posts: 2
Joined: 09 Feb 2011 15:19

Re: Audio/Video out of sync when encoding using h264 with mp

Postby tomask50 » 11 Feb 2011 12:39

I am having the same problem. I'm using VLC on a WIN7/64 machine and capturing/encoding a website's output. After 15mins. of streaming, the problem is very noticeable. After 90mins. of streaming the sync problem makes the .mp4 file unwatchable. It seems to have some thing to do with the bitrate of the website. The higher the bitrate of the website, the more out of sync the file becomes.

Remy33
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2017 21:58

Re: Audio/Video out of sync when encoding using h264 with mp4a

Postby Remy33 » 19 Jul 2017 22:08

It's an ancient topic, it's a shame nobody has answered that. The problem is that they use the wrong MUX while saving to file.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 56 guests