Search code examples
videohtmlhtml5-videomjpeg

How to play M-JPEG encoded video on HTML5 <video>?


I need to play an M-JPEG encoded movie on HTML5 .

Do you know which container (mp4, avi, webm, ogv, etc.) and browser (chrome, safari, etc.) can play this?


Solution

  • Safari and IE9 are supposed to use system codecs, so they could play M-JPEG if user has appropriate codec.

    In other browsers you could try embedding it using <object> element, which may find some suitable plug-in.

    However, browser vendors don't want to support ton of crappy codecs and odd containers. Don't expect anything else than H.264 and WebM to work (and you need both).

    Your best bet is to re-encode the video. Even fast/low-quality encode of H.264 and WebM is going to give you compression much much better than M-JPEG.