← Back

Decode H.262 video using the <video> tag

H.262 and MPEG-2 Video are the same specification, published jointly by the ITU-T and ISO in 1995 - the format DVDs and digital television were built on. This demo feeds a raw elementary stream, with no container at all: libmpeg2_1 carries its own reframer, splits the stream on the sequence and picture start codes and emits one raw frame per picture, and libx264_1 with isobmff_1 then build the MP4 the <video> element plays. All 50 frames come out at 61.5 dB PSNR against a native decode.

Code snippet

<video is="universal-video_1" src="testcard.m2v" using="solver_1"
        with="libmpeg2_1;isobmff_1;libx264_1" controls> </video>

The MPEG-2 demo uses the same decoder on a longer sequence, and the canvas version renders it without re-encoding.

Specifications :

The specifications of the test sequence are :

Format H.262 raw elementary stream, 352x288, 25 fps, 50 frames
FileSize 130 Ko
Solver solver_1