MPEG-4 Part 2 video decoder in pure Go (DivX, Xvid, H.263), with an AVI demuxer. No CGo, no dependencies.
Decode a raw MPEG-4 or H.263 stream from an io.Reader:
r := mpeg4.NewReader(f)
for {
pic, pts, err := r.Next()
...
}Decode the video track of an AVI file:
f, err := avi.Open(r, size)
v, err := mpeg4.NewVideo(f.Video(), f.Video().Handler)
for {
pic, pts, err := v.Next()
...
}Pictures come back in display order and stay valid until the next Decode or Next. NewVideo takes any track that implements mpeg4.Samples.
- Simple and Advanced Simple profiles, and baseline H.263
- I, P and B-VOPs, quarter sample motion, GMC and interlaced video
- Data partitioning, RVLC and video packets
- DivX packed bitstreams
- AVI, including OpenDML
MIT, see LICENSE. The decoder is a port of OxideAV. This software is based in part on the work of the Independent JPEG Group.
The MPEG-4 Visual patents have expired; the last one in the licensing pool ran out in July 2026.