From 67c6c7cf0476ac8315f42237905eb270e8f3325e Mon Sep 17 00:00:00 2001 From: varz1 Date: Thu, 30 Nov 2023 00:52:35 +0800 Subject: [PATCH] added mxf extension support --- README.md | 1 + matchers/video.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index c1f088e..ec96065 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ func main() { - **mpg** - `video/mpeg` - **flv** - `video/x-flv` - **3gp** - `video/3gpp` +- **mxf** - `application/mxf` #### Audio diff --git a/matchers/video.go b/matchers/video.go index 568cbf9..0b5be3d 100644 --- a/matchers/video.go +++ b/matchers/video.go @@ -13,6 +13,7 @@ var ( TypeMpeg = newType("mpg", "video/mpeg") TypeFlv = newType("flv", "video/x-flv") Type3gp = newType("3gp", "video/3gpp") + TypeMxf = newType("mxf", "application/mxf") ) var Video = Map{ @@ -26,6 +27,19 @@ var Video = Map{ TypeMpeg: Mpeg, TypeFlv: Flv, Type3gp: Match3gp, + TypeMxf: Mxf, +} + +func Mxf(buf []byte) bool { + + return len(buf) > 13 && + buf[0] == 0x06 && buf[1] == 0x0E && + buf[2] == 0x2B && buf[3] == 0x34 && + buf[4] == 0x02 && buf[5] == 0x05 && + buf[6] == 0x01 && buf[7] == 0x01 && + buf[8] == 0x0D && buf[9] == 0x01 && + buf[10] == 0x02 && buf[11] == 0x01 && + buf[12] == 0x01 && buf[13] == 0x02 } func M4v(buf []byte) bool {