1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 09:56:07 +03:00

mp4: Properly decode tfra

This commit is contained in:
Mattias Wadman 2021-08-12 12:59:15 +02:00
parent f2c1327005
commit 6b8d26c0de
2 changed files with 58 additions and 20 deletions

View File

@ -838,6 +838,7 @@ func init() {
"tfra": func(_ *decodeContext, d *decode.D) {
version := d.FieldU8("version")
d.FieldU24("flags")
d.FieldU32("track_id")
d.FieldU26("reserved")
lengthSizeOfTrafNum := d.FieldU2("length_size_of_traf_num")
sampleLengthSizeOfTrunNum := d.FieldU2("sample_length_size_of_trun_num")

View File

@ -1020,30 +1020,73 @@
0x2af0| 6d 66| mf| type: "mfra" (Movie fragment random access) 0x2afe-0x2b01.7 (4)
0x2b00|72 61 |ra |
| | | boxes: [3] 0x2b02-0x2bb3.7 (178)
| | | [0]: box {} 0x2b02-0x2b15.7 (20)
| | | [0]: box {} 0x2b02-0x2b52.7 (81)
0x2b00| 00 00 00 51 | ...Q | size: 81 0x2b02-0x2b05.7 (4)
0x2b00| 74 66 72 61 | tfra | type: "tfra" (Track fragment radom access) 0x2b06-0x2b09.7 (4)
0x2b00| 01 | . | version: 1 0x2b0a-0x2b0a.7 (1)
0x2b00| 00 00 00 | ... | flags: 0 0x2b0b-0x2b0d.7 (3)
0x2b00| 00 00| ..| reserved: 0 0x2b0e-0x2b11.1 (3.2)
0x2b00| 00 00| ..| track_id: 1 0x2b0e-0x2b11.7 (4)
0x2b10|00 01 |.. |
0x2b10| 01 | . | length_size_of_traf_num: 0 0x2b11.2-0x2b11.3 (0.2)
0x2b10| 01 | . | sample_length_size_of_trun_num: 0 0x2b11.4-0x2b11.5 (0.2)
0x2b10| 01 | . | length_size_of_sample_num: 1 0x2b11.6-0x2b11.7 (0.2)
0x2b10| 00 00 00 00 | .... | entry_count: 0 0x2b12-0x2b15.7 (4)
| | | entries: [0] 0x2b16-NA (0)
| | | [1]: box {} 0x2b53-0x2b66.7 (20)
0x2b10| 00 00 00 00 | .... | reserved: 0 0x2b12-0x2b15.1 (3.2)
0x2b10| 00 | . | length_size_of_traf_num: 0 0x2b15.2-0x2b15.3 (0.2)
0x2b10| 00 | . | sample_length_size_of_trun_num: 0 0x2b15.4-0x2b15.5 (0.2)
0x2b10| 00 | . | length_size_of_sample_num: 0 0x2b15.6-0x2b15.7 (0.2)
0x2b10| 00 00 00 03 | .... | entry_count: 3 0x2b16-0x2b19.7 (4)
| | | entries: [3] 0x2b1a-0x2b52.7 (57)
| | | [0]: entry {} 0x2b1a-0x2b2c.7 (19)
0x2b10| 00 00 00 00 00 00| ......| time: 0 0x2b1a-0x2b21.7 (8)
0x2b20|00 00 |.. |
0x2b20| 00 00 00 00 00 00 05 85 | ........ | moof_offset: 1413 0x2b22-0x2b29.7 (8)
0x2b20| 01 | . | traf_number: 1 0x2b2a-0x2b2a.7 (1)
0x2b20| 01 | . | trun_number: 1 0x2b2b-0x2b2b.7 (1)
0x2b20| 01 | . | sample_number: 1 0x2b2c-0x2b2c.7 (1)
| | | [1]: entry {} 0x2b2d-0x2b3f.7 (19)
0x2b20| 00 00 00| ...| time: 810 0x2b2d-0x2b34.7 (8)
0x2b30|00 00 00 03 2a |....* |
0x2b30| 00 00 00 00 00 00 16 48 | .......H | moof_offset: 5704 0x2b35-0x2b3c.7 (8)
0x2b30| 01 | . | traf_number: 1 0x2b3d-0x2b3d.7 (1)
0x2b30| 01 | . | trun_number: 1 0x2b3e-0x2b3e.7 (1)
0x2b30| 01| .| sample_number: 1 0x2b3f-0x2b3f.7 (1)
| | | [2]: entry {} 0x2b40-0x2b52.7 (19)
0x2b40|00 00 00 00 00 00 05 2a |.......* | time: 1322 0x2b40-0x2b47.7 (8)
0x2b40| 00 00 00 00 00 00 21 69| ......!i| moof_offset: 8553 0x2b48-0x2b4f.7 (8)
0x2b50|01 |. | traf_number: 1 0x2b50-0x2b50.7 (1)
0x2b50| 01 | . | trun_number: 1 0x2b51-0x2b51.7 (1)
0x2b50| 01 | . | sample_number: 1 0x2b52-0x2b52.7 (1)
| | | [1]: box {} 0x2b53-0x2ba3.7 (81)
0x2b50| 00 00 00 51 | ...Q | size: 81 0x2b53-0x2b56.7 (4)
0x2b50| 74 66 72 61 | tfra | type: "tfra" (Track fragment radom access) 0x2b57-0x2b5a.7 (4)
0x2b50| 01 | . | version: 1 0x2b5b-0x2b5b.7 (1)
0x2b50| 00 00 00 | ... | flags: 0 0x2b5c-0x2b5e.7 (3)
0x2b50| 00| .| reserved: 0 0x2b5f-0x2b62.1 (3.2)
0x2b50| 00| .| track_id: 2 0x2b5f-0x2b62.7 (4)
0x2b60|00 00 02 |... |
0x2b60| 02 | . | length_size_of_traf_num: 0 0x2b62.2-0x2b62.3 (0.2)
0x2b60| 02 | . | sample_length_size_of_trun_num: 0 0x2b62.4-0x2b62.5 (0.2)
0x2b60| 02 | . | length_size_of_sample_num: 2 0x2b62.6-0x2b62.7 (0.2)
0x2b60| 00 00 00 00 | .... | entry_count: 0 0x2b63-0x2b66.7 (4)
| | | entries: [0] 0x2b67-NA (0)
0x2b60| 00 00 00 00 | .... | reserved: 0 0x2b63-0x2b66.1 (3.2)
0x2b60| 00 | . | length_size_of_traf_num: 0 0x2b66.2-0x2b66.3 (0.2)
0x2b60| 00 | . | sample_length_size_of_trun_num: 0 0x2b66.4-0x2b66.5 (0.2)
0x2b60| 00 | . | length_size_of_sample_num: 0 0x2b66.6-0x2b66.7 (0.2)
0x2b60| 00 00 00 03 | .... | entry_count: 3 0x2b67-0x2b6a.7 (4)
| | | entries: [3] 0x2b6b-0x2ba3.7 (57)
| | | [0]: entry {} 0x2b6b-0x2b7d.7 (19)
0x2b60| 00 00 00 00 00| .....| time: 0 0x2b6b-0x2b72.7 (8)
0x2b70|00 00 00 |... |
0x2b70| 00 00 00 00 00 00 05 85 | ........ | moof_offset: 1413 0x2b73-0x2b7a.7 (8)
0x2b70| 01 | . | traf_number: 1 0x2b7b-0x2b7b.7 (1)
0x2b70| 01 | . | trun_number: 1 0x2b7c-0x2b7c.7 (1)
0x2b70| 01 | . | sample_number: 1 0x2b7d-0x2b7d.7 (1)
| | | [1]: entry {} 0x2b7e-0x2b90.7 (19)
0x2b70| 00 00| ..| time: 3072 0x2b7e-0x2b85.7 (8)
0x2b80|00 00 00 00 0c 00 |...... |
0x2b80| 00 00 00 00 00 00 16 48 | .......H | moof_offset: 5704 0x2b86-0x2b8d.7 (8)
0x2b80| 01 | . | traf_number: 1 0x2b8e-0x2b8e.7 (1)
0x2b80| 01| .| trun_number: 1 0x2b8f-0x2b8f.7 (1)
0x2b90|01 |. | sample_number: 1 0x2b90-0x2b90.7 (1)
| | | [2]: entry {} 0x2b91-0x2ba3.7 (19)
0x2b90| 00 00 00 00 00 00 14 00 | ........ | time: 5120 0x2b91-0x2b98.7 (8)
0x2b90| 00 00 00 00 00 00 21| ......!| moof_offset: 8553 0x2b99-0x2ba0.7 (8)
0x2ba0|69 |i |
0x2ba0| 01 | . | traf_number: 1 0x2ba1-0x2ba1.7 (1)
0x2ba0| 01 | . | trun_number: 1 0x2ba2-0x2ba2.7 (1)
0x2ba0| 01 | . | sample_number: 1 0x2ba3-0x2ba3.7 (1)
| | | [2]: box {} 0x2ba4-0x2bb3.7 (16)
0x2ba0| 00 00 00 10 | .... | size: 16 0x2ba4-0x2ba7.7 (4)
0x2ba0| 6d 66 72 6f | mfro | type: "mfro" (Movie fragment random access offset) 0x2ba8-0x2bab.7 (4)
@ -1225,9 +1268,3 @@
0x2af0| 81 b4 | .. | scale_factor_grouping: 109 0x2af7.7-0x2af8.5 (0.7)
0x2af0| b4 | . | [1]: byte_align 00 0x2af8.6-0x2af8.7 (0.2)
0x2af0| 70 | p | data: 70 0x2af9-0x2af9.7 (1)
0x2b10| 00 00 00 03 00 00 00 00 00 00| ..........| unknown0: 00000003000000000000000000000000... 0x2b16-0x2b52.7 (61)
0x2b20|00 00 00 00 00 00 00 00 05 85 01 01 01 00 00 00|................|
* |until 0x2b52.7 (61) | |
0x2b60| 00 00 00 03 00 00 00 00 00| .........| unknown1: 00000003000000000000000000000000... 0x2b67-0x2ba3.7 (61)
0x2b70|00 00 00 00 00 00 00 00 00 05 85 01 01 01 00 00|................|
* |until 0x2ba3.7 (61) | |