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

I need to play a movie encoded with M-JPEG in HTML5.

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

+3
source share
1 answer

Safari and IE9 must use system codecs so that they can play M-JPEG if the user has the appropriate codec.

In other browsers, you can try to inject it using an element <object>that can find a suitable plugin.

However, browser developers do not want to support a ton of crappy codecs and odd containers. Do not expect something other than H.264 and WebM to work (and you need both).

It is best to transcode the video. Even fast / low-quality encoding of H.264 and WebM will give you much better compression than M-JPEG.

+2
source

Source: https://habr.com/ru/post/1777328/


All Articles