mirror of
https://github.com/wader/fq.git
synced 2024-11-23 00:57:15 +03:00
decode: Add UTF8Fn functions and trim some null terminated strings
This commit is contained in:
parent
589207da20
commit
3db11d3fa8
@ -4,8 +4,6 @@ package icc
|
||||
// https://www.color.org/icc32.pdf
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/format/registry"
|
||||
"github.com/wader/fq/internal/num"
|
||||
@ -45,9 +43,7 @@ func descType(d *decode.D) {
|
||||
d.FieldStrNullTerminatedLen("localizable_description", int(localDescLen))
|
||||
d.FieldU16("script_code")
|
||||
d.FieldU8("macintosh_description_length")
|
||||
d.FieldStrFn("macintosh_description", func() (string, string) {
|
||||
return strings.Trim(d.UTF8(67), "\x00 "), ""
|
||||
})
|
||||
d.FieldUTF8Null("macintosh_description", 67)
|
||||
}
|
||||
|
||||
var typToDecode = map[string]func(d *decode.D){
|
||||
@ -97,13 +93,13 @@ func iccProfileDecode(d *decode.D, in interface{}) interface{} {
|
||||
d.DecodeLenFn(int64(size)*8, func(d *decode.D) {
|
||||
d.FieldStructFn("header", func(d *decode.D) {
|
||||
d.FieldU32("size")
|
||||
d.FieldUTF8("cmm_type_signature", 4)
|
||||
d.FieldUTF8Null("cmm_type_signature", 4)
|
||||
fieldBCDU8(d, "version_major")
|
||||
fieldBCDU8(d, "version_minor")
|
||||
d.FieldU16("version_reserved")
|
||||
d.FieldUTF8("device_class_signature", 4)
|
||||
d.FieldUTF8("color_space", 4)
|
||||
d.FieldUTF8("connection_space", 4)
|
||||
d.FieldUTF8Null("device_class_signature", 4)
|
||||
d.FieldUTF8Null("color_space", 4)
|
||||
d.FieldUTF8Null("connection_space", 4)
|
||||
d.FieldStructFn("timestamp", func(d *decode.D) {
|
||||
d.FieldU16("year")
|
||||
d.FieldU16("month")
|
||||
@ -113,16 +109,16 @@ func iccProfileDecode(d *decode.D, in interface{}) interface{} {
|
||||
d.FieldU16("seconds")
|
||||
|
||||
})
|
||||
d.FieldUTF8("file_signature", 4)
|
||||
d.FieldUTF8("primary_platform", 4)
|
||||
d.FieldUTF8Null("file_signature", 4)
|
||||
d.FieldUTF8Null("primary_platform", 4)
|
||||
d.FieldU32("flags")
|
||||
d.FieldUTF8("device_manufacturer", 4)
|
||||
d.FieldUTF8("device_model", 4)
|
||||
d.FieldUTF8("device_attribute", 8)
|
||||
d.FieldUTF8("render_intent", 4)
|
||||
d.FieldUTF8("xyz_illuminant", 12)
|
||||
d.FieldUTF8("profile_creator_signature", 4)
|
||||
d.FieldUTF8("profile_id", 16)
|
||||
d.FieldUTF8Null("device_manufacturer", 4)
|
||||
d.FieldUTF8Null("device_model", 4)
|
||||
d.FieldUTF8Null("device_attribute", 8)
|
||||
d.FieldUTF8Null("render_intent", 4)
|
||||
d.FieldUTF8Null("xyz_illuminant", 12)
|
||||
d.FieldUTF8Null("profile_creator_signature", 4)
|
||||
d.FieldUTF8Null("profile_id", 16)
|
||||
d.FieldValidateZeroPadding("reserved", 28*8)
|
||||
})
|
||||
|
||||
@ -131,12 +127,12 @@ func iccProfileDecode(d *decode.D, in interface{}) interface{} {
|
||||
d.FieldArrayFn("table", func(d *decode.D) {
|
||||
for i := uint64(0); i < tagCount; i++ {
|
||||
d.FieldStructFn("element", func(d *decode.D) {
|
||||
d.FieldUTF8("signature", 4)
|
||||
d.FieldUTF8Null("signature", 4)
|
||||
offset := d.FieldU32("offset")
|
||||
size := d.FieldU32("size")
|
||||
|
||||
d.DecodeRangeFn(int64(offset)*8, int64(size)*8, func(d *decode.D) {
|
||||
typ := d.FieldUTF8("type", 4)
|
||||
typ := d.FieldUTF8Null("type", 4)
|
||||
d.FieldU32("reserved")
|
||||
|
||||
if fn, ok := typToDecode[typ]; ok {
|
||||
|
14
format/icc/testdata/sRGB2014.fqtest
vendored
14
format/icc/testdata/sRGB2014.fqtest
vendored
@ -4,7 +4,7 @@ $ fq -d icc_profile verbose /sRGB2014.icc
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /sRGB2014.icc (icc_profile) 0x0-0xbcf.7 (3024)
|
||||
| | | header: {} 0x0-0x7f.7 (128)
|
||||
0x000|00 00 0b d0 |.... | size: 3024 0x0-0x3.7 (4)
|
||||
0x000| 00 00 00 00 | .... | cmm_type_signature: "\x00\x00\x00\x00" 0x4-0x7.7 (4)
|
||||
0x000| 00 00 00 00 | .... | cmm_type_signature: "" 0x4-0x7.7 (4)
|
||||
0x000| 02 | . | version_major: 2 0x8-0x8.7 (1)
|
||||
0x000| 00 | . | version_minor: 0 0x9-0x9.7 (1)
|
||||
0x000| 00 00 | .. | version_reserved: 0 0xa-0xb.7 (2)
|
||||
@ -19,14 +19,14 @@ $ fq -d icc_profile verbose /sRGB2014.icc
|
||||
0x020|00 00 |.. | minutes: 0 0x20-0x21.7 (2)
|
||||
0x020| 00 00 | .. | seconds: 0 0x22-0x23.7 (2)
|
||||
0x020| 61 63 73 70 | acsp | file_signature: "acsp" 0x24-0x27.7 (4)
|
||||
0x020| 00 00 00 00 | .... | primary_platform: "\x00\x00\x00\x00" 0x28-0x2b.7 (4)
|
||||
0x020| 00 00 00 00 | .... | primary_platform: "" 0x28-0x2b.7 (4)
|
||||
0x020| 00 00 00 00| ....| flags: 0 0x2c-0x2f.7 (4)
|
||||
0x030|00 00 00 00 |.... | device_manufacturer: "\x00\x00\x00\x00" 0x30-0x33.7 (4)
|
||||
0x030| 00 00 00 00 | .... | device_model: "\x00\x00\x00\x00" 0x34-0x37.7 (4)
|
||||
0x030| 00 00 00 01 00 00 00 00| ........| device_attribute: "\x00\x00\x00\x01\x00\x00\x00\x00" 0x38-0x3f.7 (8)
|
||||
0x040|00 00 00 00 |.... | render_intent: "\x00\x00\x00\x00" 0x40-0x43.7 (4)
|
||||
0x030|00 00 00 00 |.... | device_manufacturer: "" 0x30-0x33.7 (4)
|
||||
0x030| 00 00 00 00 | .... | device_model: "" 0x34-0x37.7 (4)
|
||||
0x030| 00 00 00 01 00 00 00 00| ........| device_attribute: "\x00\x00\x00\x01" 0x38-0x3f.7 (8)
|
||||
0x040|00 00 00 00 |.... | render_intent: "" 0x40-0x43.7 (4)
|
||||
0x040| 00 00 f6 d6 00 01 00 00 00 00 d3 2d| ...........-| xyz_illuminant: "\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-" 0x44-0x4f.7 (12)
|
||||
0x050|00 00 00 00 |.... | profile_creator_signature: "\x00\x00\x00\x00" 0x50-0x53.7 (4)
|
||||
0x050|00 00 00 00 |.... | profile_creator_signature: "" 0x50-0x53.7 (4)
|
||||
0x050| 3d 0e b2 de ae 93 97 be 9b 67 26 ce| =........g&.| profile_id: "=\x0e\xb2ޮ\x93\x97\xbe\x9bg&Ό\nC\xce" 0x54-0x63.7 (16)
|
||||
0x060|8c 0a 43 ce |..C. |
|
||||
0x060| 00 00 00 00 00 00 00 00 00 00 00 00| ............| reserved: Correct (none) (zero padding) 0x64-0x7f.7 (28)
|
||||
|
@ -1,8 +1,6 @@
|
||||
package id3
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/format/registry"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
@ -18,12 +16,6 @@ func init() {
|
||||
})
|
||||
}
|
||||
|
||||
func field(d *decode.D, name string, nBytes int) {
|
||||
d.FieldStrFn(name, func() (string, string) {
|
||||
return strings.Trim(d.UTF8(nBytes), "\x00 "), ""
|
||||
})
|
||||
}
|
||||
|
||||
// Decode ID3v1 tag
|
||||
func id3v1Decode(d *decode.D, in interface{}) interface{} {
|
||||
d.ValidateAtLeastBitsLeft(128 * 8)
|
||||
@ -31,11 +23,11 @@ func id3v1Decode(d *decode.D, in interface{}) interface{} {
|
||||
if d.PeekBits(8) == uint64('+') {
|
||||
d.Invalid("looks like id3v11")
|
||||
}
|
||||
field(d, "song_name", 30)
|
||||
field(d, "artist", 30)
|
||||
field(d, "album_name", 30)
|
||||
field(d, "year", 4)
|
||||
field(d, "comment", 30)
|
||||
d.FieldUTF8Null("song_name", 30)
|
||||
d.FieldUTF8Null("artist", 30)
|
||||
d.FieldUTF8Null("album_name", 30)
|
||||
d.FieldUTF8Null("year", 4)
|
||||
d.FieldUTF8Null("comment", 30)
|
||||
// from https://en.wikipedia.org/wiki/List_of_ID3v1_Genres
|
||||
d.FieldStringMapFn("genre", map[uint64]string{
|
||||
0: "Blues",
|
||||
|
@ -239,7 +239,7 @@ func decodeMaster(d *decode.D, bitsLimit int64, tag ebml.Tag, dc *decodeContext)
|
||||
dc.currentTrack.codec = v
|
||||
}
|
||||
case ebml.UTF8:
|
||||
d.FieldUTF8("value", int(tagSize))
|
||||
d.FieldUTF8Null("value", int(tagSize))
|
||||
case ebml.Date:
|
||||
// TODO:
|
||||
/*
|
||||
|
2
format/matroska/testdata/aac.fqtest
vendored
2
format/matroska/testdata/aac.fqtest
vendored
@ -330,7 +330,7 @@ $ fq -d matroska verbose /aac.mkv
|
||||
| | | type: UTF8 (4) 0x201-NA (0)
|
||||
0x200| 44 87 | D. | id: TagString (0x4487) 0x201-0x202.7 (2)
|
||||
0x200| 94 | . | size: 20 0x203-0x203.7 (1)
|
||||
0x200| 30 30 3a 30 30 3a 30 30 2e 30 37 33| 00:00:00.073| value: "00:00:00.073000000\x00\x00" 0x204-0x217.7 (20)
|
||||
0x200| 30 30 3a 30 30 3a 30 30 2e 30 37 33| 00:00:00.073| value: "00:00:00.073000000" 0x204-0x217.7 (20)
|
||||
0x210|30 30 30 30 30 30 00 00 |000000.. |
|
||||
| | | [5]: element {} 0x218-0x4a7.7 (656)
|
||||
| | | type: master (7) 0x218-NA (0)
|
||||
|
2
format/matroska/testdata/av1.fqtest
vendored
2
format/matroska/testdata/av1.fqtest
vendored
@ -339,7 +339,7 @@ $ fq -d matroska verbose /av1.mkv
|
||||
| | | type: UTF8 (4) 0x20a-NA (0)
|
||||
0x0200| 44 87 | D. | id: TagString (0x4487) 0x20a-0x20b.7 (2)
|
||||
0x0200| 94 | . | size: 20 0x20c-0x20c.7 (1)
|
||||
0x0200| 30 30 3a| 00:| value: "00:00:00.040000000\x00\x00" 0x20d-0x220.7 (20)
|
||||
0x0200| 30 30 3a| 00:| value: "00:00:00.040000000" 0x20d-0x220.7 (20)
|
||||
0x0210|30 30 3a 30 30 2e 30 34 30 30 30 30 30 30 30 00|00:00.040000000.|
|
||||
0x0220|00 |. |
|
||||
| | | [5]: element {} 0x221-0x13ca.7 (4522)
|
||||
|
2
format/matroska/testdata/avc.fqtest
vendored
2
format/matroska/testdata/avc.fqtest
vendored
@ -426,7 +426,7 @@ $ fq -d matroska verbose /avc.mkv
|
||||
| | | type: UTF8 (4) 0x23e-NA (0)
|
||||
0x0230| 44 87| D.| id: TagString (0x4487) 0x23e-0x23f.7 (2)
|
||||
0x0240|94 |. | size: 20 0x240-0x240.7 (1)
|
||||
0x0240| 30 30 3a 30 30 3a 30 30 2e 30 34 30 30 30 30| 00:00:00.040000| value: "00:00:00.040000000\x00\x00" 0x241-0x254.7 (20)
|
||||
0x0240| 30 30 3a 30 30 3a 30 30 2e 30 34 30 30 30 30| 00:00:00.040000| value: "00:00:00.040000000" 0x241-0x254.7 (20)
|
||||
0x0250|30 30 30 00 00 |000.. |
|
||||
| | | [5]: element {} 0x255-0xd2a.7 (2774)
|
||||
| | | type: master (7) 0x255-NA (0)
|
||||
|
2
format/matroska/testdata/flac.fqtest
vendored
2
format/matroska/testdata/flac.fqtest
vendored
@ -343,7 +343,7 @@ $ fq -d matroska verbose /flac.mkv
|
||||
| | | type: UTF8 (4) 0x228-NA (0)
|
||||
0x220| 44 87 | D. | id: TagString (0x4487) 0x228-0x229.7 (2)
|
||||
0x220| 94 | . | size: 20 0x22a-0x22a.7 (1)
|
||||
0x220| 30 30 3a 30 30| 00:00| value: "00:00:00.050000000\x00\x00" 0x22b-0x23e.7 (20)
|
||||
0x220| 30 30 3a 30 30| 00:00| value: "00:00:00.050000000" 0x22b-0x23e.7 (20)
|
||||
0x230|3a 30 30 2e 30 35 30 30 30 30 30 30 30 00 00 |:00.050000000.. |
|
||||
| | | [5]: element {} 0x23f-0x4b2.7 (628)
|
||||
| | | type: master (7) 0x23f-NA (0)
|
||||
|
2
format/matroska/testdata/hevc.fqtest
vendored
2
format/matroska/testdata/hevc.fqtest
vendored
@ -415,7 +415,7 @@ $ fq -d matroska verbose /hevc.mkv
|
||||
| | | type: UTF8 (4) 0xb4d-NA (0)
|
||||
0x0b40| 44 87 | D. | id: TagString (0x4487) 0xb4d-0xb4e.7 (2)
|
||||
0x0b40| 94| .| size: 20 0xb4f-0xb4f.7 (1)
|
||||
0x0b50|30 30 3a 30 30 3a 30 30 2e 30 34 30 30 30 30 30|00:00:00.0400000| value: "00:00:00.040000000\x00\x00" 0xb50-0xb63.7 (20)
|
||||
0x0b50|30 30 3a 30 30 3a 30 30 2e 30 34 30 30 30 30 30|00:00:00.0400000| value: "00:00:00.040000000" 0xb50-0xb63.7 (20)
|
||||
0x0b60|30 30 00 00 |00.. |
|
||||
| | | [5]: element {} 0xb64-0x13ce.7 (2155)
|
||||
| | | type: master (7) 0xb64-NA (0)
|
||||
|
2
format/matroska/testdata/mp3.fqtest
vendored
2
format/matroska/testdata/mp3.fqtest
vendored
@ -321,7 +321,7 @@ $ fq -d matroska verbose /mp3.mkv
|
||||
| | | type: UTF8 (4) 0x204-NA (0)
|
||||
0x200| 44 87 | D. | id: TagString (0x4487) 0x204-0x205.7 (2)
|
||||
0x200| 94 | . | size: 20 0x206-0x206.7 (1)
|
||||
0x200| 30 30 3a 30 30 3a 30 30 2e| 00:00:00.| value: "00:00:00.075000000\x00\x00" 0x207-0x21a.7 (20)
|
||||
0x200| 30 30 3a 30 30 3a 30 30 2e| 00:00:00.| value: "00:00:00.075000000" 0x207-0x21a.7 (20)
|
||||
0x210|30 37 35 30 30 30 30 30 30 00 00 |075000000.. |
|
||||
| | | [5]: element {} 0x21b-0x4bf.7 (677)
|
||||
| | | type: master (7) 0x21b-NA (0)
|
||||
|
2
format/matroska/testdata/mpeg2.fqtest
vendored
2
format/matroska/testdata/mpeg2.fqtest
vendored
@ -320,7 +320,7 @@ $ fq -d matroska verbose /mpeg2.mkv
|
||||
| | | type: UTF8 (4) 0x207-NA (0)
|
||||
0x0200| 44 87 | D. | id: TagString (0x4487) 0x207-0x208.7 (2)
|
||||
0x0200| 94 | . | size: 20 0x209-0x209.7 (1)
|
||||
0x0200| 30 30 3a 30 30 3a| 00:00:| value: "00:00:00.040000000\x00\x00" 0x20a-0x21d.7 (20)
|
||||
0x0200| 30 30 3a 30 30 3a| 00:00:| value: "00:00:00.040000000" 0x20a-0x21d.7 (20)
|
||||
0x0210|30 30 2e 30 34 30 30 30 30 30 30 30 00 00 |00.040000000.. |
|
||||
| | | [5]: element {} 0x21e-0x21ad.7 (8080)
|
||||
| | | type: master (7) 0x21e-NA (0)
|
||||
|
2
format/matroska/testdata/opus.fqtest
vendored
2
format/matroska/testdata/opus.fqtest
vendored
@ -345,7 +345,7 @@ $ fq -d matroska verbose /opus.mkv
|
||||
| | | type: UTF8 (4) 0x21e-NA (0)
|
||||
0x210| 44 87| D.| id: TagString (0x4487) 0x21e-0x21f.7 (2)
|
||||
0x220|94 |. | size: 20 0x220-0x220.7 (1)
|
||||
0x220| 30 30 3a 30 30 3a 30 30 2e 30 35 34 30 30 30| 00:00:00.054000| value: "00:00:00.054000000\x00\x00" 0x221-0x234.7 (20)
|
||||
0x220| 30 30 3a 30 30 3a 30 30 2e 30 35 34 30 30 30| 00:00:00.054000| value: "00:00:00.054000000" 0x221-0x234.7 (20)
|
||||
0x230|30 30 30 00 00 |000.. |
|
||||
| | | [5]: element {} 0x235-0x3d0.7 (412)
|
||||
| | | type: master (7) 0x235-NA (0)
|
||||
|
2
format/matroska/testdata/vorbis.fqtest
vendored
2
format/matroska/testdata/vorbis.fqtest
vendored
@ -363,7 +363,7 @@ $ fq -d matroska verbose /vorbis.mkv
|
||||
| | | type: UTF8 (4) 0xee4-NA (0)
|
||||
0x0ee0| 44 87 | D. | id: TagString (0x4487) 0xee4-0xee5.7 (2)
|
||||
0x0ee0| 94 | . | size: 20 0xee6-0xee6.7 (1)
|
||||
0x0ee0| 30 30 3a 30 30 3a 30 30 2e| 00:00:00.| value: "00:00:00.050000000\x00\x00" 0xee7-0xefa.7 (20)
|
||||
0x0ee0| 30 30 3a 30 30 3a 30 30 2e| 00:00:00.| value: "00:00:00.050000000" 0xee7-0xefa.7 (20)
|
||||
0x0ef0|30 35 30 30 30 30 30 30 30 00 00 |050000000.. |
|
||||
| | | [5]: element {} 0xefb-0x10de.7 (484)
|
||||
| | | type: master (7) 0xefb-NA (0)
|
||||
|
2
format/matroska/testdata/vp8.fqtest
vendored
2
format/matroska/testdata/vp8.fqtest
vendored
@ -320,7 +320,7 @@ $ fq -d matroska verbose /vp8.mkv
|
||||
| | | type: UTF8 (4) 0x201-NA (0)
|
||||
0x0200| 44 87 | D. | id: TagString (0x4487) 0x201-0x202.7 (2)
|
||||
0x0200| 94 | . | size: 20 0x203-0x203.7 (1)
|
||||
0x0200| 30 30 3a 30 30 3a 30 30 2e 30 34 30| 00:00:00.040| value: "00:00:00.040000000\x00\x00" 0x204-0x217.7 (20)
|
||||
0x0200| 30 30 3a 30 30 3a 30 30 2e 30 34 30| 00:00:00.040| value: "00:00:00.040000000" 0x204-0x217.7 (20)
|
||||
0x0210|30 30 30 30 30 30 00 00 |000000.. |
|
||||
| | | [5]: element {} 0x218-0x146f.7 (4696)
|
||||
| | | type: master (7) 0x218-NA (0)
|
||||
|
2
format/matroska/testdata/vp9.fqtest
vendored
2
format/matroska/testdata/vp9.fqtest
vendored
@ -320,7 +320,7 @@ $ fq -d matroska verbose /vp9.mkv
|
||||
| | | type: UTF8 (4) 0x205-NA (0)
|
||||
0x0200| 44 87 | D. | id: TagString (0x4487) 0x205-0x206.7 (2)
|
||||
0x0200| 94 | . | size: 20 0x207-0x207.7 (1)
|
||||
0x0200| 30 30 3a 30 30 3a 30 30| 00:00:00| value: "00:00:00.040000000\x00\x00" 0x208-0x21b.7 (20)
|
||||
0x0200| 30 30 3a 30 30 3a 30 30| 00:00:00| value: "00:00:00.040000000" 0x208-0x21b.7 (20)
|
||||
0x0210|2e 30 34 30 30 30 30 30 30 30 00 00 |.040000000.. |
|
||||
| | | [5]: element {} 0x21c-0x1769.7 (5454)
|
||||
| | | type: master (7) 0x21c-NA (0)
|
||||
|
@ -162,7 +162,7 @@ func init() {
|
||||
},
|
||||
"mvhd": func(_ *decodeContext, d *decode.D) {
|
||||
d.FieldU8("version")
|
||||
d.FieldUTF8("flags", 3)
|
||||
d.FieldU24("flags")
|
||||
_ = decodeFieldTime(d, "creation_time")
|
||||
_ = decodeFieldTime(d, "modification_time")
|
||||
d.FieldU32("time_scale")
|
||||
@ -254,7 +254,7 @@ func init() {
|
||||
"hdlr": func(ctx *decodeContext, d *decode.D) {
|
||||
d.FieldU8("version")
|
||||
d.FieldU24("flags")
|
||||
d.FieldUTF8("component_type", 4)
|
||||
d.FieldUTF8Null("component_type", 4)
|
||||
subTypeNames := map[string]string{
|
||||
"alis": "Alias Data",
|
||||
"camm": "Camera Metadata",
|
||||
@ -286,10 +286,10 @@ func init() {
|
||||
s := strings.TrimSpace(d.UTF8(4))
|
||||
return s, subTypeNames[s]
|
||||
})
|
||||
d.FieldUTF8("component_manufacturer", 4)
|
||||
d.FieldUTF8Null("component_manufacturer", 4)
|
||||
d.FieldU32("component_flags")
|
||||
d.FieldU32("component_flags_mask")
|
||||
d.FieldUTF8("component_name", int(d.BitsLeft()/8))
|
||||
d.FieldUTF8Null("component_name", int(d.BitsLeft()/8))
|
||||
|
||||
if ctx.currentTrack != nil {
|
||||
// component_type seems to be all zero sometimes so can't look for "mhlr"
|
||||
|
12
format/mp4/testdata/aac.fqtest
vendored
12
format/mp4/testdata/aac.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /aac.mp4
|
||||
0x290| 6d 76| mv| type: "mvhd" (Movie header, overall declarations) 0x29e-0x2a1.7 (4)
|
||||
0x2a0|68 64 |hd |
|
||||
0x2a0| 00 | . | version: 0 0x2a2-0x2a2.7 (1)
|
||||
0x2a0| 00 00 00 | ... | flags: "\x00\x00\x00" 0x2a3-0x2a5.7 (3)
|
||||
0x2a0| 00 00 00 | ... | flags: 0 0x2a3-0x2a5.7 (3)
|
||||
0x2a0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x2a6-0x2a9.7 (4)
|
||||
0x2a0| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x2aa-0x2ad.7 (4)
|
||||
0x2a0| 00 00| ..| time_scale: 1000 0x2ae-0x2b1.7 (4)
|
||||
@ -140,13 +140,13 @@ $ fq -d mp4 verbose /aac.mp4
|
||||
0x3b0| 00 | . | version: 0 0x3be-0x3be.7 (1)
|
||||
0x3b0| 00| .| flags: 0 0x3bf-0x3c1.7 (3)
|
||||
0x3c0|00 00 |.. |
|
||||
0x3c0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x3c2-0x3c5.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_type: "" 0x3c2-0x3c5.7 (4)
|
||||
0x3c0| 73 6f 75 6e | soun | component_subtype: "soun" (Audio Track) 0x3c6-0x3c9.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x3ca-0x3cd.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_manufacturer: "" 0x3ca-0x3cd.7 (4)
|
||||
0x3c0| 00 00| ..| component_flags: 0 0x3ce-0x3d1.7 (4)
|
||||
0x3d0|00 00 |.. |
|
||||
0x3d0| 00 00 00 00 | .... | component_flags_mask: 0 0x3d2-0x3d5.7 (4)
|
||||
0x3d0| 53 6f 75 6e 64 48 61 6e 64 6c| SoundHandl| component_name: "SoundHandler\x00" 0x3d6-0x3e2.7 (13)
|
||||
0x3d0| 53 6f 75 6e 64 48 61 6e 64 6c| SoundHandl| component_name: "SoundHandler" 0x3d6-0x3e2.7 (13)
|
||||
0x3e0|65 72 00 |er. |
|
||||
| | | [2]: box {} 0x3e3-0x53a.7 (344)
|
||||
0x3e0| 00 00 01 58 | ...X | size: 344 0x3e3-0x3e6.7 (4)
|
||||
@ -331,13 +331,13 @@ $ fq -d mp4 verbose /aac.mp4
|
||||
0x550| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x553-0x556.7 (4)
|
||||
0x550| 00 | . | version: 0 0x557-0x557.7 (1)
|
||||
0x550| 00 00 00 | ... | flags: 0 0x558-0x55a.7 (3)
|
||||
0x550| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x55b-0x55e.7 (4)
|
||||
0x550| 00 00 00 00 | .... | component_type: "" 0x55b-0x55e.7 (4)
|
||||
0x550| 6d| m| component_subtype: "mdir" (Metadata) 0x55f-0x562.7 (4)
|
||||
0x560|64 69 72 |dir |
|
||||
0x560| 61 70 70 6c | appl | component_manufacturer: "appl" 0x563-0x566.7 (4)
|
||||
0x560| 00 00 00 00 | .... | component_flags: 0 0x567-0x56a.7 (4)
|
||||
0x560| 00 00 00 00 | .... | component_flags_mask: 0 0x56b-0x56e.7 (4)
|
||||
0x560| 00| .| component_name: "\x00" 0x56f-0x56f.7 (1)
|
||||
0x560| 00| .| component_name: "" 0x56f-0x56f.7 (1)
|
||||
| | | [1]: box {} 0x570-0x59c.7 (45)
|
||||
0x570|00 00 00 2d |...- | size: 45 0x570-0x573.7 (4)
|
||||
0x570| 69 6c 73 74 | ilst | type: "ilst" 0x574-0x577.7 (4)
|
||||
|
12
format/mp4/testdata/av1.fqtest
vendored
12
format/mp4/testdata/av1.fqtest
vendored
@ -30,7 +30,7 @@ $ fq -d mp4 verbose /av1.mp4
|
||||
0x11c0| 00 00 00 6c | ...l | size: 108 0x11c8-0x11cb.7 (4)
|
||||
0x11c0| 6d 76 68 64| mvhd| type: "mvhd" (Movie header, overall declarations) 0x11cc-0x11cf.7 (4)
|
||||
0x11d0|00 |. | version: 0 0x11d0-0x11d0.7 (1)
|
||||
0x11d0| 00 00 00 | ... | flags: "\x00\x00\x00" 0x11d1-0x11d3.7 (3)
|
||||
0x11d0| 00 00 00 | ... | flags: 0 0x11d1-0x11d3.7 (3)
|
||||
0x11d0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x11d4-0x11d7.7 (4)
|
||||
0x11d0| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x11d8-0x11db.7 (4)
|
||||
0x11d0| 00 00 03 e8| ....| time_scale: 1000 0x11dc-0x11df.7 (4)
|
||||
@ -123,12 +123,12 @@ $ fq -d mp4 verbose /av1.mp4
|
||||
0x12e0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x12e8-0x12eb.7 (4)
|
||||
0x12e0| 00 | . | version: 0 0x12ec-0x12ec.7 (1)
|
||||
0x12e0| 00 00 00| ...| flags: 0 0x12ed-0x12ef.7 (3)
|
||||
0x12f0|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0x12f0-0x12f3.7 (4)
|
||||
0x12f0|00 00 00 00 |.... | component_type: "" 0x12f0-0x12f3.7 (4)
|
||||
0x12f0| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x12f4-0x12f7.7 (4)
|
||||
0x12f0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x12f8-0x12fb.7 (4)
|
||||
0x12f0| 00 00 00 00 | .... | component_manufacturer: "" 0x12f8-0x12fb.7 (4)
|
||||
0x12f0| 00 00 00 00| ....| component_flags: 0 0x12fc-0x12ff.7 (4)
|
||||
0x1300|00 00 00 00 |.... | component_flags_mask: 0 0x1300-0x1303.7 (4)
|
||||
0x1300| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler\x00" 0x1304-0x1310.7 (13)
|
||||
0x1300| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler" 0x1304-0x1310.7 (13)
|
||||
0x1310|00 |. |
|
||||
| | | [2]: box {} 0x1311-0x144f.7 (319)
|
||||
0x1310| 00 00 01 3f | ...? | size: 319 0x1311-0x1314.7 (4)
|
||||
@ -283,12 +283,12 @@ $ fq -d mp4 verbose /av1.mp4
|
||||
0x1460| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x1468-0x146b.7 (4)
|
||||
0x1460| 00 | . | version: 0 0x146c-0x146c.7 (1)
|
||||
0x1460| 00 00 00| ...| flags: 0 0x146d-0x146f.7 (3)
|
||||
0x1470|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0x1470-0x1473.7 (4)
|
||||
0x1470|00 00 00 00 |.... | component_type: "" 0x1470-0x1473.7 (4)
|
||||
0x1470| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x1474-0x1477.7 (4)
|
||||
0x1470| 61 70 70 6c | appl | component_manufacturer: "appl" 0x1478-0x147b.7 (4)
|
||||
0x1470| 00 00 00 00| ....| component_flags: 0 0x147c-0x147f.7 (4)
|
||||
0x1480|00 00 00 00 |.... | component_flags_mask: 0 0x1480-0x1483.7 (4)
|
||||
0x1480| 00 | . | component_name: "\x00" 0x1484-0x1484.7 (1)
|
||||
0x1480| 00 | . | component_name: "" 0x1484-0x1484.7 (1)
|
||||
| | | [1]: box {} 0x1485-0x14b1.7 (45)
|
||||
0x1480| 00 00 00 2d | ...- | size: 45 0x1485-0x1488.7 (4)
|
||||
0x1480| 69 6c 73 74 | ilst | type: "ilst" 0x1489-0x148c.7 (4)
|
||||
|
12
format/mp4/testdata/avc.fqtest
vendored
12
format/mp4/testdata/avc.fqtest
vendored
@ -30,7 +30,7 @@ $ fq -d mp4 verbose /avc.mp4
|
||||
0x0af0| 00 00 00 6c | ...l | size: 108 0xaf8-0xafb.7 (4)
|
||||
0x0af0| 6d 76 68 64| mvhd| type: "mvhd" (Movie header, overall declarations) 0xafc-0xaff.7 (4)
|
||||
0x0b00|00 |. | version: 0 0xb00-0xb00.7 (1)
|
||||
0x0b00| 00 00 00 | ... | flags: "\x00\x00\x00" 0xb01-0xb03.7 (3)
|
||||
0x0b00| 00 00 00 | ... | flags: 0 0xb01-0xb03.7 (3)
|
||||
0x0b00| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0xb04-0xb07.7 (4)
|
||||
0x0b00| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0xb08-0xb0b.7 (4)
|
||||
0x0b00| 00 00 03 e8| ....| time_scale: 1000 0xb0c-0xb0f.7 (4)
|
||||
@ -123,12 +123,12 @@ $ fq -d mp4 verbose /avc.mp4
|
||||
0x0c10| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0xc18-0xc1b.7 (4)
|
||||
0x0c10| 00 | . | version: 0 0xc1c-0xc1c.7 (1)
|
||||
0x0c10| 00 00 00| ...| flags: 0 0xc1d-0xc1f.7 (3)
|
||||
0x0c20|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0xc20-0xc23.7 (4)
|
||||
0x0c20|00 00 00 00 |.... | component_type: "" 0xc20-0xc23.7 (4)
|
||||
0x0c20| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0xc24-0xc27.7 (4)
|
||||
0x0c20| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0xc28-0xc2b.7 (4)
|
||||
0x0c20| 00 00 00 00 | .... | component_manufacturer: "" 0xc28-0xc2b.7 (4)
|
||||
0x0c20| 00 00 00 00| ....| component_flags: 0 0xc2c-0xc2f.7 (4)
|
||||
0x0c30|00 00 00 00 |.... | component_flags_mask: 0 0xc30-0xc33.7 (4)
|
||||
0x0c30| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler\x00" 0xc34-0xc40.7 (13)
|
||||
0x0c30| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler" 0xc34-0xc40.7 (13)
|
||||
0x0c40|00 |. |
|
||||
| | | [2]: box {} 0xc41-0xd90.7 (336)
|
||||
0x0c40| 00 00 01 50 | ...P | size: 336 0xc41-0xc44.7 (4)
|
||||
@ -370,13 +370,13 @@ $ fq -d mp4 verbose /avc.mp4
|
||||
0x0da0| 00 | . | version: 0 0xdad-0xdad.7 (1)
|
||||
0x0da0| 00 00| ..| flags: 0 0xdae-0xdb0.7 (3)
|
||||
0x0db0|00 |. |
|
||||
0x0db0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0xdb1-0xdb4.7 (4)
|
||||
0x0db0| 00 00 00 00 | .... | component_type: "" 0xdb1-0xdb4.7 (4)
|
||||
0x0db0| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0xdb5-0xdb8.7 (4)
|
||||
0x0db0| 61 70 70 6c | appl | component_manufacturer: "appl" 0xdb9-0xdbc.7 (4)
|
||||
0x0db0| 00 00 00| ...| component_flags: 0 0xdbd-0xdc0.7 (4)
|
||||
0x0dc0|00 |. |
|
||||
0x0dc0| 00 00 00 00 | .... | component_flags_mask: 0 0xdc1-0xdc4.7 (4)
|
||||
0x0dc0| 00 | . | component_name: "\x00" 0xdc5-0xdc5.7 (1)
|
||||
0x0dc0| 00 | . | component_name: "" 0xdc5-0xdc5.7 (1)
|
||||
| | | [1]: box {} 0xdc6-0xdf2.7 (45)
|
||||
0x0dc0| 00 00 00 2d | ...- | size: 45 0xdc6-0xdc9.7 (4)
|
||||
0x0dc0| 69 6c 73 74 | ilst | type: "ilst" 0xdca-0xdcd.7 (4)
|
||||
|
24
format/mp4/testdata/dash.fqtest
vendored
24
format/mp4/testdata/dash.fqtest
vendored
@ -26,7 +26,7 @@ $ fq -d mp4 verbose /dash_audio_init.mp4
|
||||
0x020| 00 00 00 6c | ...l | size: 108 0x28-0x2b.7 (4)
|
||||
0x020| 6d 76 68 64| mvhd| type: "mvhd" (Movie header, overall declarations) 0x2c-0x2f.7 (4)
|
||||
0x030|00 |. | version: 0 0x30-0x30.7 (1)
|
||||
0x030| 00 00 00 | ... | flags: "\x00\x00\x00" 0x31-0x33.7 (3)
|
||||
0x030| 00 00 00 | ... | flags: 0 0x31-0x33.7 (3)
|
||||
0x030| dd 57 d6 92 | .W.. | creation_time: 2021-09-06T13:41:38Z (3713521298) 0x34-0x37.7 (4)
|
||||
0x030| dd 57 d6 92 | .W.. | modification_time: 2021-09-06T13:41:38Z (3713521298) 0x38-0x3b.7 (4)
|
||||
0x030| 00 00 ac 44| ...D| time_scale: 44100 0x3c-0x3f.7 (4)
|
||||
@ -62,9 +62,9 @@ $ fq -d mp4 verbose /dash_audio_init.mp4
|
||||
0x0a0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0xa4-0xa7.7 (4)
|
||||
0x0a0| 00 | . | version: 0 0xa8-0xa8.7 (1)
|
||||
0x0a0| 00 00 00 | ... | flags: 0 0xa9-0xab.7 (3)
|
||||
0x0a0| 00 00 00 00| ....| component_type: "\x00\x00\x00\x00" 0xac-0xaf.7 (4)
|
||||
0x0a0| 00 00 00 00| ....| component_type: "" 0xac-0xaf.7 (4)
|
||||
0x0b0|49 44 33 32 |ID32 | component_subtype: "ID32" 0xb0-0xb3.7 (4)
|
||||
0x0b0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0xb4-0xb7.7 (4)
|
||||
0x0b0| 00 00 00 00 | .... | component_manufacturer: "" 0xb4-0xb7.7 (4)
|
||||
0x0b0| 00 00 00 00 | .... | component_flags: 0 0xb8-0xbb.7 (4)
|
||||
0x0b0| 00 00 00 00| ....| component_flags_mask: 0 0xbc-0xbf.7 (4)
|
||||
| | | component_name: "" 0xc0-NA (0)
|
||||
@ -166,13 +166,13 @@ $ fq -d mp4 verbose /dash_audio_init.mp4
|
||||
0x1a0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x1ab-0x1ae.7 (4)
|
||||
0x1a0| 00| .| version: 0 0x1af-0x1af.7 (1)
|
||||
0x1b0|00 00 00 |... | flags: 0 0x1b0-0x1b2.7 (3)
|
||||
0x1b0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x1b3-0x1b6.7 (4)
|
||||
0x1b0| 00 00 00 00 | .... | component_type: "" 0x1b3-0x1b6.7 (4)
|
||||
0x1b0| 73 6f 75 6e | soun | component_subtype: "soun" (Audio Track) 0x1b7-0x1ba.7 (4)
|
||||
0x1b0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x1bb-0x1be.7 (4)
|
||||
0x1b0| 00 00 00 00 | .... | component_manufacturer: "" 0x1bb-0x1be.7 (4)
|
||||
0x1b0| 00| .| component_flags: 0 0x1bf-0x1c2.7 (4)
|
||||
0x1c0|00 00 00 |... |
|
||||
0x1c0| 00 00 00 00 | .... | component_flags_mask: 0 0x1c3-0x1c6.7 (4)
|
||||
0x1c0| 53 6f 75 6e 64 48 61 6e 64| SoundHand| component_name: "SoundHandler\x00" 0x1c7-0x1d3.7 (13)
|
||||
0x1c0| 53 6f 75 6e 64 48 61 6e 64| SoundHand| component_name: "SoundHandler" 0x1c7-0x1d3.7 (13)
|
||||
0x1d0|6c 65 72 00 |ler. |
|
||||
| | | [2]: box {} 0x1d4-0x2d3.7 (256)
|
||||
0x1d0| 00 00 01 00 | .... | size: 256 0x1d4-0x1d7.7 (4)
|
||||
@ -494,7 +494,7 @@ $ fq -d mp4 verbose /dash_video_init.mp4
|
||||
0x020| 00 00 00 6c| ...l| size: 108 0x2c-0x2f.7 (4)
|
||||
0x030|6d 76 68 64 |mvhd | type: "mvhd" (Movie header, overall declarations) 0x30-0x33.7 (4)
|
||||
0x030| 00 | . | version: 0 0x34-0x34.7 (1)
|
||||
0x030| 00 00 00 | ... | flags: "\x00\x00\x00" 0x35-0x37.7 (3)
|
||||
0x030| 00 00 00 | ... | flags: 0 0x35-0x37.7 (3)
|
||||
0x030| dd 57 d6 ae | .W.. | creation_time: 2021-09-06T13:42:06Z (3713521326) 0x38-0x3b.7 (4)
|
||||
0x030| dd 57 d6 ae| .W..| modification_time: 2021-09-06T13:42:06Z (3713521326) 0x3c-0x3f.7 (4)
|
||||
0x040|00 00 32 00 |..2. | time_scale: 12800 0x40-0x43.7 (4)
|
||||
@ -530,9 +530,9 @@ $ fq -d mp4 verbose /dash_video_init.mp4
|
||||
0x0a0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0xa8-0xab.7 (4)
|
||||
0x0a0| 00 | . | version: 0 0xac-0xac.7 (1)
|
||||
0x0a0| 00 00 00| ...| flags: 0 0xad-0xaf.7 (3)
|
||||
0x0b0|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0xb0-0xb3.7 (4)
|
||||
0x0b0|00 00 00 00 |.... | component_type: "" 0xb0-0xb3.7 (4)
|
||||
0x0b0| 49 44 33 32 | ID32 | component_subtype: "ID32" 0xb4-0xb7.7 (4)
|
||||
0x0b0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0xb8-0xbb.7 (4)
|
||||
0x0b0| 00 00 00 00 | .... | component_manufacturer: "" 0xb8-0xbb.7 (4)
|
||||
0x0b0| 00 00 00 00| ....| component_flags: 0 0xbc-0xbf.7 (4)
|
||||
0x0c0|00 00 00 00 |.... | component_flags_mask: 0 0xc0-0xc3.7 (4)
|
||||
| | | component_name: "" 0xc4-NA (0)
|
||||
@ -634,13 +634,13 @@ $ fq -d mp4 verbose /dash_video_init.mp4
|
||||
0x1b0|64 6c 72 |dlr |
|
||||
0x1b0| 00 | . | version: 0 0x1b3-0x1b3.7 (1)
|
||||
0x1b0| 00 00 00 | ... | flags: 0 0x1b4-0x1b6.7 (3)
|
||||
0x1b0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x1b7-0x1ba.7 (4)
|
||||
0x1b0| 00 00 00 00 | .... | component_type: "" 0x1b7-0x1ba.7 (4)
|
||||
0x1b0| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x1bb-0x1be.7 (4)
|
||||
0x1b0| 00| .| component_manufacturer: "\x00\x00\x00\x00" 0x1bf-0x1c2.7 (4)
|
||||
0x1b0| 00| .| component_manufacturer: "" 0x1bf-0x1c2.7 (4)
|
||||
0x1c0|00 00 00 |... |
|
||||
0x1c0| 00 00 00 00 | .... | component_flags: 0 0x1c3-0x1c6.7 (4)
|
||||
0x1c0| 00 00 00 00 | .... | component_flags_mask: 0 0x1c7-0x1ca.7 (4)
|
||||
0x1c0| 56 69 64 65 6f| Video| component_name: "VideoHandler\x00" 0x1cb-0x1d7.7 (13)
|
||||
0x1c0| 56 69 64 65 6f| Video| component_name: "VideoHandler" 0x1cb-0x1d7.7 (13)
|
||||
0x1d0|48 61 6e 64 6c 65 72 00 |Handler. |
|
||||
| | | [2]: box {} 0x1d8-0x2fa.7 (291)
|
||||
0x1d0| 00 00 01 23 | ...# | size: 291 0x1d8-0x1db.7 (4)
|
||||
|
12
format/mp4/testdata/flac.fqtest
vendored
12
format/mp4/testdata/flac.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /flac.mp4
|
||||
0x290| 00 00 00 6c | ...l | size: 108 0x292-0x295.7 (4)
|
||||
0x290| 6d 76 68 64 | mvhd | type: "mvhd" (Movie header, overall declarations) 0x296-0x299.7 (4)
|
||||
0x290| 00 | . | version: 0 0x29a-0x29a.7 (1)
|
||||
0x290| 00 00 00 | ... | flags: "\x00\x00\x00" 0x29b-0x29d.7 (3)
|
||||
0x290| 00 00 00 | ... | flags: 0 0x29b-0x29d.7 (3)
|
||||
0x290| 00 00| ..| creation_time: 1904-01-04T00:00:00Z (0) 0x29e-0x2a1.7 (4)
|
||||
0x2a0|00 00 |.. |
|
||||
0x2a0| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x2a2-0x2a5.7 (4)
|
||||
@ -139,13 +139,13 @@ $ fq -d mp4 verbose /flac.mp4
|
||||
0x3b0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x3b2-0x3b5.7 (4)
|
||||
0x3b0| 00 | . | version: 0 0x3b6-0x3b6.7 (1)
|
||||
0x3b0| 00 00 00 | ... | flags: 0 0x3b7-0x3b9.7 (3)
|
||||
0x3b0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x3ba-0x3bd.7 (4)
|
||||
0x3b0| 00 00 00 00 | .... | component_type: "" 0x3ba-0x3bd.7 (4)
|
||||
0x3b0| 73 6f| so| component_subtype: "soun" (Audio Track) 0x3be-0x3c1.7 (4)
|
||||
0x3c0|75 6e |un |
|
||||
0x3c0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x3c2-0x3c5.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_manufacturer: "" 0x3c2-0x3c5.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_flags: 0 0x3c6-0x3c9.7 (4)
|
||||
0x3c0| 00 00 00 00 | .... | component_flags_mask: 0 0x3ca-0x3cd.7 (4)
|
||||
0x3c0| 53 6f| So| component_name: "SoundHandler\x00" 0x3ce-0x3da.7 (13)
|
||||
0x3c0| 53 6f| So| component_name: "SoundHandler" 0x3ce-0x3da.7 (13)
|
||||
0x3d0|75 6e 64 48 61 6e 64 6c 65 72 00 |undHandler. |
|
||||
| | | [2]: box {} 0x3db-0x4e0.7 (262)
|
||||
0x3d0| 00 00 01 06 | .... | size: 262 0x3db-0x3de.7 (4)
|
||||
@ -284,13 +284,13 @@ $ fq -d mp4 verbose /flac.mp4
|
||||
0x4f0| 00 | . | version: 0 0x4fd-0x4fd.7 (1)
|
||||
0x4f0| 00 00| ..| flags: 0 0x4fe-0x500.7 (3)
|
||||
0x500|00 |. |
|
||||
0x500| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x501-0x504.7 (4)
|
||||
0x500| 00 00 00 00 | .... | component_type: "" 0x501-0x504.7 (4)
|
||||
0x500| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x505-0x508.7 (4)
|
||||
0x500| 61 70 70 6c | appl | component_manufacturer: "appl" 0x509-0x50c.7 (4)
|
||||
0x500| 00 00 00| ...| component_flags: 0 0x50d-0x510.7 (4)
|
||||
0x510|00 |. |
|
||||
0x510| 00 00 00 00 | .... | component_flags_mask: 0 0x511-0x514.7 (4)
|
||||
0x510| 00 | . | component_name: "\x00" 0x515-0x515.7 (1)
|
||||
0x510| 00 | . | component_name: "" 0x515-0x515.7 (1)
|
||||
| | | [1]: box {} 0x516-0x542.7 (45)
|
||||
0x510| 00 00 00 2d | ...- | size: 45 0x516-0x519.7 (4)
|
||||
0x510| 69 6c 73 74 | ilst | type: "ilst" 0x51a-0x51d.7 (4)
|
||||
|
18
format/mp4/testdata/fragmented.fqtest
vendored
18
format/mp4/testdata/fragmented.fqtest
vendored
@ -22,7 +22,7 @@ $ fq -d mp4 verbose /fragmented.mp4
|
||||
0x0020| 00 00 00 6c| ...l| size: 108 0x2c-0x2f.7 (4)
|
||||
0x0030|6d 76 68 64 |mvhd | type: "mvhd" (Movie header, overall declarations) 0x30-0x33.7 (4)
|
||||
0x0030| 00 | . | version: 0 0x34-0x34.7 (1)
|
||||
0x0030| 00 00 00 | ... | flags: "\x00\x00\x00" 0x35-0x37.7 (3)
|
||||
0x0030| 00 00 00 | ... | flags: 0 0x35-0x37.7 (3)
|
||||
0x0030| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x38-0x3b.7 (4)
|
||||
0x0030| 00 00 00 00| ....| modification_time: 1904-01-04T00:00:00Z (0) 0x3c-0x3f.7 (4)
|
||||
0x0040|00 00 03 e8 |.... | time_scale: 1000 0x40-0x43.7 (4)
|
||||
@ -99,12 +99,12 @@ $ fq -d mp4 verbose /fragmented.mp4
|
||||
0x0120| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x128-0x12b.7 (4)
|
||||
0x0120| 00 | . | version: 0 0x12c-0x12c.7 (1)
|
||||
0x0120| 00 00 00| ...| flags: 0 0x12d-0x12f.7 (3)
|
||||
0x0130|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0x130-0x133.7 (4)
|
||||
0x0130|00 00 00 00 |.... | component_type: "" 0x130-0x133.7 (4)
|
||||
0x0130| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x134-0x137.7 (4)
|
||||
0x0130| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x138-0x13b.7 (4)
|
||||
0x0130| 00 00 00 00 | .... | component_manufacturer: "" 0x138-0x13b.7 (4)
|
||||
0x0130| 00 00 00 00| ....| component_flags: 0 0x13c-0x13f.7 (4)
|
||||
0x0140|00 00 00 00 |.... | component_flags_mask: 0 0x140-0x143.7 (4)
|
||||
0x0140| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler\x00" 0x144-0x150.7 (13)
|
||||
0x0140| 56 69 64 65 6f 48 61 6e 64 6c 65 72| VideoHandler| component_name: "VideoHandler" 0x144-0x150.7 (13)
|
||||
0x0150|00 |. |
|
||||
| | | [2]: box {} 0x151-0x283.7 (307)
|
||||
0x0150| 00 00 01 33 | ...3 | size: 307 0x151-0x154.7 (4)
|
||||
@ -359,12 +359,12 @@ $ fq -d mp4 verbose /fragmented.mp4
|
||||
0x0310| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x314-0x317.7 (4)
|
||||
0x0310| 00 | . | version: 0 0x318-0x318.7 (1)
|
||||
0x0310| 00 00 00 | ... | flags: 0 0x319-0x31b.7 (3)
|
||||
0x0310| 00 00 00 00| ....| component_type: "\x00\x00\x00\x00" 0x31c-0x31f.7 (4)
|
||||
0x0310| 00 00 00 00| ....| component_type: "" 0x31c-0x31f.7 (4)
|
||||
0x0320|73 6f 75 6e |soun | component_subtype: "soun" (Audio Track) 0x320-0x323.7 (4)
|
||||
0x0320| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x324-0x327.7 (4)
|
||||
0x0320| 00 00 00 00 | .... | component_manufacturer: "" 0x324-0x327.7 (4)
|
||||
0x0320| 00 00 00 00 | .... | component_flags: 0 0x328-0x32b.7 (4)
|
||||
0x0320| 00 00 00 00| ....| component_flags_mask: 0 0x32c-0x32f.7 (4)
|
||||
0x0330|53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 |SoundHandler. | component_name: "SoundHandler\x00" 0x330-0x33c.7 (13)
|
||||
0x0330|53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 |SoundHandler. | component_name: "SoundHandler" 0x330-0x33c.7 (13)
|
||||
| | | [2]: box {} 0x33d-0x442.7 (262)
|
||||
0x0330| 00 00 01| ...| size: 262 0x33d-0x340.7 (4)
|
||||
0x0340|06 |. |
|
||||
@ -557,13 +557,13 @@ $ fq -d mp4 verbose /fragmented.mp4
|
||||
0x04a0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x4a3-0x4a6.7 (4)
|
||||
0x04a0| 00 | . | version: 0 0x4a7-0x4a7.7 (1)
|
||||
0x04a0| 00 00 00 | ... | flags: 0 0x4a8-0x4aa.7 (3)
|
||||
0x04a0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x4ab-0x4ae.7 (4)
|
||||
0x04a0| 00 00 00 00 | .... | component_type: "" 0x4ab-0x4ae.7 (4)
|
||||
0x04a0| 6d| m| component_subtype: "mdir" (Metadata) 0x4af-0x4b2.7 (4)
|
||||
0x04b0|64 69 72 |dir |
|
||||
0x04b0| 61 70 70 6c | appl | component_manufacturer: "appl" 0x4b3-0x4b6.7 (4)
|
||||
0x04b0| 00 00 00 00 | .... | component_flags: 0 0x4b7-0x4ba.7 (4)
|
||||
0x04b0| 00 00 00 00 | .... | component_flags_mask: 0 0x4bb-0x4be.7 (4)
|
||||
0x04b0| 00| .| component_name: "\x00" 0x4bf-0x4bf.7 (1)
|
||||
0x04b0| 00| .| component_name: "" 0x4bf-0x4bf.7 (1)
|
||||
| | | [1]: box {} 0x4c0-0x4ec.7 (45)
|
||||
0x04c0|00 00 00 2d |...- | size: 45 0x4c0-0x4c3.7 (4)
|
||||
0x04c0| 69 6c 73 74 | ilst | type: "ilst" 0x4c4-0x4c7.7 (4)
|
||||
|
6
format/mp4/testdata/heic.fqtest
vendored
6
format/mp4/testdata/heic.fqtest
vendored
@ -22,12 +22,12 @@ $ fq -d mp4 verbose /heic.mp4
|
||||
0x020| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x28-0x2b.7 (4)
|
||||
0x020| 00 | . | version: 0 0x2c-0x2c.7 (1)
|
||||
0x020| 00 00 00| ...| flags: 0 0x2d-0x2f.7 (3)
|
||||
0x030|00 00 00 00 |.... | component_type: "\x00\x00\x00\x00" 0x30-0x33.7 (4)
|
||||
0x030|00 00 00 00 |.... | component_type: "" 0x30-0x33.7 (4)
|
||||
0x030| 70 69 63 74 | pict | component_subtype: "pict" (Picture) 0x34-0x37.7 (4)
|
||||
0x030| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x38-0x3b.7 (4)
|
||||
0x030| 00 00 00 00 | .... | component_manufacturer: "" 0x38-0x3b.7 (4)
|
||||
0x030| 00 00 00 00| ....| component_flags: 0 0x3c-0x3f.7 (4)
|
||||
0x040|00 00 00 00 |.... | component_flags_mask: 0 0x40-0x43.7 (4)
|
||||
0x040| 47 50 41 43 20 70 69 63 74 20 48 61| GPAC pict Ha| component_name: "GPAC pict Handler\x00" 0x44-0x55.7 (18)
|
||||
0x040| 47 50 41 43 20 70 69 63 74 20 48 61| GPAC pict Ha| component_name: "GPAC pict Handler" 0x44-0x55.7 (18)
|
||||
0x050|6e 64 6c 65 72 00 |ndler. |
|
||||
| | | [1]: box {} 0x56-0x73.7 (30)
|
||||
0x050| 00 00 00 1e | .... | size: 30 0x56-0x59.7 (4)
|
||||
|
12
format/mp4/testdata/hevc.fqtest
vendored
12
format/mp4/testdata/hevc.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /hevc.mp4
|
||||
0x0880| 6d 76 68| mvh| type: "mvhd" (Movie header, overall declarations) 0x88d-0x890.7 (4)
|
||||
0x0890|64 |d |
|
||||
0x0890| 00 | . | version: 0 0x891-0x891.7 (1)
|
||||
0x0890| 00 00 00 | ... | flags: "\x00\x00\x00" 0x892-0x894.7 (3)
|
||||
0x0890| 00 00 00 | ... | flags: 0 0x892-0x894.7 (3)
|
||||
0x0890| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x895-0x898.7 (4)
|
||||
0x0890| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x899-0x89c.7 (4)
|
||||
0x0890| 00 00 03| ...| time_scale: 1000 0x89d-0x8a0.7 (4)
|
||||
@ -140,13 +140,13 @@ $ fq -d mp4 verbose /hevc.mp4
|
||||
0x09a0| 00 | . | version: 0 0x9ad-0x9ad.7 (1)
|
||||
0x09a0| 00 00| ..| flags: 0 0x9ae-0x9b0.7 (3)
|
||||
0x09b0|00 |. |
|
||||
0x09b0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x9b1-0x9b4.7 (4)
|
||||
0x09b0| 00 00 00 00 | .... | component_type: "" 0x9b1-0x9b4.7 (4)
|
||||
0x09b0| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x9b5-0x9b8.7 (4)
|
||||
0x09b0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x9b9-0x9bc.7 (4)
|
||||
0x09b0| 00 00 00 00 | .... | component_manufacturer: "" 0x9b9-0x9bc.7 (4)
|
||||
0x09b0| 00 00 00| ...| component_flags: 0 0x9bd-0x9c0.7 (4)
|
||||
0x09c0|00 |. |
|
||||
0x09c0| 00 00 00 00 | .... | component_flags_mask: 0 0x9c1-0x9c4.7 (4)
|
||||
0x09c0| 56 69 64 65 6f 48 61 6e 64 6c 65| VideoHandle| component_name: "VideoHandler\x00" 0x9c5-0x9d1.7 (13)
|
||||
0x09c0| 56 69 64 65 6f 48 61 6e 64 6c 65| VideoHandle| component_name: "VideoHandler" 0x9c5-0x9d1.7 (13)
|
||||
0x09d0|72 00 |r. |
|
||||
| | | [2]: box {} 0x9d2-0x1438.7 (2663)
|
||||
0x09d0| 00 00 0a 67 | ...g | size: 2663 0x9d2-0x9d5.7 (4)
|
||||
@ -378,13 +378,13 @@ $ fq -d mp4 verbose /hevc.mp4
|
||||
0x1450| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x1451-0x1454.7 (4)
|
||||
0x1450| 00 | . | version: 0 0x1455-0x1455.7 (1)
|
||||
0x1450| 00 00 00 | ... | flags: 0 0x1456-0x1458.7 (3)
|
||||
0x1450| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x1459-0x145c.7 (4)
|
||||
0x1450| 00 00 00 00 | .... | component_type: "" 0x1459-0x145c.7 (4)
|
||||
0x1450| 6d 64 69| mdi| component_subtype: "mdir" (Metadata) 0x145d-0x1460.7 (4)
|
||||
0x1460|72 |r |
|
||||
0x1460| 61 70 70 6c | appl | component_manufacturer: "appl" 0x1461-0x1464.7 (4)
|
||||
0x1460| 00 00 00 00 | .... | component_flags: 0 0x1465-0x1468.7 (4)
|
||||
0x1460| 00 00 00 00 | .... | component_flags_mask: 0 0x1469-0x146c.7 (4)
|
||||
0x1460| 00 | . | component_name: "\x00" 0x146d-0x146d.7 (1)
|
||||
0x1460| 00 | . | component_name: "" 0x146d-0x146d.7 (1)
|
||||
| | | [1]: box {} 0x146e-0x149a.7 (45)
|
||||
0x1460| 00 00| ..| size: 45 0x146e-0x1471.7 (4)
|
||||
0x1470|00 2d |.- |
|
||||
|
12
format/mp4/testdata/mp3.fqtest
vendored
12
format/mp4/testdata/mp3.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /mp3.mp4
|
||||
0x2a0| 00 00 00 6c | ...l | size: 108 0x2a6-0x2a9.7 (4)
|
||||
0x2a0| 6d 76 68 64 | mvhd | type: "mvhd" (Movie header, overall declarations) 0x2aa-0x2ad.7 (4)
|
||||
0x2a0| 00 | . | version: 0 0x2ae-0x2ae.7 (1)
|
||||
0x2a0| 00| .| flags: "\x00\x00\x00" 0x2af-0x2b1.7 (3)
|
||||
0x2a0| 00| .| flags: 0 0x2af-0x2b1.7 (3)
|
||||
0x2b0|00 00 |.. |
|
||||
0x2b0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x2b2-0x2b5.7 (4)
|
||||
0x2b0| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x2b6-0x2b9.7 (4)
|
||||
@ -139,14 +139,14 @@ $ fq -d mp4 verbose /mp3.mp4
|
||||
0x3c0| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x3c6-0x3c9.7 (4)
|
||||
0x3c0| 00 | . | version: 0 0x3ca-0x3ca.7 (1)
|
||||
0x3c0| 00 00 00 | ... | flags: 0 0x3cb-0x3cd.7 (3)
|
||||
0x3c0| 00 00| ..| component_type: "\x00\x00\x00\x00" 0x3ce-0x3d1.7 (4)
|
||||
0x3c0| 00 00| ..| component_type: "" 0x3ce-0x3d1.7 (4)
|
||||
0x3d0|00 00 |.. |
|
||||
0x3d0| 73 6f 75 6e | soun | component_subtype: "soun" (Audio Track) 0x3d2-0x3d5.7 (4)
|
||||
0x3d0| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x3d6-0x3d9.7 (4)
|
||||
0x3d0| 00 00 00 00 | .... | component_manufacturer: "" 0x3d6-0x3d9.7 (4)
|
||||
0x3d0| 00 00 00 00 | .... | component_flags: 0 0x3da-0x3dd.7 (4)
|
||||
0x3d0| 00 00| ..| component_flags_mask: 0 0x3de-0x3e1.7 (4)
|
||||
0x3e0|00 00 |.. |
|
||||
0x3e0| 53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 | SoundHandler. | component_name: "SoundHandler\x00" 0x3e2-0x3ee.7 (13)
|
||||
0x3e0| 53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 | SoundHandler. | component_name: "SoundHandler" 0x3e2-0x3ee.7 (13)
|
||||
| | | [2]: box {} 0x3ef-0x502.7 (276)
|
||||
0x3e0| 00| .| size: 276 0x3ef-0x3f2.7 (4)
|
||||
0x3f0|00 01 14 |... |
|
||||
@ -298,13 +298,13 @@ $ fq -d mp4 verbose /mp3.mp4
|
||||
0x510| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x51b-0x51e.7 (4)
|
||||
0x510| 00| .| version: 0 0x51f-0x51f.7 (1)
|
||||
0x520|00 00 00 |... | flags: 0 0x520-0x522.7 (3)
|
||||
0x520| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x523-0x526.7 (4)
|
||||
0x520| 00 00 00 00 | .... | component_type: "" 0x523-0x526.7 (4)
|
||||
0x520| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x527-0x52a.7 (4)
|
||||
0x520| 61 70 70 6c | appl | component_manufacturer: "appl" 0x52b-0x52e.7 (4)
|
||||
0x520| 00| .| component_flags: 0 0x52f-0x532.7 (4)
|
||||
0x530|00 00 00 |... |
|
||||
0x530| 00 00 00 00 | .... | component_flags_mask: 0 0x533-0x536.7 (4)
|
||||
0x530| 00 | . | component_name: "\x00" 0x537-0x537.7 (1)
|
||||
0x530| 00 | . | component_name: "" 0x537-0x537.7 (1)
|
||||
| | | [1]: box {} 0x538-0x564.7 (45)
|
||||
0x530| 00 00 00 2d | ...- | size: 45 0x538-0x53b.7 (4)
|
||||
0x530| 69 6c 73 74| ilst| type: "ilst" 0x53c-0x53f.7 (4)
|
||||
|
12
format/mp4/testdata/mpeg2.fqtest
vendored
12
format/mp4/testdata/mpeg2.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /mpeg2.mp4
|
||||
0x1fb0|00 6c |.l |
|
||||
0x1fb0| 6d 76 68 64 | mvhd | type: "mvhd" (Movie header, overall declarations) 0x1fb2-0x1fb5.7 (4)
|
||||
0x1fb0| 00 | . | version: 0 0x1fb6-0x1fb6.7 (1)
|
||||
0x1fb0| 00 00 00 | ... | flags: "\x00\x00\x00" 0x1fb7-0x1fb9.7 (3)
|
||||
0x1fb0| 00 00 00 | ... | flags: 0 0x1fb7-0x1fb9.7 (3)
|
||||
0x1fb0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x1fba-0x1fbd.7 (4)
|
||||
0x1fb0| 00 00| ..| modification_time: 1904-01-04T00:00:00Z (0) 0x1fbe-0x1fc1.7 (4)
|
||||
0x1fc0|00 00 |.. |
|
||||
@ -138,13 +138,13 @@ $ fq -d mp4 verbose /mpeg2.mp4
|
||||
0x20d0|6c 72 |lr |
|
||||
0x20d0| 00 | . | version: 0 0x20d2-0x20d2.7 (1)
|
||||
0x20d0| 00 00 00 | ... | flags: 0 0x20d3-0x20d5.7 (3)
|
||||
0x20d0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x20d6-0x20d9.7 (4)
|
||||
0x20d0| 00 00 00 00 | .... | component_type: "" 0x20d6-0x20d9.7 (4)
|
||||
0x20d0| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x20da-0x20dd.7 (4)
|
||||
0x20d0| 00 00| ..| component_manufacturer: "\x00\x00\x00\x00" 0x20de-0x20e1.7 (4)
|
||||
0x20d0| 00 00| ..| component_manufacturer: "" 0x20de-0x20e1.7 (4)
|
||||
0x20e0|00 00 |.. |
|
||||
0x20e0| 00 00 00 00 | .... | component_flags: 0 0x20e2-0x20e5.7 (4)
|
||||
0x20e0| 00 00 00 00 | .... | component_flags_mask: 0 0x20e6-0x20e9.7 (4)
|
||||
0x20e0| 56 69 64 65 6f 48| VideoH| component_name: "VideoHandler\x00" 0x20ea-0x20f6.7 (13)
|
||||
0x20e0| 56 69 64 65 6f 48| VideoH| component_name: "VideoHandler" 0x20ea-0x20f6.7 (13)
|
||||
0x20f0|61 6e 64 6c 65 72 00 |andler. |
|
||||
| | | [2]: box {} 0x20f7-0x2246.7 (336)
|
||||
0x20f0| 00 00 01 50 | ...P | size: 336 0x20f7-0x20fa.7 (4)
|
||||
@ -314,13 +314,13 @@ $ fq -d mp4 verbose /mpeg2.mp4
|
||||
0x2260|64 6c 72 |dlr |
|
||||
0x2260| 00 | . | version: 0 0x2263-0x2263.7 (1)
|
||||
0x2260| 00 00 00 | ... | flags: 0 0x2264-0x2266.7 (3)
|
||||
0x2260| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x2267-0x226a.7 (4)
|
||||
0x2260| 00 00 00 00 | .... | component_type: "" 0x2267-0x226a.7 (4)
|
||||
0x2260| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x226b-0x226e.7 (4)
|
||||
0x2260| 61| a| component_manufacturer: "appl" 0x226f-0x2272.7 (4)
|
||||
0x2270|70 70 6c |ppl |
|
||||
0x2270| 00 00 00 00 | .... | component_flags: 0 0x2273-0x2276.7 (4)
|
||||
0x2270| 00 00 00 00 | .... | component_flags_mask: 0 0x2277-0x227a.7 (4)
|
||||
0x2270| 00 | . | component_name: "\x00" 0x227b-0x227b.7 (1)
|
||||
0x2270| 00 | . | component_name: "" 0x227b-0x227b.7 (1)
|
||||
| | | [1]: box {} 0x227c-0x22a8.7 (45)
|
||||
0x2270| 00 00 00 2d| ...-| size: 45 0x227c-0x227f.7 (4)
|
||||
0x2280|69 6c 73 74 |ilst | type: "ilst" 0x2280-0x2283.7 (4)
|
||||
|
12
format/mp4/testdata/opus.fqtest
vendored
12
format/mp4/testdata/opus.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /opus.mp4
|
||||
0x1a0|00 00 6c |..l |
|
||||
0x1a0| 6d 76 68 64 | mvhd | type: "mvhd" (Movie header, overall declarations) 0x1a3-0x1a6.7 (4)
|
||||
0x1a0| 00 | . | version: 0 0x1a7-0x1a7.7 (1)
|
||||
0x1a0| 00 00 00 | ... | flags: "\x00\x00\x00" 0x1a8-0x1aa.7 (3)
|
||||
0x1a0| 00 00 00 | ... | flags: 0 0x1a8-0x1aa.7 (3)
|
||||
0x1a0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x1ab-0x1ae.7 (4)
|
||||
0x1a0| 00| .| modification_time: 1904-01-04T00:00:00Z (0) 0x1af-0x1b2.7 (4)
|
||||
0x1b0|00 00 00 |... |
|
||||
@ -139,13 +139,13 @@ $ fq -d mp4 verbose /opus.mp4
|
||||
0x2c0|64 6c 72 |dlr |
|
||||
0x2c0| 00 | . | version: 0 0x2c3-0x2c3.7 (1)
|
||||
0x2c0| 00 00 00 | ... | flags: 0 0x2c4-0x2c6.7 (3)
|
||||
0x2c0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x2c7-0x2ca.7 (4)
|
||||
0x2c0| 00 00 00 00 | .... | component_type: "" 0x2c7-0x2ca.7 (4)
|
||||
0x2c0| 73 6f 75 6e | soun | component_subtype: "soun" (Audio Track) 0x2cb-0x2ce.7 (4)
|
||||
0x2c0| 00| .| component_manufacturer: "\x00\x00\x00\x00" 0x2cf-0x2d2.7 (4)
|
||||
0x2c0| 00| .| component_manufacturer: "" 0x2cf-0x2d2.7 (4)
|
||||
0x2d0|00 00 00 |... |
|
||||
0x2d0| 00 00 00 00 | .... | component_flags: 0 0x2d3-0x2d6.7 (4)
|
||||
0x2d0| 00 00 00 00 | .... | component_flags_mask: 0 0x2d7-0x2da.7 (4)
|
||||
0x2d0| 53 6f 75 6e 64| Sound| component_name: "SoundHandler\x00" 0x2db-0x2e7.7 (13)
|
||||
0x2d0| 53 6f 75 6e 64| Sound| component_name: "SoundHandler" 0x2db-0x2e7.7 (13)
|
||||
0x2e0|48 61 6e 64 6c 65 72 00 |Handler. |
|
||||
| | | [2]: box {} 0x2e8-0x3d6.7 (239)
|
||||
0x2e0| 00 00 00 ef | .... | size: 239 0x2e8-0x2eb.7 (4)
|
||||
@ -276,13 +276,13 @@ $ fq -d mp4 verbose /opus.mp4
|
||||
0x3f0|64 6c 72 |dlr |
|
||||
0x3f0| 00 | . | version: 0 0x3f3-0x3f3.7 (1)
|
||||
0x3f0| 00 00 00 | ... | flags: 0 0x3f4-0x3f6.7 (3)
|
||||
0x3f0| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x3f7-0x3fa.7 (4)
|
||||
0x3f0| 00 00 00 00 | .... | component_type: "" 0x3f7-0x3fa.7 (4)
|
||||
0x3f0| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x3fb-0x3fe.7 (4)
|
||||
0x3f0| 61| a| component_manufacturer: "appl" 0x3ff-0x402.7 (4)
|
||||
0x400|70 70 6c |ppl |
|
||||
0x400| 00 00 00 00 | .... | component_flags: 0 0x403-0x406.7 (4)
|
||||
0x400| 00 00 00 00 | .... | component_flags_mask: 0 0x407-0x40a.7 (4)
|
||||
0x400| 00 | . | component_name: "\x00" 0x40b-0x40b.7 (1)
|
||||
0x400| 00 | . | component_name: "" 0x40b-0x40b.7 (1)
|
||||
| | | [1]: box {} 0x40c-0x438.7 (45)
|
||||
0x400| 00 00 00 2d| ...-| size: 45 0x40c-0x40f.7 (4)
|
||||
0x410|69 6c 73 74 |ilst | type: "ilst" 0x410-0x413.7 (4)
|
||||
|
12
format/mp4/testdata/vorbis.fqtest
vendored
12
format/mp4/testdata/vorbis.fqtest
vendored
@ -31,7 +31,7 @@ $ fq -d mp4 verbose /vorbis.mp4
|
||||
0x01e0| 00 00 00 6c | ...l | size: 108 0x1e5-0x1e8.7 (4)
|
||||
0x01e0| 6d 76 68 64 | mvhd | type: "mvhd" (Movie header, overall declarations) 0x1e9-0x1ec.7 (4)
|
||||
0x01e0| 00 | . | version: 0 0x1ed-0x1ed.7 (1)
|
||||
0x01e0| 00 00| ..| flags: "\x00\x00\x00" 0x1ee-0x1f0.7 (3)
|
||||
0x01e0| 00 00| ..| flags: 0 0x1ee-0x1f0.7 (3)
|
||||
0x01f0|00 |. |
|
||||
0x01f0| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x1f1-0x1f4.7 (4)
|
||||
0x01f0| 00 00 00 00 | .... | modification_time: 1904-01-04T00:00:00Z (0) 0x1f5-0x1f8.7 (4)
|
||||
@ -140,14 +140,14 @@ $ fq -d mp4 verbose /vorbis.mp4
|
||||
0x0300| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x305-0x308.7 (4)
|
||||
0x0300| 00 | . | version: 0 0x309-0x309.7 (1)
|
||||
0x0300| 00 00 00 | ... | flags: 0 0x30a-0x30c.7 (3)
|
||||
0x0300| 00 00 00| ...| component_type: "\x00\x00\x00\x00" 0x30d-0x310.7 (4)
|
||||
0x0300| 00 00 00| ...| component_type: "" 0x30d-0x310.7 (4)
|
||||
0x0310|00 |. |
|
||||
0x0310| 73 6f 75 6e | soun | component_subtype: "soun" (Audio Track) 0x311-0x314.7 (4)
|
||||
0x0310| 00 00 00 00 | .... | component_manufacturer: "\x00\x00\x00\x00" 0x315-0x318.7 (4)
|
||||
0x0310| 00 00 00 00 | .... | component_manufacturer: "" 0x315-0x318.7 (4)
|
||||
0x0310| 00 00 00 00 | .... | component_flags: 0 0x319-0x31c.7 (4)
|
||||
0x0310| 00 00 00| ...| component_flags_mask: 0 0x31d-0x320.7 (4)
|
||||
0x0320|00 |. |
|
||||
0x0320| 53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 | SoundHandler. | component_name: "SoundHandler\x00" 0x321-0x32d.7 (13)
|
||||
0x0320| 53 6f 75 6e 64 48 61 6e 64 6c 65 72 00 | SoundHandler. | component_name: "SoundHandler" 0x321-0x32d.7 (13)
|
||||
| | | [2]: box {} 0x32e-0x1126.7 (3577)
|
||||
0x0320| 00 00| ..| size: 3577 0x32e-0x331.7 (4)
|
||||
0x0330|0d f9 |.. |
|
||||
@ -336,13 +336,13 @@ $ fq -d mp4 verbose /vorbis.mp4
|
||||
0x1140|64 6c 72 |dlr |
|
||||
0x1140| 00 | . | version: 0 0x1143-0x1143.7 (1)
|
||||
0x1140| 00 00 00 | ... | flags: 0 0x1144-0x1146.7 (3)
|
||||
0x1140| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x1147-0x114a.7 (4)
|
||||
0x1140| 00 00 00 00 | .... | component_type: "" 0x1147-0x114a.7 (4)
|
||||
0x1140| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x114b-0x114e.7 (4)
|
||||
0x1140| 61| a| component_manufacturer: "appl" 0x114f-0x1152.7 (4)
|
||||
0x1150|70 70 6c |ppl |
|
||||
0x1150| 00 00 00 00 | .... | component_flags: 0 0x1153-0x1156.7 (4)
|
||||
0x1150| 00 00 00 00 | .... | component_flags_mask: 0 0x1157-0x115a.7 (4)
|
||||
0x1150| 00 | . | component_name: "\x00" 0x115b-0x115b.7 (1)
|
||||
0x1150| 00 | . | component_name: "" 0x115b-0x115b.7 (1)
|
||||
| | | [1]: box {} 0x115c-0x1188.7 (45)
|
||||
0x1150| 00 00 00 2d| ...-| size: 45 0x115c-0x115f.7 (4)
|
||||
0x1160|69 6c 73 74 |ilst | type: "ilst" 0x1160-0x1163.7 (4)
|
||||
|
12
format/mp4/testdata/vp9.fqtest
vendored
12
format/mp4/testdata/vp9.fqtest
vendored
@ -30,7 +30,7 @@ $ fq -d mp4 verbose /vp9.mp4
|
||||
0x1560| 00 00 00 6c| ...l| size: 108 0x156c-0x156f.7 (4)
|
||||
0x1570|6d 76 68 64 |mvhd | type: "mvhd" (Movie header, overall declarations) 0x1570-0x1573.7 (4)
|
||||
0x1570| 00 | . | version: 0 0x1574-0x1574.7 (1)
|
||||
0x1570| 00 00 00 | ... | flags: "\x00\x00\x00" 0x1575-0x1577.7 (3)
|
||||
0x1570| 00 00 00 | ... | flags: 0 0x1575-0x1577.7 (3)
|
||||
0x1570| 00 00 00 00 | .... | creation_time: 1904-01-04T00:00:00Z (0) 0x1578-0x157b.7 (4)
|
||||
0x1570| 00 00 00 00| ....| modification_time: 1904-01-04T00:00:00Z (0) 0x157c-0x157f.7 (4)
|
||||
0x1580|00 00 03 e8 |.... | time_scale: 1000 0x1580-0x1583.7 (4)
|
||||
@ -122,12 +122,12 @@ $ fq -d mp4 verbose /vp9.mp4
|
||||
0x1680| 68 64 6c 72| hdlr| type: "hdlr" (Handler, declares the media (handler) type) 0x168c-0x168f.7 (4)
|
||||
0x1690|00 |. | version: 0 0x1690-0x1690.7 (1)
|
||||
0x1690| 00 00 00 | ... | flags: 0 0x1691-0x1693.7 (3)
|
||||
0x1690| 00 00 00 00 | .... | component_type: "\x00\x00\x00\x00" 0x1694-0x1697.7 (4)
|
||||
0x1690| 00 00 00 00 | .... | component_type: "" 0x1694-0x1697.7 (4)
|
||||
0x1690| 76 69 64 65 | vide | component_subtype: "vide" (Video Track) 0x1698-0x169b.7 (4)
|
||||
0x1690| 00 00 00 00| ....| component_manufacturer: "\x00\x00\x00\x00" 0x169c-0x169f.7 (4)
|
||||
0x1690| 00 00 00 00| ....| component_manufacturer: "" 0x169c-0x169f.7 (4)
|
||||
0x16a0|00 00 00 00 |.... | component_flags: 0 0x16a0-0x16a3.7 (4)
|
||||
0x16a0| 00 00 00 00 | .... | component_flags_mask: 0 0x16a4-0x16a7.7 (4)
|
||||
0x16a0| 56 69 64 65 6f 48 61 6e| VideoHan| component_name: "VideoHandler\x00" 0x16a8-0x16b4.7 (13)
|
||||
0x16a0| 56 69 64 65 6f 48 61 6e| VideoHan| component_name: "VideoHandler" 0x16a8-0x16b4.7 (13)
|
||||
0x16b0|64 6c 65 72 00 |dler. |
|
||||
| | | [2]: box {} 0x16b5-0x17ec.7 (312)
|
||||
0x16b0| 00 00 01 38 | ...8 | size: 312 0x16b5-0x16b8.7 (4)
|
||||
@ -285,14 +285,14 @@ $ fq -d mp4 verbose /vp9.mp4
|
||||
0x1800| 68 64 6c 72 | hdlr | type: "hdlr" (Handler, declares the media (handler) type) 0x1805-0x1808.7 (4)
|
||||
0x1800| 00 | . | version: 0 0x1809-0x1809.7 (1)
|
||||
0x1800| 00 00 00 | ... | flags: 0 0x180a-0x180c.7 (3)
|
||||
0x1800| 00 00 00| ...| component_type: "\x00\x00\x00\x00" 0x180d-0x1810.7 (4)
|
||||
0x1800| 00 00 00| ...| component_type: "" 0x180d-0x1810.7 (4)
|
||||
0x1810|00 |. |
|
||||
0x1810| 6d 64 69 72 | mdir | component_subtype: "mdir" (Metadata) 0x1811-0x1814.7 (4)
|
||||
0x1810| 61 70 70 6c | appl | component_manufacturer: "appl" 0x1815-0x1818.7 (4)
|
||||
0x1810| 00 00 00 00 | .... | component_flags: 0 0x1819-0x181c.7 (4)
|
||||
0x1810| 00 00 00| ...| component_flags_mask: 0 0x181d-0x1820.7 (4)
|
||||
0x1820|00 |. |
|
||||
0x1820| 00 | . | component_name: "\x00" 0x1821-0x1821.7 (1)
|
||||
0x1820| 00 | . | component_name: "" 0x1821-0x1821.7 (1)
|
||||
| | | [1]: box {} 0x1822-0x184e.7 (45)
|
||||
0x1820| 00 00 00 2d | ...- | size: 45 0x1822-0x1825.7 (4)
|
||||
0x1820| 69 6c 73 74 | ilst | type: "ilst" 0x1826-0x1829.7 (4)
|
||||
|
@ -29,19 +29,14 @@ func init() {
|
||||
}
|
||||
|
||||
func tarDecode(d *decode.D, in interface{}) interface{} {
|
||||
str := func(nBytes int) string {
|
||||
s := d.UTF8(nBytes)
|
||||
ts := strings.Trim(s, " \x00")
|
||||
return ts
|
||||
}
|
||||
fieldStr := func(d *decode.D, name string, nBytes int) string {
|
||||
return d.FieldStrFn(name, func() (string, string) {
|
||||
return str(nBytes), ""
|
||||
return d.UTF8Fn(nBytes, func(s string) string { return strings.Trim(s, " \x00") }), ""
|
||||
})
|
||||
}
|
||||
fieldNumStr := func(d *decode.D, name string, nBytes int) uint64 {
|
||||
return d.FieldUFn(name, func() (uint64, decode.DisplayFormat, string) {
|
||||
ts := strings.TrimLeft(str(nBytes), "0 \x00")
|
||||
ts := strings.TrimLeft(d.UTF8(nBytes), "0 \x00")
|
||||
if ts == "" {
|
||||
return 0, decode.NumberDecimal, ts
|
||||
}
|
||||
|
2
format/tiff/testdata/4x4.fqtest
vendored
2
format/tiff/testdata/4x4.fqtest
vendored
@ -56,7 +56,7 @@ $ fq -d tiff verbose /4x4.tiff
|
||||
0x050|00 00 |.. |
|
||||
0x050| ba 00 00 00 | .... | value_offset: 186 0x52-0x55.7 (4)
|
||||
| | | values: [1] 0xba-0xc2.7 (9)
|
||||
0x0b0| 34 78 34 2e 74 69| 4x4.ti| [0]: value "4x4.tiff\x00" 0xba-0xc2.7 (9)
|
||||
0x0b0| 34 78 34 2e 74 69| 4x4.ti| [0]: value "4x4.tiff" 0xba-0xc2.7 (9)
|
||||
0x0c0|66 66 00 |ff. |
|
||||
| | | [6]: entry {} 0x56-0x61.7 (12)
|
||||
0x050| 11 01 | .. | tag: StripOffsets (0x111) 0x56-0x57.7 (2)
|
||||
|
@ -145,7 +145,7 @@ func decodeIfd(d *decode.D, s *strips, tagNames map[uint64]string) int64 {
|
||||
}
|
||||
case typ == ASCII:
|
||||
d.DecodeRangeFn(int64(valueByteOffset*8), int64(valueByteSize*8), func(d *decode.D) {
|
||||
d.FieldUTF8("value", int(valueByteSize))
|
||||
d.FieldUTF8Null("value", int(valueByteSize))
|
||||
})
|
||||
case typ == BYTE:
|
||||
d.FieldBitBufRange("value", int64(valueByteOffset*8), int64(valueByteSize*8))
|
||||
|
0
format/wav/testdata/rf64.fqtest
vendored
Normal file
0
format/wav/testdata/rf64.fqtest
vendored
Normal file
BIN
format/wav/testdata/rf64.wav
vendored
Normal file
BIN
format/wav/testdata/rf64.wav
vendored
Normal file
Binary file not shown.
@ -173,9 +173,7 @@ func decodeChunk(d *decode.D, expectedChunkID string, stringData bool) int64 { /
|
||||
d.DecodeLenFn(chunkLen*8, fn)
|
||||
} else {
|
||||
if stringData {
|
||||
d.FieldStrFn("data", func() (string, string) {
|
||||
return strings.Trim(d.UTF8(int(chunkLen)), " \x00"), ""
|
||||
})
|
||||
d.FieldUTF8Fn("data", int(chunkLen), func(s string) string { return strings.Trim(s, " \x00") })
|
||||
} else {
|
||||
d.FieldBitBufLen("data", chunkLen*8)
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package decode
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/wader/fq/pkg/bitio"
|
||||
"golang.org/x/text/encoding/unicode"
|
||||
@ -9,12 +10,16 @@ import (
|
||||
|
||||
// TODO: FP64,unsigned/BE/LE? rename SFP32?
|
||||
|
||||
func (d *D) TryUTF8(nBytes int) (string, error) {
|
||||
func (d *D) TryUTF8Fn(nBytes int, fn func(s string) string) (string, error) {
|
||||
s, err := d.bitBuf.BytesLen(nBytes)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(s), nil
|
||||
return fn(string(s)), nil
|
||||
}
|
||||
|
||||
func (d *D) TryUTF8(nBytes int) (string, error) {
|
||||
return d.TryUTF8Fn(nBytes, func(s string) string { return s })
|
||||
}
|
||||
|
||||
func (d *D) TryUTF16BE(nBytes int) (string, error) {
|
||||
@ -232,15 +237,19 @@ func (d *D) FieldBytesLen(name string, nBytes int) []byte {
|
||||
})
|
||||
}
|
||||
|
||||
// UTF8 read nBytes utf8 string
|
||||
func (d *D) UTF8(nBytes int) string {
|
||||
s, err := d.TryUTF8(nBytes)
|
||||
// UTF8Fn read nBytes utf8 string and transform it using fn
|
||||
func (d *D) UTF8Fn(nBytes int, fn func(s string) string) string {
|
||||
s, err := d.TryUTF8Fn(nBytes, fn)
|
||||
if err != nil {
|
||||
panic(IOError{Err: err, Op: "UTF8", Size: int64(nBytes) * 8, Pos: d.Pos()})
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (d *D) UTF8(nBytes int) string {
|
||||
return d.UTF8Fn(nBytes, func(s string) string { return s })
|
||||
}
|
||||
|
||||
// UTF16BE read nBytes utf16be string
|
||||
func (d *D) UTF16BE(nBytes int) string {
|
||||
s, err := d.TryUTF16BE(nBytes)
|
||||
@ -260,9 +269,9 @@ func (d *D) UTF16LE(nBytes int) string {
|
||||
}
|
||||
|
||||
// FieldUTF8 read nBytes utf8 string and add a field
|
||||
func (d *D) FieldUTF8(name string, nBytes int) string {
|
||||
func (d *D) FieldUTF8Fn(name string, nBytes int, fn func(s string) string) string {
|
||||
return d.FieldStrFn(name, func() (string, string) {
|
||||
str, err := d.TryUTF8(nBytes)
|
||||
str, err := d.TryUTF8Fn(nBytes, fn)
|
||||
if err != nil {
|
||||
panic(IOError{Err: err, Name: name, Op: "FieldUTF8", Size: int64(nBytes) * 8, Pos: d.Pos()})
|
||||
}
|
||||
@ -270,6 +279,14 @@ func (d *D) FieldUTF8(name string, nBytes int) string {
|
||||
})
|
||||
}
|
||||
|
||||
func (d *D) FieldUTF8Null(name string, nBytes int) string {
|
||||
return d.FieldUTF8Fn(name, nBytes, func(s string) string { return strings.TrimRight(s, "\x00") })
|
||||
}
|
||||
|
||||
func (d *D) FieldUTF8(name string, nBytes int) string {
|
||||
return d.FieldUTF8Fn(name, nBytes, func(s string) string { return s })
|
||||
}
|
||||
|
||||
// FieldUTF16BE read nBytes utf16be string and add a field
|
||||
func (d *D) FieldUTF16BE(name string, nBytes int) string {
|
||||
return d.FieldStrFn(name, func() (string, string) {
|
||||
|
Loading…
Reference in New Issue
Block a user