Hi We are having an issue with the JW Player playing h264 videos, at certain points in the video playback the audio and video go out of sync, this can be as much as 10 seconds. I am really at a loss as to why this is, any help or advice would be greatly accepted.
i have not been able to play your file without sync problems in any flash based player without converting it.
i first tried converting to .mp4 (using http://media-convert.com) but then the image didnt show - i then tried to convert to .flv which worked fine - no sync problem - *but* that ofcourse makes the image quality terribly bad...
so with a bit of luck and some experimenting it ought to be possible to find some combination of encoding settings that will give the desired result - it might be a good idea first to export the screen recording in a reasonably lossless video format like .avi or the like before converting...
for more info on video compression please see - *http://www.longtailvideo.com/support/tutorials/Web-Video-Compression*
and also checkout - *http://www.bitsontherun.com/*
or try some of the trial versions from *http://www.adobe.com*
Your audio is at a samplerate of 48000kHz and a bitrate of 768kbps.
Flash will convert 48000kHz to 44100kHz, which might mess up the sync. Also, the incredibly high bitrate of 768kbps might make it impossible for Flash to keep up with the audio decoding. For mono audio, 96kbps is plenty of bits.
Hi we have even tried to run a video with the sound set to 64 bit, and this makes no difference the audio and video go out of sync. We have tired various other movies of different lengths and all exhibit the same sync issues, I don't think this is a problem just with JW Player, the same sync issues happen in Adobe Movie Player
Here's the solution to your problem with a brief explanation as to why it happens.
The H.264 is not a completely "contained" compression method -- by this I mean that Audio and Video tracks are still treated as separate entities that only QuickTime can recognize integrated timing information to match each track with one another. Flash, however, can not detect this information and so when it sees a gap of no audio, it shifts the remaining audio to fill in the gap, thus causing a sync issue. Why? Not entirely sure -- it's a Flash issue that has never been addressed by Macromedia/Adobe.
HERE'S HOW TO FIX:
Create a white noise track (generated in a sound program like Soundtrack) that is the complete duration of your video tracks and insert it underneath your currently existing audio track. Set the level to around -70dB thus making it inaudible. This track acts as a binding track to keep things in sync. Export as a self-contained file and compress as you normally would. You can still use H.264 as your compression method.
If you've already done the editing there are methods to automate inserting an audio track with already rendered/exported H.264 files. You will need FFMPEG, SOX, and a programming language (our department used Perl) If you have these programs then you can write up a short script that will input the source file, output the audio, create a whitenoise track, mux the whitenoise to the audio track, and re-insert the new audio file to the source video.
Andrew G. Wallace Multimedia Specialist Pearson Video Production Services
Fascinating. I probably would never have figured this out, but I did notice that gaps of silence in my H.264 files are "closed up" in the Flash player. The pauses, so carefully edited and timed, are collapsed. I thought I was going crazy! Thanks Andrew.
Then, I converted the .mov file to .flv using VisualHub. I selected flash, checked 320 pixels wide, checked raw .flv format, set quality to go nuts and left everything else as default.
Ok, so now I have my .flv file. I include the swfobject script and jw player on my site.
Now for the weird part. The video plays back in sync and smooth when using Firefox (Mac/PC), Safari (Mac/PC), and Chrome (Mac/PC). But, the audio is out of sync...and...the overall video is sluggish in Internet Explorer 6, 7, and 8.
Thank you for that explanation -- it was very helpful. Now this isn't a JW Player specific problem, it's a adobe flash problem correct? I've been able to reproduce the problem identically in flow player. Is this something we can expect adobe to address?
This question has received the maximum number of answers.