mirror of
https://github.com/wader/fq.git
synced 2024-11-23 00:57:15 +03:00
051a70bd4b
All other ranges and slicing uses exclusive end so i think it make sense to make it consistent. Update docs and add additional example for non-byte-aligned field. Also fixes issue showing zero bit ranges as start-NA.
165 lines
18 KiB
Plaintext
165 lines
18 KiB
Plaintext
# ffmpeg -f lavfi -i sine -t 50ms -c:a flac flac.ogg
|
|
$ fq -d ogg dv flac.ogg
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: flac.ogg (ogg) 0x0-0x31c (796)
|
|
| | | pages[0:3]: 0x0-0x31c (796)
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: page (ogg_page) 0x0-0x4f (79)
|
|
0x00000|4f 67 67 53 |OggS | capture_pattern: "OggS" (valid) 0x0-0x4 (4)
|
|
0x00000| 00 | . | version: 0 (valid) 0x4-0x5 (1)
|
|
0x00000| 02 | . | unused_flags: 0 0x5-0x5.5 (0.5)
|
|
0x00000| 02 | . | last_page: false 0x5.5-0x5.6 (0.1)
|
|
0x00000| 02 | . | first_page: true 0x5.6-0x5.7 (0.1)
|
|
0x00000| 02 | . | continued_packet: false 0x5.7-0x6 (0.1)
|
|
0x00000| 00 00 00 00 00 00 00 00 | ........ | granule_position: 0 0x6-0xe (8)
|
|
0x00000| e1 52| .R| bitstream_serial_number: 599479009 0xe-0x12 (4)
|
|
0x00010|bb 23 |.# |
|
|
0x00010| 00 00 00 00 | .... | page_sequence_no: 0 0x12-0x16 (4)
|
|
0x00010| 99 7a 73 0f | .zs. | crc: 0xf737a99 (valid) 0x16-0x1a (4)
|
|
0x00010| 01 | . | page_segments: 1 0x1a-0x1b (1)
|
|
| | | segment_table[0:1]: 0x1b-0x1c (1)
|
|
0x00010| 33 | 3 | [0]: 51 segment_size 0x1b-0x1c (1)
|
|
| | | segments[0:1]: 0x1c-0x4f (51)
|
|
0x00010| 7f 46 4c 41| .FLA| [0]: raw bits segment 0x1c-0x4f (51)
|
|
0x00020|43 01 00 00 01 66 4c 61 43 00 00 00 22 12 00 12|C....fLaC..."...|
|
|
* |until 0x4e.7 (51) | |
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: page (ogg_page) 0x4f-0xa3 (84)
|
|
0x00040| 4f| O| capture_pattern: "OggS" (valid) 0x4f-0x53 (4)
|
|
0x00050|67 67 53 |ggS |
|
|
0x00050| 00 | . | version: 0 (valid) 0x53-0x54 (1)
|
|
0x00050| 00 | . | unused_flags: 0 0x54-0x54.5 (0.5)
|
|
0x00050| 00 | . | last_page: false 0x54.5-0x54.6 (0.1)
|
|
0x00050| 00 | . | first_page: false 0x54.6-0x54.7 (0.1)
|
|
0x00050| 00 | . | continued_packet: false 0x54.7-0x55 (0.1)
|
|
0x00050| 00 00 00 00 00 00 00 00 | ........ | granule_position: 0 0x55-0x5d (8)
|
|
0x00050| e1 52 bb| .R.| bitstream_serial_number: 599479009 0x5d-0x61 (4)
|
|
0x00060|23 |# |
|
|
0x00060| 01 00 00 00 | .... | page_sequence_no: 1 0x61-0x65 (4)
|
|
0x00060| 8c af 58 32 | ..X2 | crc: 0x3258af8c (valid) 0x65-0x69 (4)
|
|
0x00060| 01 | . | page_segments: 1 0x69-0x6a (1)
|
|
| | | segment_table[0:1]: 0x6a-0x6b (1)
|
|
0x00060| 38 | 8 | [0]: 56 segment_size 0x6a-0x6b (1)
|
|
| | | segments[0:1]: 0x6b-0xa3 (56)
|
|
0x00060| 84 00 00 34 0d| ...4.| [0]: raw bits segment 0x6b-0xa3 (56)
|
|
0x00070|00 00 00 4c 61 76 66 35 38 2e 37 36 2e 31 30 30|...Lavf58.76.100|
|
|
* |until 0xa2.7 (56) | |
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: page (ogg_page) 0xa3-0x31c (633)
|
|
0x000a0| 4f 67 67 53 | OggS | capture_pattern: "OggS" (valid) 0xa3-0xa7 (4)
|
|
0x000a0| 00 | . | version: 0 (valid) 0xa7-0xa8 (1)
|
|
0x000a0| 04 | . | unused_flags: 0 0xa8-0xa8.5 (0.5)
|
|
0x000a0| 04 | . | last_page: true 0xa8.5-0xa8.6 (0.1)
|
|
0x000a0| 04 | . | first_page: false 0xa8.6-0xa8.7 (0.1)
|
|
0x000a0| 04 | . | continued_packet: false 0xa8.7-0xa9 (0.1)
|
|
0x000a0| 9d 08 00 00 00 00 00| .......| granule_position: 2205 0xa9-0xb1 (8)
|
|
0x000b0|00 |. |
|
|
0x000b0| e1 52 bb 23 | .R.# | bitstream_serial_number: 599479009 0xb1-0xb5 (4)
|
|
0x000b0| 02 00 00 00 | .... | page_sequence_no: 2 0xb5-0xb9 (4)
|
|
0x000b0| 2a 3d 00 8e | *=.. | crc: 0x8e003d2a (valid) 0xb9-0xbd (4)
|
|
0x000b0| 04 | . | page_segments: 4 0xbd-0xbe (1)
|
|
| | | segment_table[0:4]: 0xbe-0xc2 (4)
|
|
0x000b0| ff | . | [0]: 255 segment_size 0xbe-0xbf (1)
|
|
0x000b0| ff| .| [1]: 255 segment_size 0xbf-0xc0 (1)
|
|
0x000c0|5c |\ | [2]: 92 segment_size 0xc0-0xc1 (1)
|
|
0x000c0| 00 | . | [3]: 0 segment_size 0xc1-0xc2 (1)
|
|
| | | segments[0:4]: 0xc2-0x31c (602)
|
|
0x000c0| ff f8 79 08 00 08 9c 14 4a 00 00 01 00 01| ..y.....J.....| [0]: raw bits segment 0xc2-0x1c1 (255)
|
|
0x000d0|ff 02 fd 03 f8 04 ee e7 32 5e 37 ca 2a f7 eb e7|........2^7.*...|
|
|
* |until 0x1c0.7 (255) | |
|
|
0x001c0| e4 ce 67 e4 f9 39 99 9c cc e4 93 92 49 c9 32| ..g..9......I.2| [1]: raw bits segment 0x1c1-0x2c0 (255)
|
|
0x001d0|64 99 99 86 72 67 26 61 3c c9 cf 99 e6 66 4f 3c|d...rg&a<....fO<|
|
|
* |until 0x2bf.7 (255) | |
|
|
0x002c0|69 92 4f 27 93 99 9c 99 92 64 f0 92 73 27 26 64|i.O'.....d..s'&d| [2]: raw bits segment 0x2c0-0x31c (92)
|
|
* |until 0x31b.7 (end) (92) | |
|
|
| | | [3]: raw bits segment 0x31c-0x31c (0)
|
|
| | | streams[0:1]: 0x4f-0x4f (0)
|
|
| | | [0]{}: stream 0x4f-0x4f (0)
|
|
| | | serial_number: 599479009
|
|
| | | packets[0:3]: 0x4f-0x4f (0)
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: packet 0x0-0x33 (51)
|
|
0x000|7f |. | type: 127 0x0-0x1 (1)
|
|
0x000| 46 4c 41 43 | FLAC | signature: "FLAC" 0x1-0x5 (4)
|
|
0x000| 01 | . | major: 1 0x5-0x6 (1)
|
|
0x000| 00 | . | minor: 0 0x6-0x7 (1)
|
|
0x000| 00 01 | .. | header_packets: 1 0x7-0x9 (2)
|
|
0x000| 66 4c 61 43 | fLaC | flac_signature: "fLaC" 0x9-0xd (4)
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| metadatablock{}: (flac_metadatablock) 0xd-0x33 (38)
|
|
0x000| 00 | . | last_block: false 0xd-0xd.1 (0.1)
|
|
0x000| 00 | . | type: "streaminfo" (0) 0xd.1-0xe (0.7)
|
|
0x000| 00 00| ..| length: 34 0xe-0x11 (3)
|
|
0x001|22 |" |
|
|
0x001| 12 00 | .. | minimum_block_size: 4608 0x11-0x13 (2)
|
|
0x001| 12 00 | .. | maximum_block_size: 4608 0x13-0x15 (2)
|
|
0x001| 00 00 00 | ... | minimum_frame_size: 0 0x15-0x18 (3)
|
|
0x001| 00 24 15 | .$. | maximum_frame_size: 9237 0x18-0x1b (3)
|
|
0x001| 0a c4 40 | ..@ | sample_rate: 44100 0x1b-0x1d.4 (2.4)
|
|
0x001| 40 | @ | channels: 1 0x1d.4-0x1d.7 (0.3)
|
|
0x001| 40 f0 | @. | bits_per_sample: 16 0x1d.7-0x1e.4 (0.5)
|
|
0x001| f0 00| ..| total_samples_in_stream: 0 0x1e.4-0x23 (4.4)
|
|
0x002|00 00 00 |... |
|
|
0x002| 00 00 00 00 00 00 00 00 00 00 00 00 00| .............| md5: "00000000000000000000000000000000" (raw bits) 0x23-0x33 (16)
|
|
0x003|00 00 00| |...| |
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: packet (flac_metadatablock) 0x0-0x38 (56)
|
|
0x000|84 |. | last_block: true 0x0-0x0.1 (0.1)
|
|
0x000|84 |. | type: "vorbis_comment" (4) 0x0.1-0x1 (0.7)
|
|
0x000| 00 00 34 | ..4 | length: 52 0x1-0x4 (3)
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| comment{}: (vorbis_comment) 0x4-0x38 (52)
|
|
0x000| 0d 00 00 00 | .... | vendor_length: 13 0x4-0x8 (4)
|
|
0x000| 4c 61 76 66 35 38 2e 37| Lavf58.7| vendor: "Lavf58.76.100" 0x8-0x15 (13)
|
|
0x001|36 2e 31 30 30 |6.100 |
|
|
0x001| 01 00 00 00 | .... | user_comment_list_length: 1 0x15-0x19 (4)
|
|
| | | user_comments[0:1]: 0x19-0x38 (31)
|
|
| | | [0]{}: user_comment 0x19-0x38 (31)
|
|
0x001| 1b 00 00 00 | .... | length: 27 0x19-0x1d (4)
|
|
0x001| 65 6e 63| enc| comment: "encoder=Lavc58.134.100 flac" 0x1d-0x38 (27)
|
|
0x002|6f 64 65 72 3d 4c 61 76 63 35 38 2e 31 33 34 2e|oder=Lavc58.134.|
|
|
0x003|31 30 30 20 66 6c 61 63| |100 flac| |
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: packet (flac_frame) 0x0-0x25a (602)
|
|
| | | header{}: 0x0-0x8 (8)
|
|
0x000|ff f8 |.. | sync: 0b11111111111110 (valid) 0x0-0x1.6 (1.6)
|
|
0x000| f8 | . | reserved0: 0 (valid) 0x1.6-0x1.7 (0.1)
|
|
0x000| f8 | . | blocking_strategy: "fixed" (0) 0x1.7-0x2 (0.1)
|
|
0x000| 79 | y | block_size: 0b111 (end of header (16 bit)) 0x2-0x2.4 (0.4)
|
|
0x000| 79 | y | sample_rate: 44100 (0b1001) 0x2.4-0x3 (0.4)
|
|
0x000| 08 | . | channel_assignment: 1 (0) (mono) 0x3-0x3.4 (0.4)
|
|
0x000| 08 | . | sample_size: 16 (0b100) 0x3.4-0x3.7 (0.3)
|
|
0x000| 08 | . | reserved1: 0 (valid) 0x3.7-0x4 (0.1)
|
|
| | | end_of_header{}: 0x4-0x7 (3)
|
|
0x000| 00 | . | frame_number: 0 0x4-0x5 (1)
|
|
0x000| 08 9c | .. | block_size: 2205 0x5-0x7 (2)
|
|
0x000| 14 | . | crc: 0x14 (valid) 0x7-0x8 (1)
|
|
| | | subframes[0:1]: 0x8-0x257.2 (591.2)
|
|
| | | [0]{}: subframe 0x8-0x257.2 (591.2)
|
|
0x000| 4a | J | zero_bit: 0 (valid) 0x8-0x8.1 (0.1)
|
|
0x000| 4a | J | subframe_type: "lpc" (0b100101) 0x8.1-0x8.7 (0.6)
|
|
| | | lpc_order: 6
|
|
0x000| 4a | J | wasted_bits_flag: 0 0x8.7-0x9 (0.1)
|
|
| | | subframe_sample_size: 16
|
|
| | | warmup_samples[0:6]: 0x9-0x15 (12)
|
|
0x000| 00 00 | .. | [0]: 0 value 0x9-0xb (2)
|
|
0x000| 01 00 | .. | [1]: 256 value 0xb-0xd (2)
|
|
0x000| 01 ff | .. | [2]: 511 value 0xd-0xf (2)
|
|
0x000| 02| .| [3]: 765 value 0xf-0x11 (2)
|
|
0x001|fd |. |
|
|
0x001| 03 f8 | .. | [4]: 1016 value 0x11-0x13 (2)
|
|
0x001| 04 ee | .. | [5]: 1262 value 0x13-0x15 (2)
|
|
0x001| e7 | . | precision: 15 0x15-0x15.4 (0.4)
|
|
0x001| e7 32 | .2 | shift: 14 0x15.4-0x16.1 (0.5)
|
|
| | | coefficients[0:6]: 0x16.1-0x21.3 (11.2)
|
|
0x001| 32 5e | 2^ | [0]: 12894 value 0x16.1-0x18 (1.7)
|
|
0x001| 37 ca | 7. | [1]: 7141 value 0x18-0x19.7 (1.7)
|
|
0x001| ca 2a f7 | .*. | [2]: 2749 value 0x19.7-0x1b.6 (1.7)
|
|
0x001| f7 eb e7 | ... | [3]: -644 value 0x1b.6-0x1d.5 (1.7)
|
|
0x001| e7 5d 3e| .]>| [4]: -2605 value 0x1d.5-0x1f.4 (1.7)
|
|
0x001| 3e| >| [5]: -3407 value 0x1f.4-0x21.3 (1.7)
|
|
0x002|56 20 |V |
|
|
0x002| 20 | | residual_coding_method: 4 (0) (rice) 0x21.3-0x21.5 (0.2)
|
|
0x002| 20 01 | . | partition_order: 0 0x21.5-0x22.1 (0.4)
|
|
| | | rice_partitions: 1
|
|
| | | partitions[0:1]: 0x22.1-0x257.2 (565.1)
|
|
| | | [0]{}: partition 0x22.1-0x257.2 (565.1)
|
|
| | | count: 2199
|
|
0x002| 01 | . | rice_parameter: 0 0x22.1-0x22.5 (0.4)
|
|
0x002| 01 39 24 ce 12 64 92 49 39 9e 73 84 d3 39| .9$..d.I9.s..9| samples: raw bits 0x22.5-0x257.2 (564.5)
|
|
0x003|2c ce 49 29 f3 e7 e6 4e 4f 27 84 93 92 72 72 4f|,.I)...NO'...rrO|
|
|
* |until 0x257.1 (565) | |
|
|
0x025| c0 | . | byte_align: 0 (valid) 0x257.2-0x258 (0.6)
|
|
0x025| 7b 66| | {f| | footer_crc: "7b66" (raw bits) (valid) 0x258-0x25a (2)
|