It's possible to produce mp4/webm videos without sound that loop seamlessly, but if you add sound to the video with matching length it adds a noticeable stutter at the end, even if the audio is slightly shorter than the video.

Is it possible to produce a web friendly (mp4/webm) video with sound that is gapless?

I use Adobe products and ffmpeg to produce my videos, if that matters.


This can happen if the GOP structure is unclosed at the end of the video. If you can assure that your video ends with an I frame, and that the audio is exactly the same length as the video, you stand a much better chance of getting a smooth recycle. Sorry, I don't know how to force that using ffmpeg.

| improve this answer | |
  • Thanks for the info, helped me learn a lot about how encoding works. I was able to figure out how to set the keyframe interval and make sure the last frame was a keyframe but it didn't change anything. I have a WebM video that loops seamlessly with ffplay but not in Chrome/Firefox, it seems like they just don't support gapless video/audio playback. – Brendon Dec 21 '14 at 1:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.