1
1
mirror of https://github.com/wader/fq.git synced 2024-12-24 22:05:31 +03:00

mp4,mpeg_es: Decode iods box and MP4_IOD_Tag OD

This commit is contained in:
Mattias Wadman 2023-08-30 14:55:42 +02:00
parent 97a1f828a3
commit e50028ac00
3 changed files with 24 additions and 1 deletions

View File

@ -730,6 +730,9 @@ func decodeBox(ctx *decodeContext, d *decode.D, typ string) {
d.FieldU8("version")
d.FieldU24("flags")
d.FieldFormat("descriptor", &vpxCCRGroup, nil)
case "iods":
d.FieldU32("version")
d.FieldFormat("descriptor", &mpegESGroup, nil)
case "esds":
d.FieldU32("version")
_, v := d.FieldFormat("descriptor", &mpegESGroup, nil)

View File

@ -46,7 +46,16 @@ $ fq -d mp4 'dv' stz2.mp4
| | | [1]{}: box 0x88-0x9c.7 (21)
0x080| 00 00 00 15 | .... | size: 21 0x88-0x8b.7 (4)
0x080| 69 6f 64 73| iods| type: "iods" (Object Descriptor container box) 0x8c-0x8f.7 (4)
0x090|00 00 00 00 10 07 00 4f ff ff fe ff ff |.......O..... | data: raw bits 0x90-0x9c.7 (13)
0x090|00 00 00 00 |.... | version: 0 0x90-0x93.7 (4)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| descriptor{}: (mpeg_es) 0x94-0x9c.7 (9)
0x090| 10 | . | tag_id: "MP4_IOD_Tag" (16) 0x94-0x94.7 (1)
0x090| 07 | . | length: 7 0x95-0x95.7 (1)
0x090| 00 4f | .O | od_id: 79 0x96-0x97.7 (2)
0x090| ff | . | od_profile_level: 255 0x98-0x98.7 (1)
0x090| ff | . | scene_profile_level: 255 0x99-0x99.7 (1)
0x090| fe | . | audio_profile_level: 254 0x9a-0x9a.7 (1)
0x090| ff | . | video_profile_level: 255 0x9b-0x9b.7 (1)
0x090| ff | . | graphics_profile_level: 255 0x9c-0x9c.7 (1)
| | | [2]{}: box 0x9d-0x27b.7 (479)
0x090| 00 00 01| ...| size: 479 0x9d-0xa0.7 (4)
0x0a0|df |. |

View File

@ -261,6 +261,17 @@ func odDecodeTag(d *decode.D, edc *esDecodeContext, _ int, fn func(d *decode.D))
}
}
},
// TODO: where is the spec?
// https://xhelmboyx.tripod.com/formats/mp4-layout.txt
// https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/movenc.c mov_write_iods_tag
MP4_IOD_Tag: func(d *decode.D) {
d.FieldU16("od_id")
d.FieldU8("od_profile_level")
d.FieldU8("scene_profile_level")
d.FieldU8("audio_profile_level")
d.FieldU8("video_profile_level")
d.FieldU8("graphics_profile_level")
},
}
// TODO: expectedTagID