[FFmpeg-user] problem with audio/video sync after conversion

Arlo Leach lists at arlomedia.com
Wed Jun 27 18:52:01 CEST 2012

Hi Dave,

> Also experienced audio sync issues with mp4 playback on iOS devices, so the sync problems are, at least in my experience, not just limited to flash players. I've STR also observing sync issues with playback of mp4's in newer browsers that support mp4's in the new <video> tag, but again, not on webm in <video>.

Oh, yes -- I just viewed this converted video...


...on in iPad 3 running the latest iOS 5.1.1, and saw the sync problem there. So, not limited to Flash after all. However, I don't see sync problems viewing the same URL in Safari's HTML5 playback on my Mac.

Here's another wrinkle that I didn't mention because I was focused on the Flash incompatibility. Before delivering to the browser, I want to pass my video files through an authentication script, basically like this:

	header("Content-Type: video/mp4");
	header("Content-Transfer-Encoding: Binary");
	header("Content-Length: ".filesize($filename));
	passthru("cat $filename");

When I do this, I see the sync problem in Safari with HTML5, but only with the same videos that produced the sync problem in Flash, and only with converted videos where I changed the frame rate. In other words, viewing a video through this script produces the same behavior as viewing a video in a Flash player. I have no idea what this means, but I'll throw it out there.

> My source files are SD-PAL, so 25fps. I wonder if something in libfaac is always outputting samples-per-frame based on 30000/1001, rather than being flexible depending on actual output framerate ?

On that note, I tried different output frame rates and it seemed that the sync got worse the further I got from 29.97. For example, converting to 25 fps wasn't too bad, but converting to 10 fps was quite bad. I mentioned before that converting to 30 fps was in sync, but it's possible it was shifted a bit from the true sync but not to a noticeable degree. I should clarify that converting from 29.97 to 15 fps didn't shift the audio track by a factor of 2, it just shifts by 4-5 frames, regardless of the overall video duration.

> Afaict, the problem described in this thread is only 
> reproducible with one (?) Flash Player while the resulting 
> file plays fine with MPlayer / ffplay.

Actually I can reproduce the problem with all three Flash players I tested -- JWPlayer, Flowplayer and VideoJS -- and now the HTML5 player in iOS.



Arlo Leach

More information about the ffmpeg-user mailing list