1
1
mirror of https://github.com/wader/fq.git synced 2024-09-20 00:08:01 +03:00

dump: Add ascii header

This commit is contained in:
Mattias Wadman 2021-09-16 22:40:03 +02:00
parent 6ee7977c53
commit ee972f490d
83 changed files with 131 additions and 130 deletions

View File

@ -6,7 +6,7 @@ Tool, language and decoders for exploring binary data.
<pre sh>
<b># Overview of mp3 file</b> 
$ fq . file.mp3 
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} file.mp3 (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} file.mp3 (mp3)
0x000|49 44 33 04 00 00 00 00 15 39 54 53 53 45 00 00|ID3......9TSSE..| headers: [1]
* |until 0xac2.7 (2755) | |
0xac0| ff fb 40 c0 00 00 00 00 00 00 00 00 00| ..@..........| frames: [3]
@ -16,7 +16,7 @@ $ fq . file.mp3 
 
<b># Show ID3v2 APIC frame</b> 
$ fq '.headers[].frames[] | select(.id == "APIC")' file.mp3 
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers[0].frames[1]: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers[0].frames[1]: {}
0x020| 41 50 49 43 | APIC | id: "APIC" (Attached picture)
0x020| 00 00 15 0c | .... | size: 2700
0x020| 00 00 | .. | flags: {}

View File

@ -3,7 +3,7 @@
# fq '.footers[0] | tobytes' test.mp3 > apev2
/apev2:
$ fq -d apev2 verbose /apev2
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /apev2 (apev2) 0x0-0xad.7 (174)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /apev2 (apev2) 0x0-0xad.7 (174)
| | | header: {} 0x0-0x1f.7 (32)
0x00|41 50 45 54 41 47 45 58 |APETAGEX | preamble: "APETAGEX" (Correct) 0x0-0x7.7 (8)
0x00| d0 07 00 00 | .... | version: 2000 0x8-0xb.7 (4)

View File

@ -2,7 +2,7 @@
# ffmpeg -f lavfi -i sine -t 0.01s -f flac pipe:1 | fq - '.frames[0]._bytes' > frame
/frame:
$ fq -d flac_frame verbose /frame
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /frame (flac_frame) 0x0-0x1ff.7 (512)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /frame (flac_frame) 0x0-0x1ff.7 (512)
| | | header: {} 0x0-0x7.7 (8)
0x000|ff f8 |.. | sync: Correct (0x3ffe) 0x0-0x1.5 (1.6)
0x000| f8 | . | reserved0: Correct (0x0) 0x1.6-0x1.6 (0.1)

View File

@ -1,6 +1,6 @@
/mono16.flac:
$ fq -d flac verbose /mono16.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mono16.flac (flac) 0x0-0x8597.7 (34200)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mono16.flac (flac) 0x0-0x8597.7 (34200)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x206f.7 (8300)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/mono24.flac:
$ fq -d flac verbose /mono24.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mono24.flac (flac) 0x0-0xbcca.7 (48331)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mono24.flac (flac) 0x0-0xbcca.7 (48331)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x209b.7 (8344)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/mono8.flac:
$ fq -d flac verbose /mono8.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mono8.flac (flac) 0x0-0x4cef.7 (19696)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mono8.flac (flac) 0x0-0x4cef.7 (19696)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x206f.7 (8300)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/picture_seek_gain.flac:
$ fq -d flac verbose /picture_seek_gain.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /picture_seek_gain.flac (flac) 0x0-0x225f.7 (8800)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /picture_seek_gain.flac (flac) 0x0-0x225f.7 (8800)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [5] 0x4-0x205f.7 (8284)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/stereo16.flac:
$ fq -d flac verbose /stereo16.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /stereo16.flac (flac) 0x0-0xc54b.7 (50508)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /stereo16.flac (flac) 0x0-0xc54b.7 (50508)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x206f.7 (8300)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/stereo24.flac:
$ fq -d flac verbose /stereo24.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /stereo24.flac (flac) 0x0-0x11bcb.7 (72652)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /stereo24.flac (flac) 0x0-0x11bcb.7 (72652)
0x00000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x209b.7 (8344)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,6 +1,6 @@
/stereo8.flac:
$ fq -d flac verbose /stereo8.flac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /stereo8.flac (flac) 0x0-0x6d5c.7 (27997)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /stereo8.flac (flac) 0x0-0x6d5c.7 (27997)
0x0000|66 4c 61 43 |fLaC | magic: "fLaC" (Correct) 0x0-0x3.7 (4)
| | | metadatablocks: [4] 0x4-0x206f.7 (8300)
| | | [0]: metadatablock {} (flac_metadatablock) 0x4-0x29.7 (38)

View File

@ -1,7 +1,7 @@
# gm convert -size 4x4 'xc:#000' 'xc:#fff' 4x4.gif
/4x4.gif:
$ fq -d gif verbose /4x4.gif
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4.gif (gif) 0x0-0x5e.7 (95)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4.gif (gif) 0x0-0x5e.7 (95)
0x00|47 49 46 38 39 61 |GIF89a | header: "GIF89a" (Correct) 0x0-0x5.7 (6)
0x00| 04 00 | .. | width: 4 0x6-0x7.7 (2)
0x00| 04 00 | .. | height: 4 0x8-0x9.7 (2)

View File

@ -1,7 +1,7 @@
# echo test | gzip -N > test.gz
/test.gz:
$ fq -d gzip verbose /test.gz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.gz (gzip) 0x0-0x18.7 (25)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.gz (gzip) 0x0-0x18.7 (25)
0x00|1f 8b |.. | identification: "\x1f\x8b" (Correct) 0x0-0x1.7 (2)
0x0|74 65 73 74 0a| |test.| | uncompressed: 746573740a 0x0-0x4.7 (5)
0x00| 08 | . | compression_method: deflate (8) 0x2-0x2.7 (1)

View File

@ -1,7 +1,7 @@
# sRGB2014.icc is from https://www.color.org/srgbprofiles.xalter
/sRGB2014.icc:
$ fq -d icc_profile verbose /sRGB2014.icc
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /sRGB2014.icc (icc_profile) 0x0-0xbcf.7 (3024)
|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)

View File

@ -2,7 +2,7 @@
# fq test.mp3 '.. | select(format == "id3v2")._bytes' > apic
/apic:
$ fq -d id3v2 verbose /apic
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /apic (id3v2) 0x0-0xb3.7 (180)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /apic (id3v2) 0x0-0xb3.7 (180)
0x00|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)
0x00| 04 | . | version: 4 0x3-0x3.7 (1)
0x00| 00 | . | revision: 0 0x4-0x4.7 (1)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -write_id3v1 1 -metadata title=test -f mp3 pipe:1 | fq - '.footers[0]._bytes' > id3v1
/id3v1:
$ fq -d id3v1 verbose /id3v1
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /id3v1 (id3v1) 0x0-0x7f.7 (128)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /id3v1 (id3v1) 0x0-0x7f.7 (128)
0x00|54 41 47 |TAG | magic: "TAG" (Correct) 0x0-0x2.7 (3)
0x00| 74 65 73 74 00 00 00 00 00 00 00 00 00| test.........| song_name: "test" 0x3-0x20.7 (30)
0x10|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00|................|

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 0s -id3v2_version 3 -f mp3 pipe:1 > id3v23
/id3v23:
$ fq -d id3v2 verbose /id3v23
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /id3v23 (id3v2) 0x0-0x2c.7 (45)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /id3v23 (id3v2) 0x0-0x2c.7 (45)
0x00|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)
0x00| 03 | . | version: 3 0x3-0x3.7 (1)
0x00| 00 | . | revision: 0 0x4-0x4.7 (1)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 0s -id3v2_version 4 -f mp3 pipe:1 > id3v24
/id3v24:
$ fq -d id3v2 verbose /id3v24
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /id3v24 (id3v2) 0x0-0x2c.7 (45)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /id3v24 (id3v2) 0x0-0x2c.7 (45)
0x00|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)
0x00| 04 | . | version: 4 0x3-0x3.7 (1)
0x00| 00 | . | revision: 0 0x4-0x4.7 (1)

View File

@ -4,7 +4,7 @@
# fq test.mp3 .headers[0]._bits > utf16-apic
/utf16-apic:
$ fq -d id3v2 verbose /utf16-apic
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /utf16-apic (id3v2) 0x0-0x255.7 (598)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /utf16-apic (id3v2) 0x0-0x255.7 (598)
0x000|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)
0x000| 04 | . | version: 4 0x3-0x3.7 (1)
0x000| 00 | . | revision: 0 0x4-0x4.7 (1)

View File

@ -1,7 +1,7 @@
# gm convert -size 4x4 'xc:#000' 4x4.jpg
/4x4.jpg:
$ fq -d jpeg verbose /4x4.jpg
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4.jpg (jpeg) 0x0-0x9f.7 (160)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4.jpg (jpeg) 0x0-0x9f.7 (160)
| | | segments: [9] 0x0-0x9f.7 (160)
| | | [0]: marker {} 0x0-0x1.7 (2)
0x00|ff |. | prefix: ff 0x0-0x0.7 (1)

View File

@ -1,7 +1,7 @@
/test.json:
/json.gz:
$ fq -d json . /test.json
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00|7b 0a 20 20 20 20 22 61 22 3a 20 31 32 33 2c 0a|{. "a": 123,.|.: {} /test.json (json)
* |until 0x74.7 (end) (117) | |
$ fq -d json tovalue /test.json
@ -17,13 +17,13 @@ $ fq -d json tovalue /test.json
"e": 123.4
}
$ fq . /test.json
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00|7b 0a 20 20 20 20 22 61 22 3a 20 31 32 33 2c 0a|{. "a": 123,.|.: {} /test.json (json)
* |until 0x74.7 (end) (117) | |
$ fq .b[1] /test.json
2
$ fq . /json.gz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /json.gz (gzip)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /json.gz (gzip)
0x00|1f 8b |.. | identification: "\x1f\x8b" (Correct)
0x0|7b 22 61 22 3a 20 31 32 33 7d |{"a": 123} | uncompressed: {} (json)
0x00| 08 | . | compression_method: deflate (8)
@ -58,5 +58,5 @@ $ fq tovalue /json.gz
}
}
$ fq .uncompressed /json.gz
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|7b 22 61 22 3a 20 31 32 33 7d |{"a": 123} |.uncompressed: {} (json)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -c:a aac -f matroska -t 50ms aac.mkv
/aac.mkv:
$ fq -d matroska verbose /aac.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /aac.mkv (matroska) 0x0-0x4c3.7 (1220)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /aac.mkv (matroska) 0x0-0x4c3.7 (1220)
| | | elements: [2] 0x0-0x4c3.7 (1220)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -g 1 -c:v librav1e -t 50ms av1.mkv
/av1.mkv:
$ fq -d matroska verbose /av1.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /av1.mkv (matroska) 0x0-0x13e6.7 (5095)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /av1.mkv (matroska) 0x0-0x13e6.7 (5095)
| | | elements: [2] 0x0-0x13e6.7 (5095)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v h264 -f matroska -t 50ms avc.mkv
/avc.mkv:
$ fq -d matroska verbose /avc.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /avc.mkv (matroska) 0x0-0xd46.7 (3399)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /avc.mkv (matroska) 0x0-0xd46.7 (3399)
| | | elements: [2] 0x0-0xd46.7 (3399)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -ac 2 -c:a flac -strict experimental -f matroska -t 50ms flac.mkv
/flac.mkv:
$ fq -d matroska verbose /flac.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /flac.mkv (matroska) 0x0-0x4ce.7 (1231)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /flac.mkv (matroska) 0x0-0x4ce.7 (1231)
| | | elements: [2] 0x0-0x4ce.7 (1231)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v hevc -f matroska -t 50ms hevc.mkv
/hevc.mkv:
$ fq -d matroska verbose /hevc.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /hevc.mkv (matroska) 0x0-0x13ea.7 (5099)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /hevc.mkv (matroska) 0x0-0x13ea.7 (5099)
| | | elements: [2] 0x0-0x13ea.7 (5099)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -c:a mp3 -f matroska -t 50ms mp3.mkv
/mp3.mkv:
$ fq -d matroska verbose /mp3.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mp3.mkv (matroska) 0x0-0x4db.7 (1244)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mp3.mkv (matroska) 0x0-0x4db.7 (1244)
| | | elements: [2] 0x0-0x4db.7 (1244)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v mpeg2video -f matroska -t 50ms mpeg2.mkv
/mpeg2.mkv:
$ fq -d matroska verbose /mpeg2.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mpeg2.mkv (matroska) 0x0-0x21c9.7 (8650)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mpeg2.mkv (matroska) 0x0-0x21c9.7 (8650)
| | | elements: [2] 0x0-0x21c9.7 (8650)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -strict experimental -c:a opus -f matroska -t 50ms opus.mkv
/opus.mkv:
$ fq -d matroska verbose /opus.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /opus.mkv (matroska) 0x0-0x3ec.7 (1005)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /opus.mkv (matroska) 0x0-0x3ec.7 (1005)
| | | elements: [2] 0x0-0x3ec.7 (1005)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,6 +1,6 @@
/avc.mkv:
$ fq -d matroska 'matroska_path(".Segment.Tracks[0].TrackEntry[0].CodecID")' /avc.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.elements[1].elements[3].elements[1].elements[4]: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.elements[1].elements[3].elements[1].elements[4]: {}
| | | type: string (3)
0x150| 86 | . | id: CodecID (0x86)
0x150| 8f | . | size: 15

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -ac 2 -strict experimental -c:a vorbis -f matroska -t 50ms vorbis.mkv
/vorbis.mkv:
$ fq -d matroska verbose /vorbis.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis.mkv (matroska) 0x0-0x10fa.7 (4347)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis.mkv (matroska) 0x0-0x10fa.7 (4347)
| | | elements: [2] 0x0-0x10fa.7 (4347)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v vp8 -f matroska -t 50ms vp8.mkv
/vp8.mkv:
$ fq -d matroska verbose /vp8.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vp8.mkv (matroska) 0x0-0x148b.7 (5260)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vp8.mkv (matroska) 0x0-0x148b.7 (5260)
| | | elements: [2] 0x0-0x148b.7 (5260)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v vp9 -f matroska -t 50ms vp9.mkv
/vp9.mkv:
$ fq -d matroska verbose /vp9.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vp9.mkv (matroska) 0x0-0x1785.7 (6022)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vp9.mkv (matroska) 0x0-0x1785.7 (6022)
| | | elements: [2] 0x0-0x1785.7 (6022)
| | | [0]: element {} 0x0-0x27.7 (40)
| | | type: master (7) 0x0-NA (0)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -f mp3 pipe:1 | fq - '.headers._bytes, ("\x00\x00\x00" | tobytes), .frames[0]._bytes' > header-zeros-frames.mp3
/header-zeros-frames.mp3:
$ fq -d mp3 verbose /header-zeros-frames.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /header-zeros-frames.mp3 (mp3) 0x0-0xff.7 (256)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /header-zeros-frames.mp3 (mp3) 0x0-0xff.7 (256)
| | | headers: [1] 0x0-0x2c.7 (45)
| | | [0]: header {} (id3v2) 0x0-0x2c.7 (45)
0x000|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 1ms -write_xing 0 -write_id3v2 4 -write_id3v1 1 -metadata title=test -f mp3 headerfooter.mp3
/headerfooter.mp3:
$ fq -d mp3 verbose /headerfooter.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /headerfooter.mp3 (mp3) 0x0-0x25d.7 (606)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /headerfooter.mp3 (mp3) 0x0-0x25d.7 (606)
| | | headers: [1] 0x0-0x3c.7 (61)
| | | [0]: header {} (id3v2) 0x0-0x3c.7 (61)
0x000|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)

View File

@ -1,10 +1,10 @@
# ffmpeg -f lavfi -i sine -ac 2 -t 10ms -metadata title=test -write_xing 1 -write_id3v1 1 -f mp3 test.mp3
/test.mp3:
$ fq -d mp3 '.headers[0].magic | verbose' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (Correct) 0x0-0x2.7 (3)
$ fq -d mp3 verbose /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.mp3 (mp3) 0x0-0x4cf.7 (1232)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.mp3 (mp3) 0x0-0x4cf.7 (1232)
| | | headers: [1] 0x0-0x3c.7 (61)
| | | [0]: header {} (id3v2) 0x0-0x3c.7 (61)
0x000|49 44 33 |ID3 | magic: "ID3" (Correct) 0x0-0x2.7 (3)

View File

@ -1,7 +1,7 @@
# fq '"aaaa", .frames[0], "bbbb", .frames[0], "ccccc" | tobytes' test.mp3 > unknown.mp3
/unknown.mp3:
$ fq -d mp3 . /unknown.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /unknown.mp3 (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /unknown.mp3 (mp3)
| | | headers: [0]
0x000|61 61 61 61 |aaaa | unknown0: 61616161
0x000| ff fb 90 64 00 00 02 6b 0b ce 9d 60| ...d...k...`| frames: [2]

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -f mp3 temp.mp3 && fq temp.mp3 '.frame[0].xing | tobits' > xing
/xing:
$ fq -d xing verbose /xing
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /xing (xing) 0x0-0x9b.7 (156)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /xing (xing) 0x0-0x9b.7 (156)
0x00|49 6e 66 6f |Info | header: "Info" 0x0-0x3.7 (4)
| | | present_flags: {} 0x4-0x7.7 (4)
0x00| 00 00 00 0f | .... | unused: 0 0x4-0x7.3 (3.4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -c:a aac -f mp4 -t 50ms aac.mp4
/aac.mp4:
$ fq -d mp4 verbose /aac.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /aac.mp4 (mp4) 0x0-0x59c.7 (1437)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /aac.mp4 (mp4) 0x0-0x59c.7 (1437)
| | | boxes: [4] 0x0-0x59c.7 (1437)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -v trace -f lavfi -i testsrc -c:v librav1e -t 50ms av1.mp4
/av1.mp4:
$ fq -d mp4 verbose /av1.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /av1.mp4 (mp4) 0x0-0x14b1.7 (5298)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /av1.mp4 (mp4) 0x0-0x14b1.7 (5298)
| | | boxes: [4] 0x0-0x14b1.7 (5298)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x0000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v h264 -f mp4 -t 50ms avc.mp4
/avc.mp4:
$ fq -d mp4 verbose /avc.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /avc.mp4 (mp4) 0x0-0xdf2.7 (3571)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /avc.mp4 (mp4) 0x0-0xdf2.7 (3571)
| | | boxes: [4] 0x0-0xdf2.7 (3571)
| | | [0]: box {} 0x0-0x1f.7 (32)
0x0000|00 00 00 20 |... | size: 32 0x0-0x3.7 (4)

View File

@ -6,7 +6,7 @@
/dash_video_init.mp4:
/dash_video_1.m4s:
$ fq -d mp4 verbose /dash_audio_init.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /dash_audio_init.mp4 (mp4) 0x0-0x32f.7 (816)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /dash_audio_init.mp4 (mp4) 0x0-0x32f.7 (816)
| | | boxes: [2] 0x0-0x32f.7 (816)
| | | [0]: box {} 0x0-0x1f.7 (32)
0x000|00 00 00 20 |... | size: 32 0x0-0x3.7 (4)
@ -351,7 +351,7 @@ $ fq -d mp4 verbose /dash_audio_init.mp4
| | | [0]: track {} 0x330-NA (0)
| | | samples: [0] 0x330-NA (0)
$ fq -d mp4 verbose /dash_audio_1.m4s
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /dash_audio_1.m4s (mp4) 0x0-0x4eb.7 (1260)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /dash_audio_1.m4s (mp4) 0x0-0x4eb.7 (1260)
| | | boxes: [4] 0x0-0x4eb.7 (1260)
| | | [0]: box {} 0x0-0x1f.7 (32)
0x000|00 00 00 20 |... | size: 32 0x0-0x3.7 (4)
@ -473,7 +473,7 @@ $ fq -d mp4 verbose /dash_audio_1.m4s
* |until 0x4eb.7 (end) (1008) | |
| | | tracks: [0] 0x4ec-NA (0)
$ fq -d mp4 verbose /dash_video_init.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /dash_video_init.mp4 (mp4) 0x0-0x332.7 (819)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /dash_video_init.mp4 (mp4) 0x0-0x332.7 (819)
| | | boxes: [2] 0x0-0x332.7 (819)
| | | [0]: box {} 0x0-0x23.7 (36)
0x000|00 00 00 24 |...$ | size: 36 0x0-0x3.7 (4)
@ -867,7 +867,7 @@ $ fq -d mp4 verbose /dash_video_init.mp4
| | | [0]: track {} 0x333-NA (0)
| | | samples: [0] 0x333-NA (0)
$ fq -d mp4 verbose /dash_video_1.m4s
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /dash_video_1.m4s (mp4) 0x0-0x1fd0.7 (8145)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /dash_video_1.m4s (mp4) 0x0-0x1fd0.7 (8145)
| | | boxes: [4] 0x0-0x1fd0.7 (8145)
| | | [0]: box {} 0x0-0x23.7 (36)
0x0000|00 00 00 24 |...$ | size: 36 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -ac 2 -c:a flac -strict experimental -f mp4 -t 50ms flac.mp4
/flac.mp4:
$ fq -d mp4 verbose /flac.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /flac.mp4 (mp4) 0x0-0x542.7 (1347)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /flac.mp4 (mp4) 0x0-0x542.7 (1347)
| | | boxes: [4] 0x0-0x542.7 (1347)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -f lavfi -i testsrc -g 1 -c:a aac -c:v h264 -f mp4 -movflags +global_sidx+frag_keyframe+empty_moov -t 100ms fragmented.mp4
/fragmented.mp4:
$ fq -d mp4 verbose /fragmented.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /fragmented.mp4 (mp4) 0x0-0x2bb3.7 (11188)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /fragmented.mp4 (mp4) 0x0-0x2bb3.7 (11188)
| | | boxes: [11] 0x0-0x2bb3.7 (11188)
| | | [0]: box {} 0x0-0x23.7 (36)
0x0000|00 00 00 24 |...$ | size: 36 0x0-0x3.7 (4)

View File

@ -2,7 +2,7 @@
# MP4Box -add-image heic.hvc -ab heic -new heic.mp4
/heic.mp4:
$ fq -d mp4 verbose /heic.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /heic.mp4 (mp4) 0x0-0xb2c.7 (2861)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /heic.mp4 (mp4) 0x0-0xb2c.7 (2861)
| | | boxes: [4] 0x0-0xb2c.7 (2861)
| | | [0]: box {} 0x0-0x17.7 (24)
0x000|00 00 00 18 |.... | size: 24 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v hevc -f mp4 -t 50ms hevc.mp4
/hevc.mp4:
$ fq -d mp4 verbose /hevc.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /hevc.mp4 (mp4) 0x0-0x149a.7 (5275)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /hevc.mp4 (mp4) 0x0-0x149a.7 (5275)
| | | boxes: [4] 0x0-0x149a.7 (5275)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x0000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -c:a mp3 -f mp4 -t 50ms mp3.mp4
/mp3.mp4:
$ fq -d mp4 verbose /mp3.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mp3.mp4 (mp4) 0x0-0x564.7 (1381)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mp3.mp4 (mp4) 0x0-0x564.7 (1381)
| | | boxes: [4] 0x0-0x564.7 (1381)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v mpeg2video -f mp4 -t 50ms mpeg2.mp4
/mpeg2.mp4:
$ fq -d mp4 verbose /mpeg2.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mpeg2.mp4 (mp4) 0x0-0x22a8.7 (8873)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mpeg2.mp4 (mp4) 0x0-0x22a8.7 (8873)
| | | boxes: [4] 0x0-0x22a8.7 (8873)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x0000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -strict experimental -c:a opus -t 50ms opus.mp4
/opus.mp4:
$ fq -d mp4 verbose /opus.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /opus.mp4 (mp4) 0x0-0x438.7 (1081)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /opus.mp4 (mp4) 0x0-0x438.7 (1081)
| | | boxes: [4] 0x0-0x438.7 (1081)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,6 +1,6 @@
/fragmented.mp4:
$ fq -d mp4 'mp4_path(".moov.trak[1]")' /fragmented.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.boxes[1].boxes[2]: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.boxes[1].boxes[2]: {}
0x280| 00 00 01 bf | .... | size: 447
0x280| 74 72 61 6b | trak | type: "trak" (Container for an individual track or stream)
0x280| 00 00 00 5c| ...\| boxes: [2]

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -ac 2 -strict experimental -c:a vorbis -t 50ms vorbis.mp4
/vorbis.mp4:
$ fq -d mp4 verbose /vorbis.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis.mp4 (mp4) 0x0-0x1188.7 (4489)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis.mp4 (mp4) 0x0-0x1188.7 (4489)
| | | boxes: [4] 0x0-0x1188.7 (4489)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x0000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i testsrc -c:v vp9 -t 50ms vp9.mp4
/vp9.mp4:
$ fq -d mp4 verbose /vp9.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vp9.mp4 (mp4) 0x0-0x184e.7 (6223)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vp9.mp4 (mp4) 0x0-0x184e.7 (6223)
| | | boxes: [4] 0x0-0x184e.7 (6223)
| | | [0]: box {} 0x0-0x1b.7 (28)
0x0000|00 00 00 1c |.... | size: 28 0x0-0x3.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i sine -ac 2 -t 40ms -f adts adts
/adts:
$ fq -d adts verbose /adts
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: [3] /adts (adts) 0x0-0x406.7 (1031)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: [3] /adts (adts) 0x0-0x406.7 (1031)
| | | [0]: frame {} (adts_frame) 0x0-0x153.7 (340)
0x000|ff f1 |.. | syncword: Correct (0xfff) 0x0-0x1.3 (1.4)
0x000| f1 | . | mpeg_version: MPEG-4 (0) 0x1.4-0x1.4 (0.1)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i testsrc -t 10ms -f h264 avc_annexb
/avc_annexb:
$ fq -d avc_annexb verbose /avc_annexb
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: [8] /avc_annexb (avc_annexb) 0x0-0xae4.7 (2789)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: [8] /avc_annexb (avc_annexb) 0x0-0xae4.7 (2789)
0x0000|00 00 00 01 |.... | [0]: start_code 00000001 0x0-0x3.7 (4)
| | | [1]: nalu {} (avc_nalu) 0x4-0x1c.7 (25)
| | | sps: {} (avc_sps) 0x0-0x15.7 (22)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i testsrc -t 10ms -f hevc hevc_annexb
/hevc_annexb:
$ fq -d hevc_annexb verbose /hevc_annexb
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: [10] /hevc_annexb (hevc_annexb) 0x0-0x1193.7 (4500)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: [10] /hevc_annexb (hevc_annexb) 0x0-0x1193.7 (4500)
0x0000|00 00 00 01 |.... | [0]: start_code 00000001 0x0-0x3.7 (4)
| | | [1]: nalu {} (hevc_nalu) 0x4-0x1a.7 (23)
0x0000| 40 | @ | forbidden_zero_bit: false 0x4-0x4 (0.1)

View File

@ -1,5 +1,5 @@
# ffmpeg -f lavfi -i sine -t 10ms -f wav pipe:1 | lame - - | fq - '.frame[1] | tobits' > mp3-frame-mono-crc
/mp3-frame-mono-crc:
$ fq -d mp3_frame '.header.crc | verbose' /mp3-frame-mono-crc
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 2c b9 | ,. |.header.crc: 2cb9 0x4-0x5.7 (2)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i sine -ac 1 -t 10ms -f mp3 file && fq file '.frame[1] | tobits' > mp3-frame-mono
/mp3-frame-mono:
$ fq -d mp3_frame verbose /mp3-frame-mono
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mp3-frame-mono (mp3_frame) 0x0-0xcf.7 (208)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mp3-frame-mono (mp3_frame) 0x0-0xcf.7 (208)
| | | header: {} 0x0-0x3.7 (4)
0x00|ff fb |.. | sync: Correct (0x7ff) 0x0-0x1.2 (1.3)
0x00| fb | . | mpeg_version: MPEG Version 1 (1) 0x1.3-0x1.4 (0.2)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -f mp3 file && fq file '.frame[1] | tobits' > mp3-frame-stereo
/mp3-frame-stereo:
$ fq -d mp3_frame verbose /mp3-frame-stereo
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /mp3-frame-stereo (mp3_frame) 0x0-0x1a0.7 (417)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /mp3-frame-stereo (mp3_frame) 0x0-0x1a0.7 (417)
| | | header: {} 0x0-0x3.7 (4)
0x000|ff fb |.. | sync: Correct (0x7ff) 0x0-0x1.2 (1.3)
0x000| fb | . | mpeg_version: MPEG Version 1 (1) 0x1.3-0x1.4 (0.2)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -f ogg pipe:1 | fq - '.page[0] | tobits' > page
/page:
$ fq -d ogg_page verbose /page
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /page (ogg_page) 0x0-0x39.7 (58)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /page (ogg_page) 0x0-0x39.7 (58)
0x00|4f 67 67 53 |OggS | capture_pattern: "OggS" (Correct) 0x0-0x3.7 (4)
0x00| 00 | . | stream_structure_version: Correct (0x0) 0x4-0x4.7 (1)
0x00| 02 | . | unused_flags: 0 0x5-0x5.4 (0.5)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 50ms test.ogg
/test.ogg:
$ fq -d ogg verbose /test.ogg
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.ogg (ogg) 0x0-0xe45.7 (3654)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.ogg (ogg) 0x0-0xe45.7 (3654)
| | | pages: [3] 0x0-0xe45.7 (3654)
| | | [0]: page {} (ogg_page) 0x0-0x39.7 (58)
0x0000|4f 67 67 53 |OggS | capture_pattern: "OggS" (Correct) 0x0-0x3.7 (4)

View File

@ -2,7 +2,7 @@
# fq opus.ogg '.stream[0].packet[1] | tobits' > opus-tags
/opus-audio:
$ fq -d opus_packet verbose /opus-audio
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /opus-audio (opus_packet) 0x0-0x1b5.7 (438)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /opus-audio (opus_packet) 0x0-0x1b5.7 (438)
| | | type: "audio" 0x0-NA (0)
| | | toc: {} 0x0-0x1b5.7 (438)
| | | config: {} 0x0-0x0.4 (0.5)
@ -20,7 +20,7 @@ $ fq -d opus_packet verbose /opus-audio
* |until 0x1b5.7 (end) (437) | |
/opus-head:
$ fq -d opus_packet verbose /opus-head
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /opus-head (opus_packet) 0x0-0x12.7 (19)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /opus-head (opus_packet) 0x0-0x12.7 (19)
| | | type: "head" 0x0-NA (0)
0x00|4f 70 75 73 48 65 61 64 |OpusHead | prefix: "OpusHead" 0x0-0x7.7 (8)
0x00| 01 | . | version: 1 0x8-0x8.7 (1)
@ -31,7 +31,7 @@ $ fq -d opus_packet verbose /opus-head
0x10| 00| | .| | map_family: 0 0x12-0x12.7 (1)
/opus-tags:
$ fq -d opus_packet verbose /opus-tags
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /opus-tags (opus_packet) 0x0-0x4b.7 (76)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /opus-tags (opus_packet) 0x0-0x4b.7 (76)
| | | type: "tags" 0x0-NA (0)
0x00|4f 70 75 73 54 61 67 73 |OpusTags | prefix: "OpusTags" 0x0-0x7.7 (8)
| | | comment: {} (vorbis_comment) 0x8-0x4b.7 (68)

View File

@ -3,7 +3,7 @@
# mv 4x4out.png 4x4.png
/4x4.png:
$ fq -d png verbose /4x4.png
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4.png (png) 0x0-0x125.7 (294)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4.png (png) 0x0-0x125.7 (294)
0x000|89 50 4e 47 0d 0a 1a 0a |.PNG.... | signature: "\x89PNG\r\n\x1a\n" (Correct) 0x0-0x7.7 (8)
| | | chunks: [10] 0x8-0x125.7 (286)
| | | [0]: chunk {} 0x8-0x20.7 (25)

View File

@ -1,7 +1,7 @@
# ffmpeg -y -f lavfi -i testsrc=size=4x4:r=1 -t 2s 4x4a.apng
/4x4a.apng:
$ fq -d png verbose /4x4a.apng
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4a.apng (png) 0x0-0xf3.7 (244)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4a.apng (png) 0x0-0xf3.7 (244)
0x00|89 50 4e 47 0d 0a 1a 0a |.PNG.... | signature: "\x89PNG\r\n\x1a\n" (Correct) 0x0-0x7.7 (8)
| | | chunks: [8] 0x8-0xf3.7 (236)
| | | [0]: chunk {} 0x8-0x20.7 (25)

View File

@ -1,7 +1,7 @@
# gm convert -size 4x4 'xc:#000' 4x4.tiff
/4x4.tiff:
$ fq -d tiff verbose /4x4.tiff
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4.tiff (tiff) 0x0-0x107.7 (264)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4.tiff (tiff) 0x0-0x107.7 (264)
0x000|49 49 |II | order: "II" 0x0-0x1.7 (2)
0x000|49 49 2a 00 |II*. | endian: little-endian (0x49492a00) 0x0-0x3.7 (4)
0x000| 2a 00 | *. | integer_42: 10752 0x2-0x3.7 (2)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -f ogg pipe:1 | fq - '.steam[0].packet[0] | tobits' > vorbis-identifcation
/vorbis-identifcation:
$ fq -d vorbis_packet verbose /vorbis-identifcation
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis-identifcation (vorbis_packet) 0x0-0x1d.7 (30)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis-identifcation (vorbis_packet) 0x0-0x1d.7 (30)
0x00|01 |. | packet_type: Identification (1) 0x0-0x0.7 (1)
0x00| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (Correct) 0x1-0x6.7 (6)
0x00| 00 00 00 00 | .... | vorbis_version: Correct (0x0) 0x7-0xa.7 (4)
@ -17,7 +17,7 @@ $ fq -d vorbis_packet verbose /vorbis-identifcation
# ffmpeg -f lavfi -i sine -t 10ms -f ogg pipe:1 | fq - '.packet[1] | tobits' > vorbis-comment
/vorbis-comment:
$ fq -d vorbis_packet verbose /vorbis-comment
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis-comment (vorbis_packet) 0x0-0x3f.7 (64)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis-comment (vorbis_packet) 0x0-0x3f.7 (64)
0x00|03 |. | packet_type: Comment (3) 0x0-0x0.7 (1)
0x00| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (Correct) 0x1-0x6.7 (6)
| | | comment: {} (vorbis_comment) 0x7-0x3e.7 (56)
@ -35,7 +35,7 @@ $ fq -d vorbis_packet verbose /vorbis-comment
# ffmpeg -f lavfi -i sine -t 10ms -f ogg pipe:1 | fq - '.packet[2] | tobits' > vorbis-setup
/vorbis-setup:
$ fq -d vorbis_packet verbose /vorbis-setup
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis-setup (vorbis_packet) 0x0-0xc74.7 (3189)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis-setup (vorbis_packet) 0x0-0xc74.7 (3189)
0x000|05 |. | packet_type: Setup (5) 0x0-0x0.7 (1)
0x000| 76 6f 72 62 69 73 | vorbis | magic: "vorbis" (Correct) 0x1-0x6.7 (6)
0x000| 22 | " | vorbis_codebook_count: 35 0x7-0x7.7 (1)
@ -47,7 +47,7 @@ $ fq -d vorbis_packet verbose /vorbis-setup
# ffmpeg -f lavfi -i sine -t 10ms -f ogg pipe:1 | fq - '.packet[3] | tobits' > vorbis-audio
/vorbis-audio:
$ fq -d vorbis_packet verbose /vorbis-audio
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /vorbis-audio (vorbis_packet) 0x0-0x20.7 (33)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /vorbis-audio (vorbis_packet) 0x0-0x20.7 (33)
0x00|54 |T | packet_type: Audio (0) 0x0-0x0.7 (1)
0x00| dd cb ce aa 5e d8 7f 2d 01 42 00 a0 dd 71 77| ....^..-.B...qw| unknown0: ddcbceaa5ed87f2d014200a0dd71778b... 0x1-0x20.7 (32)
0x10|8b ed cd 37 df 7c 33 3a 0c c3 30 0c c3 30 d4 50|...7.|3:..0..0.P|

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -ac 2 -f wav pipe:1 > end-of-file.wav
/end-of-file.wav:
$ fq -d wav verbose /end-of-file.wav
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /end-of-file.wav (wav) 0x0-0x731.7 (1842)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /end-of-file.wav (wav) 0x0-0x731.7 (1842)
0x000|52 49 46 46 |RIFF | id: "RIFF" 0x0-0x3.7 (4)
0x000| ff ff ff ff | .... | size: rest of file (0xffffffff) 0x4-0x7.7 (4)
0x000| 57 41 56 45 | WAVE | format: "WAVE" 0x8-0xb.7 (4)

View File

@ -1,7 +1,7 @@
# ffmpeg -f lavfi -i sine -t 10ms -ac 2 stereo.wav
/stereo.wav:
$ fq -d wav verbose /stereo.wav
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /stereo.wav (wav) 0x0-0x731.7 (1842)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /stereo.wav (wav) 0x0-0x731.7 (1842)
0x000|52 49 46 46 |RIFF | id: "RIFF" 0x0-0x3.7 (4)
0x000| 2a 07 00 00 | *... | size: 1834 0x4-0x7.7 (4)
0x000| 57 41 56 45 | WAVE | format: "WAVE" 0x8-0xb.7 (4)

View File

@ -1,7 +1,7 @@
# convert -size 4x4 "xc:#000" 4x4.webp
/4x4.webp:
$ fq -d webp verbose /4x4.webp
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /4x4.webp (webp) 0x0-0x2b.7 (44)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /4x4.webp (webp) 0x0-0x2b.7 (44)
0x00|52 49 46 46 |RIFF | riff_id: "RIFF" (Correct) 0x0-0x3.7 (4)
0x00| 24 00 00 00 | $... | riff_length: 36 0x4-0x7.7 (4)
0x00| 57 45 42 50 | WEBP | webp_id: "WEBP" (Correct) 0x8-0xb.7 (4)

View File

@ -50,13 +50,16 @@ func dumpEx(v *decode.Value, buf []byte, cw *columnwriter.Writer, depth int, roo
cprint(5, deco.Column, "\n")
}
var header string
var hexHeader string
var asciiHeader string
if depth == 0 {
for i := 0; i < opts.LineBytes; i++ {
header += num.PadFormatInt(int64(i), opts.AddrBase, false, 2)
s := num.PadFormatInt(int64(i), opts.AddrBase, false, 2)
hexHeader += s
if i < opts.LineBytes-1 {
header += " "
hexHeader += " "
}
asciiHeader += s[len(s)-1:]
}
}
@ -85,14 +88,12 @@ func dumpEx(v *decode.Value, buf []byte, cw *columnwriter.Writer, depth int, roo
indent := strings.Repeat(" ", depth)
if depth == 0 {
switch v.V.(type) {
case decode.Struct:
cfmt(colHex, "%s", deco.DumpHeader.F(header))
case decode.Array:
cfmt(colHex, "%s", deco.DumpHeader.F(header))
default:
if !isCompound(v) {
columns()
cfmt(colHex, "%s", deco.DumpHeader.F(header))
}
cfmt(colHex, "%s", deco.DumpHeader.F(hexHeader))
cfmt(colAscii, "%s", deco.DumpHeader.F(asciiHeader))
if !isCompound(v) {
cw.Flush()
}
}

View File

@ -35,7 +35,7 @@ exitcode: 2
stderr:
error: --decode-file filea: /nonexisting: file not found
$ fq -n -d mp4 --decode-file filea /test.mp3 '$filea'
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.mp3 (mp4)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.mp3 (mp4)
| | | error: mp4: failed to validate at position 0x8: no styp, ftyp, free or moov box found
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| unknown0: 49443304000000000023545353450000...
* |until 0x283.7 (end) (644) | |

View File

@ -26,7 +26,7 @@ mp3> .headers[0].magic._format
null
mp3> ^D
$ fq -d raw .
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} - (raw)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} - (raw)
0x0|61 62 63 0a| |abc.| | unknown0: 6162630a
stdin:
abc

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> decode
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -9,7 +9,7 @@ mp3> decode
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> decode("mp3")
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -17,7 +17,7 @@ mp3> decode("mp3")
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> decode("mp3"; {})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -25,7 +25,7 @@ mp3> decode("mp3"; {})
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> probe
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -33,7 +33,7 @@ mp3> probe
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> probe({})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]

View File

@ -2,7 +2,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> display({depth: 1})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.mp3 (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.mp3 (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -10,7 +10,7 @@ mp3> display({depth: 1})
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> display({depth: 2})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.mp3 (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.mp3 (mp3)
| | | headers: [1]
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| [0]: {} (id3v2)
* |until 0x2c.7 (45) | |
@ -26,7 +26,7 @@ mp3> display({depth: 2})
* |until 0x283.7 (end) (209) | |
| | | footers: [0]
mp3> display({depth: 1, displaybytes: 8})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} /test.mp3 (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} /test.mp3 (mp3)
0x000|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| headers: [1]
* |until 0x2c.7 (45) | |
0x020| ff fb 40| ..@| frames: [3]
@ -34,7 +34,7 @@ mp3> display({depth: 1, displaybytes: 8})
* |until 0x283.7 (end) (599) | |
| | | footers: [0]
mp3> display({depth: 1, linebytes: 8})
|00 01 02 03 04 05 06 07| |.: {} /test.mp3 (mp3)
|00 01 02 03 04 05 06 07|01234567|.: {} /test.mp3 (mp3)
0x000|49 44 33 04 00 00 00 00|ID3.....| headers: [1]
0x008|00 23 54 53 53 45 00 00|.#TSSE..|
* |until 0x2c.7 (45) | |
@ -44,7 +44,7 @@ mp3> display({depth: 1, linebytes: 8})
* |until 0x283.7 (end) (599)| |
| | | footers: [0]
mp3> .frames[0] | verbose({depth: 1, addrbase: 10})
|00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15| |.frames[0]: frame {} (mp3_frame) 45-226.7 (182)
|00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15|0123456789012345|.frames[0]: frame {} (mp3_frame) 45-226.7 (182)
032| ff fb 40| ..@| header: {} 45-48.7 (4)
048|c0 |. |
048| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info: {} 49-65.7 (17)
@ -56,7 +56,7 @@ mp3> .frames[0] | verbose({depth: 1, addrbase: 10})
224|00 00 00 |... |
| | | crc_calculated: 827a 227-NA (0)
mp3> .frames[0] | verbose({depth: 1, sizebase: 16})
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0]: frame {} (mp3_frame) 0x2d-0xe2.7 (0xb6)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0]: frame {} (mp3_frame) 0x2d-0xe2.7 (0xb6)
0x20| ff fb 40| ..@| header: {} 0x2d-0x30.7 (0x4)
0x30|c0 |. |
0x30| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info: {} 0x31-0x41.7 (0x11)
@ -68,7 +68,7 @@ mp3> .frames[0] | verbose({depth: 1, sizebase: 16})
0xe0|00 00 00 |... |
| | | crc_calculated: 827a 0xe3-NA (0x0)
mp3> .frames[0].xing | d, f, v
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0].xing: {} (xing)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].xing: {} (xing)
0x40| 49 6e 66 6f | Info | header: "Info"
| | | present_flags: {}
0x40| 00 00 00 0f | .... | unused: 0
@ -153,7 +153,7 @@ mp3> .frames[0].xing | d, f, v
0xd0| 00 00 02 57 | ...W | length: 599
0xd0| 62 f0 | b. | music_crc: 25328
0xd0| 5a 35 | Z5 | tag_crc: 23093
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0].xing: {} (xing)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].xing: {} (xing)
0x40| 49 6e 66 6f | Info | header: "Info"
| | | present_flags: {}
0x40| 00 00 00 0f | .... | unused: 0
@ -287,7 +287,7 @@ mp3> .frames[0].xing | d, f, v
0xd0| 00 00 02 57 | ...W | length: 599
0xd0| 62 f0 | b. | music_crc: 25328
0xd0| 5a 35 | Z5 | tag_crc: 23093
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0].xing: {} (xing) 0x42-0xdd.7 (156)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].xing: {} (xing) 0x42-0xdd.7 (156)
0x40| 49 6e 66 6f | Info | header: "Info" 0x42-0x45.7 (4)
| | | present_flags: {} 0x46-0x49.7 (4)
0x40| 00 00 00 0f | .... | unused: 0 0x46-0x49.3 (3.4)
@ -423,7 +423,7 @@ mp3> .frames[0].xing | d, f, v
0xd0| 5a 35 | Z5 | tag_crc: 23093 0xdc-0xdd.7 (2)
mp3> ^D
$ fq -n '"broken" | mp3 | d'
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.: {} (mp3)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.: {} (mp3)
| | | error: mp3: failed to validate at position 0x0: no frames found
| | | headers: [0]
| | | frames: [0]

View File

@ -142,7 +142,7 @@ $ fq -d mp3 '.frames | map(.header) | sort_by(.bitrate)' /test.mp3
}
]
$ fq -d mp3 '.frames | map(.header) | sort_by(.bitrate)[0]' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0].header: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].header: {}
0x20| ff fb | .. | sync: Correct (0x7ff)
0x20| fb | . | mpeg_version: MPEG Version 1 (1)
0x20| fb | . | layer: Layer 3 (3)
@ -158,7 +158,7 @@ $ fq -d mp3 '.frames | map(.header) | sort_by(.bitrate)[0]' /test.mp3
0x30|c0 |. | original: 0
0x30|c0 |. | emphasis: None (0b0)
$ fq -d mp3 '.frames | map(.header) | min_by(.bitrate)' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0].header: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].header: {}
0x20| ff fb | .. | sync: Correct (0x7ff)
0x20| fb | . | mpeg_version: MPEG Version 1 (1)
0x20| fb | . | layer: Layer 3 (3)
@ -174,7 +174,7 @@ $ fq -d mp3 '.frames | map(.header) | min_by(.bitrate)' /test.mp3
0x30|c0 |. | original: 0
0x30|c0 |. | emphasis: None (0b0)
$ fq -d mp3 '.frames | map(.header) | max_by(.bitrate)' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[2].header: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[2].header: {}
0x1b0| ff fb | .. | sync: Correct (0x7ff)
0x1b0| fb | . | mpeg_version: MPEG Version 1 (1)
0x1b0| fb | . | layer: Layer 3 (3)
@ -210,7 +210,7 @@ $ fq -d mp3 '.frames[0] | . + .header | keys, .bitrate' /test.mp3
"sync",
"xing"
]
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x20| 40| @|.frames[0].header.bitrate: 56000
$ fq -d mp3 '[.frames[0] | ., .header] | add | keys, .bitrate' /test.mp3
[
@ -233,5 +233,5 @@ $ fq -d mp3 '[.frames[0] | ., .header] | add | keys, .bitrate' /test.mp3
"sync",
"xing"
]
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x20| 40| @|.frames[0].header.bitrate: 56000

View File

@ -4,27 +4,27 @@
$ fq -d mp3 '.headers[].frames[0].flags.unsync // 123' /test.mp3
123
$ fq -d mp3 '.headers[].frames[0].size // 123' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00| 00 00| ..|.headers[0].frames[0].size: 15
0x10|00 0f |.. |
# test each in decoded order
$ fq -d mp3 '.headers[0][]' /test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (Correct)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 04 | . |.headers[0].version: 4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 00 | . |.headers[0].revision: 0
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers[0].flags: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers[0].flags: {}
0x0| 00 | . | unsynchronisation: false
0x0| 00 | . | extended_header: false
0x0| 00 | . | experimental_indicator: false
0x0| 00 | . | unused: 0
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 00 00 00 23 | ...# |.headers[0].size: 35
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers[0].frames: [1]
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers[0].frames: [1]
0x00| 54 53 53 45 00 00| TSSE..| [0]: {}
0x10|00 0f 00 00 03 4c 61 76 66 35 38 2e 34 35 2e 31|.....Lavf58.45.1|
0x20|30 30 00 |00. |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x20| 00 00 00 00 00 00 00 00 00 00 | .......... |.headers[0].padding: Correct (none) (zero padding)

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers: [1]
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers: [1]
0x00|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..| [0]: {} (id3v2)
* |until 0x2c.7 (45) | |
[
@ -43,7 +43,7 @@ mp3> .headers | ., tovalue, type, length?
"array"
1
mp3> .headers[0] | ., type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers[0]: {} (id3v2)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers[0]: {} (id3v2)
0x00|49 44 33 |ID3 | magic: "ID3" (Correct)
0x00| 04 | . | version: 4
0x00| 00 | . | revision: 0

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].flags.unsynchronisation | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 00 | . |.headers[0].flags.unsynchronisation: false
false
"boolean"

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -n '"[]" | json'
json> (.) | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|5b 5d| |[]| |.: [0] (json)
[]
"array"

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -n '"{}" | json'
json> (.) | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|7b 7d| |{}| |.: {} (json)
{}
"object"

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].padding | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x20| 00 00 00 00 00 00 00 00 00 00 | .......... |.headers[0].padding: Correct (none) (zero padding)
null
"null"

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].version | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0| 04 | . |.headers[0].version: 4
4
"number"

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].flags | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.headers[0].flags: {}
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.headers[0].flags: {}
0x0| 00 | . | unsynchronisation: false
0x0| 00 | . | extended_header: false
0x0| 00 | . | experimental_indicator: false

View File

@ -1,7 +1,7 @@
/test.mp3:
$ fq -i -d mp3 . /test.mp3
mp3> .headers[0].magic | ., tovalue, type, length?
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x0|49 44 33 |ID3 |.headers[0].magic: "ID3" (Correct)
"ID3"
"string"

View File

@ -39,7 +39,7 @@ null> ^D
$ fq -d mp3 -i . /test.mp3
mp3> .frames[0] | var("f")
mp3> $f
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f| |.frames[0]: {} (mp3_frame)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0]: {} (mp3_frame)
0x20| ff fb 40| ..@| header: {}
0x30|c0 |. |
0x30| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info: {}