diff --git a/format/mp4/handler.go b/format/mp4/handler.go index ce77dc9..aeef1cc 100644 --- a/format/mp4/handler.go +++ b/format/mp4/handler.go @@ -11,6 +11,14 @@ var CodecTypes = []av.CodecType{av.H264, av.AAC} func Handler(h *avutil.RegisterHandler) { h.Ext = ".mp4" + h.Probe = func(b []byte) bool { + switch string(b[4:8]) { + case "moov","ftyp","free","mdat","moof": + return true + } + return false + } + h.ReaderDemuxer = func(r io.Reader) av.Demuxer { return NewDemuxer(r.(io.ReadSeeker)) }