1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 09:56:07 +03:00
fq/pkg/interp/testdata/hexdump.fqtest
Mattias Wadman 051a70bd4b interp: Change bit ranges to use exclusive end
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.
2023-10-20 15:37:26 +02:00

12 lines
800 B
Plaintext

# ffmpeg -f lavfi -i sine -t 10ms test.mp3
$ fq -d mp3 '._bits[0:(16+8)*8] | hexdump' test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x00|49 44 33 04 00 00 00 00 00 23 54 53 53 45 00 00|ID3......#TSSE..|.: raw bits 0x0-0x18 (24)
0x10|00 0f 00 00 03 4c 61 76 |.....Lav |
$ fq -d mp3 '.frames[1].header.layer | hexdump' test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xe0| fb | . |.: raw bits 0xe4.5-0xe4.7 (0.2)
$ fq -d mp3 '.frames[1].header.layer._bytes | hexdump' test.mp3
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xe0| fb | . |.: raw bits 0xe4.5-0xe4.7 (0.2)