1
1
mirror of https://github.com/wader/fq.git synced 2024-09-11 12:05:39 +03:00

Merge pull request #826 from wader/mpeg_es_ios_descriptors

mpeg_es: Support ES_ID_Inc and decode descriptors for IOD tags
This commit is contained in:
Mattias Wadman 2023-12-06 15:33:31 +01:00 committed by GitHub
commit 86e6d58ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,23 @@
$ fq -d mp4 -o force=true d iods_box_es_iod_decrs
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: iods_box_es_iod_decrs (mp4)
| | | boxes[0:1]:
| | | [0]{}: box
0x00|00 00 00 21 |...! | size: 33
0x00| 69 6f 64 73 | iods | type: "iods" (Object Descriptor container box)
0x00| 00 00 00 00 | .... | version: 0
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| descriptor{}: (mpeg_es)
0x00| 10 | . | tag_id: "MP4_IOD_Tag" (16)
0x00| 80 80 80| ...| length: 16
0x10|10 |. |
0x10| 00 4f | .O | od_id: 79
0x10| ff | . | od_profile_level: 255
0x10| ff | . | scene_profile_level: 255
0x10| 31 | 1 | audio_profile_level: 49
0x10| ff | . | video_profile_level: 255
0x10| ff | . | graphics_profile_level: 255
| | | descriptors[0:1]:
| | | [0]{}: desc
0x10| 0e | . | tag_id: "ES_ID_IncTag" (14)
0x10| 80 80 80 04 | .... | length: 4
0x10| 00 00 00| ...| track_id: 1
0x20|01| |.| |

View File

@ -56,6 +56,7 @@ $ fq -d mp4 'dv' stz2.mp4
0x090| fe | . | audio_profile_level: 254 0x9a-0x9b (1)
0x090| ff | . | video_profile_level: 255 0x9b-0x9c (1)
0x090| ff | . | graphics_profile_level: 255 0x9c-0x9d (1)
| | | descriptors[0:0]: 0x9d-0x9d (0)
| | | [2]{}: box 0x9d-0x27c (479)
0x090| 00 00 01| ...| size: 479 0x9d-0xa1 (4)
0x0a0|df |. |

View File

@ -264,6 +264,7 @@ 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
// TODO: IOD = initial object descriptor?
MP4_IOD_Tag: func(d *decode.D) {
d.FieldU16("od_id")
d.FieldU8("od_profile_level")
@ -271,6 +272,14 @@ func odDecodeTag(d *decode.D, edc *esDecodeContext, _ int, fn func(d *decode.D))
d.FieldU8("audio_profile_level")
d.FieldU8("video_profile_level")
d.FieldU8("graphics_profile_level")
d.FieldArray("descriptors", func(d *decode.D) {
for !d.End() {
fieldODDecodeTag(d, edc, "desc", -1, nil)
}
})
},
ES_ID_IncTag: func(d *decode.D) {
d.FieldU32("track_id")
},
}