How to embed .h264 video file in html webpage using video tags

Ramaraju.d picture Ramaraju.d · Apr 7, 2015 · Viewed 37.8k times · Source

I am trying to play .h264 file in browser, Trying to accomplish this using html video tags. The result is always an empty frame.

I did check some links on web, They recommend to play the video in .mp4 container.

Can someone help me to accomplish this?

UPDATED CODE:

References:

How do i play H264 video?

Play .h264 files webplayer

http://www.htmlgoodies.com/html5/client/how-to-embed-video-using-html5.html#fbid=6u-u00TH7Je

Answer

aergistal picture aergistal · Apr 7, 2015

The .h264 file contains the raw H.264 stream which is not directly supported in browsers. You can use a tool like FFmpeg to put it in a container like the other answers recommended:

ffmpeg -f h264 -i test.h264 -c:v copy test.mp4

Edit:

If you must play a raw H.264 byte-stream then you need a browser plugin. Example for VLC web plugin:

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" target="test.h264" />