mirror of
https://github.com/wader/fq.git
synced 2024-11-26 10:33:53 +03:00
Merge pull request #525 from wader/mp3-tags-split-decoder
mp3_frame_tags: Covert to decode group and split to mp3_frame_{xing,v…
This commit is contained in:
commit
502e1e3059
@ -106,7 +106,8 @@ macho_fat,
|
||||
[matroska](doc/formats.md#matroska),
|
||||
[mp3](doc/formats.md#mp3),
|
||||
mp3_frame,
|
||||
mp3_frame_tags,
|
||||
mp3_frame_vbri,
|
||||
mp3_frame_xing,
|
||||
[mp4](doc/formats.md#mp4),
|
||||
mpeg_asc,
|
||||
mpeg_es,
|
||||
|
@ -76,7 +76,8 @@
|
||||
|[`matroska`](#matroska) |Matroska file |<sub>`aac_frame` `av1_ccr` `av1_frame` `avc_au` `avc_dcr` `flac_frame` `flac_metadatablocks` `hevc_au` `hevc_dcr` `image` `mp3_frame` `mpeg_asc` `mpeg_pes_packet` `mpeg_spu` `opus_packet` `vorbis_packet` `vp8_frame` `vp9_cfm` `vp9_frame`</sub>|
|
||||
|[`mp3`](#mp3) |MP3 file |<sub>`id3v2` `id3v1` `id3v11` `apev2` `mp3_frame`</sub>|
|
||||
|`mp3_frame` |MPEG audio layer 3 frame |<sub>`mp3_frame_tags`</sub>|
|
||||
|`mp3_frame_tags` |MP3 frame info/xing tags |<sub></sub>|
|
||||
|`mp3_frame_vbri` |MP3 frame Fraunhofer encoder variable bitrate tag |<sub></sub>|
|
||||
|`mp3_frame_xing` |MP3 frame Xing/Info tag |<sub></sub>|
|
||||
|[`mp4`](#mp4) |ISOBMFF, QuickTime and similar |<sub>`aac_frame` `av1_ccr` `av1_frame` `avc_au` `avc_dcr` `flac_frame` `flac_metadatablocks` `hevc_au` `hevc_dcr` `icc_profile` `id3v2` `image` `jpeg` `mp3_frame` `mpeg_es` `mpeg_pes_packet` `opus_packet` `png` `prores_frame` `protobuf_widevine` `pssh_playready` `vorbis_packet` `vp9_frame` `vpx_ccr`</sub>|
|
||||
|`mpeg_asc` |MPEG-4 Audio Specific Config |<sub></sub>|
|
||||
|`mpeg_es` |MPEG Elementary Stream |<sub>`mpeg_asc` `vorbis_packet`</sub>|
|
||||
@ -120,6 +121,7 @@
|
||||
|`inet_packet` |Group |<sub>`ipv4_packet` `ipv6_packet`</sub>|
|
||||
|`ip_packet` |Group |<sub>`icmp` `icmpv6` `tcp_segment` `udp_datagram`</sub>|
|
||||
|`link_frame` |Group |<sub>`bsd_loopback_frame` `ether8023_frame` `sll2_packet` `sll_packet`</sub>|
|
||||
|`mp3_frame_tags` |Group |<sub>`mp3_frame_vbri` `mp3_frame_xing`</sub>|
|
||||
|`probe` |Group |<sub>`adts` `apple_bookmark` `ar` `avi` `avro_ocf` `bitcoin_blkdat` `bplist` `bzip2` `elf` `flac` `gif` `gzip` `jpeg` `json` `jsonl` `macho` `macho_fat` `matroska` `mp3` `mp4` `mpeg_ts` `ogg` `pcap` `pcapng` `png` `tar` `tiff` `toml` `tzif` `wasm` `wav` `webp` `xml` `yaml` `zip`</sub>|
|
||||
|`tcp_stream` |Group |<sub>`dns_tcp` `rtmp`</sub>|
|
||||
|`udp_payload` |Group |<sub>`dns`</sub>|
|
||||
|
1794
doc/formats.svg
1794
doc/formats.svg
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 139 KiB |
@ -109,7 +109,8 @@ markdown Markdown
|
||||
matroska Matroska file
|
||||
mp3 MP3 file
|
||||
mp3_frame MPEG audio layer 3 frame
|
||||
mp3_frame_tags MP3 frame info/xing tags
|
||||
mp3_frame_vbri MP3 frame Fraunhofer encoder variable bitrate tag
|
||||
mp3_frame_xing MP3 frame Xing/Info tag
|
||||
mp4 ISOBMFF, QuickTime and similar
|
||||
mpeg_asc MPEG-4 Audio Specific Config
|
||||
mpeg_es MPEG Elementary Stream
|
||||
|
@ -14,13 +14,14 @@ const (
|
||||
const (
|
||||
ALL = "all"
|
||||
|
||||
IMAGE = "image"
|
||||
PROBE = "probe"
|
||||
LINK_FRAME = "link_frame" // ex: ethernet
|
||||
INET_PACKET = "inet_packet" // ex: ipv4
|
||||
IP_PACKET = "ip_packet" // ex: tcp
|
||||
TCP_STREAM = "tcp_stream" // ex: http
|
||||
UDP_PAYLOAD = "udp_payload" // ex: dns
|
||||
IMAGE = "image"
|
||||
PROBE = "probe"
|
||||
LINK_FRAME = "link_frame" // ex: ethernet
|
||||
INET_PACKET = "inet_packet" // ex: ipv4
|
||||
IP_PACKET = "ip_packet" // ex: tcp
|
||||
TCP_STREAM = "tcp_stream" // ex: http
|
||||
UDP_PAYLOAD = "udp_payload" // ex: dns
|
||||
MP3_FRAME_TAGS = "mp3_frame_tags"
|
||||
|
||||
BYTES = "bytes"
|
||||
BITS = "bits"
|
||||
@ -96,7 +97,8 @@ const (
|
||||
MATROSKA = "matroska"
|
||||
MP3 = "mp3"
|
||||
MP3_FRAME = "mp3_frame"
|
||||
MP3_FRAME_TAGS = "mp3_frame_tags"
|
||||
MP3_FRAME_XING = "mp3_frame_xing"
|
||||
MP3_FRAME_VBRI = "mp3_frame_vbri"
|
||||
MP4 = "mp4"
|
||||
MPEG_ASC = "mpeg_asc"
|
||||
MPEG_ES = "mpeg_es"
|
||||
|
39
format/mp3/mp3_tag_vbri.go
Normal file
39
format/mp3/mp3_tag_vbri.go
Normal file
@ -0,0 +1,39 @@
|
||||
package mp3
|
||||
|
||||
// https://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
func init() {
|
||||
interp.RegisterFormat(decode.Format{
|
||||
Name: format.MP3_FRAME_VBRI,
|
||||
Description: "MP3 frame Fraunhofer encoder variable bitrate tag",
|
||||
Groups: []string{format.MP3_FRAME_TAGS},
|
||||
DecodeFn: mp3FrameTagVBRIDecode,
|
||||
})
|
||||
}
|
||||
|
||||
func mp3FrameTagVBRIDecode(d *decode.D, _ any) any {
|
||||
d.FieldUTF8("header", 4, d.StrAssert("VBRI"))
|
||||
d.FieldU16("version_id")
|
||||
d.FieldU16("delay")
|
||||
d.FieldU16("quality")
|
||||
d.FieldU32("length", scalar.UintDescription("Number of bytes"))
|
||||
d.FieldU32("frames", scalar.UintDescription("Number of frames"))
|
||||
tocEntries := d.FieldU16("toc_entries", scalar.UintDescription("Number of entries within TOC table"))
|
||||
d.FieldU16("scale_factor", scalar.UintDescription("Scale factor of TOC table entries"))
|
||||
tocEntrySize := d.FieldU16("toc_entry_size", d.UintAssert(1, 2, 3, 4), scalar.UintDescription("Size per table entry"))
|
||||
d.FieldU16("frame_per_entry", scalar.UintDescription("Frames per table entry"))
|
||||
d.FieldArray("toc", func(d *decode.D) {
|
||||
for i := 0; i < int(tocEntries); i++ {
|
||||
d.FieldU("entry", int(tocEntrySize)*8)
|
||||
}
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
73
format/mp3/mp3_tag_xing.go
Normal file
73
format/mp3/mp3_tag_xing.go
Normal file
@ -0,0 +1,73 @@
|
||||
package mp3
|
||||
|
||||
// https://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header
|
||||
// http://gabriel.mp3-tech.org/mp3infotag.html
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mp3dec.c
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
)
|
||||
|
||||
func init() {
|
||||
interp.RegisterFormat(decode.Format{
|
||||
Name: format.MP3_FRAME_XING,
|
||||
Description: "MP3 frame Xing/Info tag",
|
||||
Groups: []string{format.MP3_FRAME_TAGS},
|
||||
DecodeFn: mp3FrameTagXingDecode,
|
||||
})
|
||||
}
|
||||
|
||||
func mp3FrameTagXingDecode(d *decode.D, _ any) any {
|
||||
d.FieldUTF8("header", 4, d.StrAssert("Xing", "Info"))
|
||||
qualityPresent := false
|
||||
tocPresent := false
|
||||
bytesPresent := false
|
||||
framesPresent := false
|
||||
d.FieldStruct("present_flags", func(d *decode.D) {
|
||||
d.FieldU("unused", 28)
|
||||
qualityPresent = d.FieldBool("quality")
|
||||
tocPresent = d.FieldBool("toc")
|
||||
bytesPresent = d.FieldBool("bytes")
|
||||
framesPresent = d.FieldBool("frames")
|
||||
})
|
||||
|
||||
if framesPresent {
|
||||
d.FieldU32BE("frames")
|
||||
}
|
||||
if bytesPresent {
|
||||
d.FieldU32BE("bytes")
|
||||
}
|
||||
if tocPresent {
|
||||
d.FieldArray("toc", func(d *decode.D) {
|
||||
for i := 0; i < 100; i++ {
|
||||
d.FieldU8("entry")
|
||||
}
|
||||
})
|
||||
}
|
||||
if qualityPresent {
|
||||
d.FieldU32BE("quality")
|
||||
}
|
||||
|
||||
d.FieldUTF8("encoder", 9)
|
||||
d.FieldU4("tag_revision")
|
||||
d.FieldU4("vbr_method")
|
||||
d.FieldU8("lowpass_filter") // TODO: /100
|
||||
d.FieldU32("replay_gain_peak")
|
||||
d.FieldU16("radio_replay_gain")
|
||||
d.FieldU16("audiophile_replay_gain")
|
||||
d.FieldU4("lame_flags")
|
||||
d.FieldU4("lame_ath_type")
|
||||
d.FieldU8("abr_vbr") // TODO:
|
||||
d.FieldU12("encoder_delay") // TODO:
|
||||
d.FieldU12("encoder_padding") // TODO:
|
||||
d.FieldU8("misc") // TODO:
|
||||
d.FieldU8("mp3_gain") // TODO:
|
||||
d.FieldU16("preset") // TODO:
|
||||
d.FieldU32("length")
|
||||
d.FieldU16("music_crc") // TODO:
|
||||
d.FieldU16("tag_crc") // TODO:
|
||||
|
||||
return nil
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
package mp3
|
||||
|
||||
// https://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header
|
||||
// http://gabriel.mp3-tech.org/mp3infotag.html
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mp3dec.c
|
||||
|
||||
import (
|
||||
"github.com/wader/fq/format"
|
||||
"github.com/wader/fq/pkg/decode"
|
||||
"github.com/wader/fq/pkg/interp"
|
||||
"github.com/wader/fq/pkg/scalar"
|
||||
)
|
||||
|
||||
func init() {
|
||||
interp.RegisterFormat(decode.Format{
|
||||
Name: format.MP3_FRAME_TAGS,
|
||||
Description: "MP3 frame info/xing tags",
|
||||
DecodeFn: mp3FrameTagsDecode,
|
||||
})
|
||||
}
|
||||
|
||||
var headerUintDescription = scalar.StrMapDescription{
|
||||
"Xing": "XING variable bitrate",
|
||||
"Info": "XING variable bitrate",
|
||||
"VBRI": "Fraunhofer Encoder variable bitrate info",
|
||||
}
|
||||
|
||||
func mp3FrameTagsDecode(d *decode.D, _ any) any {
|
||||
switch d.FieldUTF8("header", 4, headerUintDescription) {
|
||||
case "Xing",
|
||||
"Info":
|
||||
qualityPresent := false
|
||||
tocPresent := false
|
||||
bytesPresent := false
|
||||
framesPresent := false
|
||||
d.FieldStruct("present_flags", func(d *decode.D) {
|
||||
d.FieldU("unused", 28)
|
||||
qualityPresent = d.FieldBool("quality")
|
||||
tocPresent = d.FieldBool("toc")
|
||||
bytesPresent = d.FieldBool("bytes")
|
||||
framesPresent = d.FieldBool("frames")
|
||||
})
|
||||
|
||||
if framesPresent {
|
||||
d.FieldU32BE("frames")
|
||||
}
|
||||
if bytesPresent {
|
||||
d.FieldU32BE("bytes")
|
||||
}
|
||||
if tocPresent {
|
||||
d.FieldArray("toc", func(d *decode.D) {
|
||||
for i := 0; i < 100; i++ {
|
||||
d.FieldU8("entry")
|
||||
}
|
||||
})
|
||||
}
|
||||
if qualityPresent {
|
||||
d.FieldU32BE("quality")
|
||||
}
|
||||
|
||||
d.FieldUTF8("encoder", 9)
|
||||
d.FieldU4("tag_revision")
|
||||
d.FieldU4("vbr_method")
|
||||
d.FieldU8("lowpass_filter") // TODO: /100
|
||||
d.FieldU32("replay_gain_peak")
|
||||
d.FieldU16("radio_replay_gain")
|
||||
d.FieldU16("audiophile_replay_gain")
|
||||
d.FieldU4("lame_flags")
|
||||
d.FieldU4("lame_ath_type")
|
||||
d.FieldU8("abr_vbr") // TODO:
|
||||
d.FieldU12("encoder_delay") // TODO:
|
||||
d.FieldU12("encoder_padding") // TODO:
|
||||
d.FieldU8("misc") // TODO:
|
||||
d.FieldU8("mp3_gain") // TODO:
|
||||
d.FieldU16("preset") // TODO:
|
||||
d.FieldU32("length")
|
||||
d.FieldU16("music_crc") // TODO:
|
||||
d.FieldU16("tag_crc") // TODO:
|
||||
case "VBRI":
|
||||
d.FieldU16("version_id")
|
||||
d.FieldU16("delay")
|
||||
d.FieldU16("quality")
|
||||
d.FieldU32("length", scalar.UintDescription("Number of bytes"))
|
||||
d.FieldU32("frames", scalar.UintDescription("Number of frames"))
|
||||
tocEntries := d.FieldU16("toc_entries", scalar.UintDescription("Number of entries within TOC table"))
|
||||
d.FieldU16("scale_factor", scalar.UintDescription("Scale factor of TOC table entries"))
|
||||
tocEntrySize := d.FieldU16("toc_entry_size", d.UintAssert(1, 2, 3, 4), scalar.UintDescription("Size per table entry"))
|
||||
d.FieldU16("frame_per_entry", scalar.UintDescription("Frames per table entry"))
|
||||
d.FieldArray("toc", func(d *decode.D) {
|
||||
for i := 0; i < int(tocEntries); i++ {
|
||||
d.FieldU("entry", int(tocEntrySize)*8)
|
||||
}
|
||||
})
|
||||
default:
|
||||
d.Errorf("no vbri, info or xing header found")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -f mp3 temp.mp3 && fq temp.mp3 '.frames[0].tag | tobits' > mp3_frame_tags_info
|
||||
$ fq -d mp3_frame_tags dv mp3_frame_tags_info
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_tags_info (mp3_frame_tags) 0x0-0x9b.7 (156)
|
||||
0x00|49 6e 66 6f |Info | header: "Info" (XING variable bitrate) 0x0-0x3.7 (4)
|
||||
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -f mp3 temp.mp3 && fq temp.mp3 '.frames[0].tag | tobits' > mp3_frame_info
|
||||
$ fq -d mp3_frame_xing dv mp3_frame_info
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_info (mp3_frame_xing) 0x0-0x9b.7 (156)
|
||||
0x00|49 6e 66 6f |Info | header: "Info" (valid) 0x0-0x3.7 (4)
|
||||
| | | present_flags{}: 0x4-0x7.7 (4)
|
||||
0x00| 00 00 00 0f | .... | unused: 0 0x4-0x7.3 (3.4)
|
||||
0x00| 0f | . | quality: true 0x7.4-0x7.4 (0.1)
|
@ -1,6 +1,6 @@
|
||||
$ fq -d mp3_frame_tags dv mp3_frame_tags_vbri
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_tags_vbri (mp3_frame_tags) 0x0-0x11f.7 (288)
|
||||
0x000|56 42 52 49 |VBRI | header: "VBRI" (Fraunhofer Encoder variable bitrate info) 0x0-0x3.7 (4)
|
||||
$ fq -d mp3_frame_vbri dv mp3_frame_vbri
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_vbri (mp3_frame_vbri) 0x0-0x11f.7 (288)
|
||||
0x000|56 42 52 49 |VBRI | header: "VBRI" (valid) 0x0-0x3.7 (4)
|
||||
0x000| 00 01 | .. | version_id: 1 0x4-0x5.7 (2)
|
||||
0x000| 09 31 | .1 | delay: 2353 0x6-0x7.7 (2)
|
||||
0x000| 00 64 | .d | quality: 100 0x8-0x9.7 (2)
|
@ -1,7 +1,7 @@
|
||||
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -qscale:a 2 -f mp3 temp.mp3 && fq temp.mp3 '.frames[0].tag | tobits' > mp3_frame_tags_xing
|
||||
$ fq -d mp3_frame_tags dv mp3_frame_tags_xing
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_tags_xing (mp3_frame_tags) 0x0-0x9b.7 (156)
|
||||
0x00|58 69 6e 67 |Xing | header: "Xing" (XING variable bitrate) 0x0-0x3.7 (4)
|
||||
# ffmpeg -y -f lavfi -i sine -ac 2 -t 10ms -qscale:a 2 -f mp3 temp.mp3 && fq temp.mp3 '.frames[0].tag | tobits' > mp3_frame_xing
|
||||
$ fq -d mp3_frame_xing dv mp3_frame_xing
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: mp3_frame_xing (mp3_frame_xing) 0x0-0x9b.7 (156)
|
||||
0x00|58 69 6e 67 |Xing | header: "Xing" (valid) 0x0-0x3.7 (4)
|
||||
| | | present_flags{}: 0x4-0x7.7 (4)
|
||||
0x00| 00 00 00 0f | .... | unused: 0 0x4-0x7.3 (3.4)
|
||||
0x00| 0f | . | quality: true 0x7.4-0x7.4 (0.1)
|
24
pkg/interp/testdata/display.fqtest
vendored
24
pkg/interp/testdata/display.fqtest
vendored
@ -61,7 +61,7 @@ mp3> .frames[0] | dv({depth: 1, addrbase: 10})
|
||||
048| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info{}: 49-65.7 (17)
|
||||
064|00 00 |.. |
|
||||
|00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15|0123456789012345|
|
||||
064| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_tags) 66-221.7 (156)
|
||||
064| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_xing) 66-221.7 (156)
|
||||
080|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
|
||||
* |until 221.7 (156) | |
|
||||
208| 00 00| ..| audio_data: raw bits 222-226.7 (5)
|
||||
@ -74,7 +74,7 @@ mp3> .frames[0] | dv({depth: 1, sizebase: 16})
|
||||
0x30| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info{}: 0x31-0x41.7 (0x11)
|
||||
0x40|00 00 |.. |
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x40| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_tags) 0x42-0xdd.7 (0x9c)
|
||||
0x40| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_xing) 0x42-0xdd.7 (0x9c)
|
||||
0x50|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
|
||||
* |until 0xdd.7 (0x9c) | |
|
||||
0xd0| 00 00| ..| audio_data: raw bits 0xde-0xe2.7 (0x5)
|
||||
@ -82,8 +82,8 @@ mp3> .frames[0] | dv({depth: 1, sizebase: 16})
|
||||
| | | crc_calculated: "827a" (raw bits) 0xe3-NA (0x0)
|
||||
mp3> .frames[0].tag | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv
|
||||
"d"
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_tags)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (XING variable bitrate)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_xing)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (valid)
|
||||
| | | present_flags{}:
|
||||
0x40| 00 00 00 0f | .... | unused: 0
|
||||
0x40| 0f | . | quality: true
|
||||
@ -167,8 +167,8 @@ mp3> .frames[0].tag | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv
|
||||
0xd0| 62 f0 | b. | music_crc: 25328
|
||||
0xd0| 5a 35 | Z5 | tag_crc: 23093
|
||||
"da"
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_tags)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (XING variable bitrate)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_xing)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (valid)
|
||||
| | | present_flags{}:
|
||||
0x40| 00 00 00 0f | .... | unused: 0
|
||||
0x40| 0f | . | quality: true
|
||||
@ -301,8 +301,8 @@ mp3> .frames[0].tag | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv
|
||||
0xd0| 62 f0 | b. | music_crc: 25328
|
||||
0xd0| 5a 35 | Z5 | tag_crc: 23093
|
||||
"dd"
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_tags)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (XING variable bitrate)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_xing)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (valid)
|
||||
| | | present_flags{}:
|
||||
0x40| 00 00 00 0f | .... | unused: 0
|
||||
0x40| 0f | . | quality: true
|
||||
@ -435,8 +435,8 @@ mp3> .frames[0].tag | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv
|
||||
0xd0| 62 f0 | b. | music_crc: 25328
|
||||
0xd0| 5a 35 | Z5 | tag_crc: 23093
|
||||
"dv"
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_tags) 0x42-0xdd.7 (156)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (XING variable bitrate) 0x42-0x45.7 (4)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_xing) 0x42-0xdd.7 (156)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (valid) 0x42-0x45.7 (4)
|
||||
| | | present_flags{}: 0x46-0x49.7 (4)
|
||||
0x40| 00 00 00 0f | .... | unused: 0 0x46-0x49.3 (3.4)
|
||||
0x40| 0f | . | quality: true 0x49.4-0x49.4 (0.1)
|
||||
@ -569,8 +569,8 @@ mp3> .frames[0].tag | "d", d, "da", da, "dd", dd, "dv", dv, "ddv", ddv
|
||||
0xd0| 62 f0 | b. | music_crc: 25328 0xda-0xdb.7 (2)
|
||||
0xd0| 5a 35 | Z5 | tag_crc: 23093 0xdc-0xdd.7 (2)
|
||||
"ddv"
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_tags) 0x42-0xdd.7 (156)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (XING variable bitrate) 0x42-0x45.7 (4)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.frames[0].tag{}: (mp3_frame_xing) 0x42-0xdd.7 (156)
|
||||
0x40| 49 6e 66 6f | Info | header: "Info" (valid) 0x42-0x45.7 (4)
|
||||
| | | present_flags{}: 0x46-0x49.7 (4)
|
||||
0x40| 00 00 00 0f | .... | unused: 0 0x46-0x49.3 (3.4)
|
||||
0x40| 0f | . | quality: true 0x49.4-0x49.4 (0.1)
|
||||
|
6
pkg/interp/testdata/grep.fqtest
vendored
6
pkg/interp/testdata/grep.fqtest
vendored
@ -17,7 +17,7 @@ mp3> grep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x44
|
||||
|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" (valid)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (XING variable bitrate)
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (valid)
|
||||
|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" (valid)
|
||||
mp3> vgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x44])
|
||||
@ -34,7 +34,7 @@ mp3> vgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x4
|
||||
|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" (valid)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (XING variable bitrate)
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (valid)
|
||||
mp3> fgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x44])
|
||||
|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" (valid)
|
||||
@ -50,7 +50,7 @@ mp3> bgrep(44100, "ID", "^ID3$", "^ID.?$", "Info", "magic", "\u00ff", [0x49, 0x4
|
||||
|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" (valid)
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (XING variable bitrate)
|
||||
0x40| 49 6e 66 6f | Info |.frames[0].tag.header: "Info" (valid)
|
||||
|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" (valid)
|
||||
mp3> "64ff65ff66" | fromhex | bgrep("\u00ff"; "b")
|
||||
|
2
pkg/interp/testdata/slurp.fqtest
vendored
2
pkg/interp/testdata/slurp.fqtest
vendored
@ -94,7 +94,7 @@ mp3> $f[]
|
||||
0x30| 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00| ...............| side_info{}:
|
||||
0x40|00 00 |.. |
|
||||
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
||||
0x40| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_tags)
|
||||
0x40| 49 6e 66 6f 00 00 00 0f 00 00 00 02 00 00| Info..........| tag{}: (mp3_frame_xing)
|
||||
0x50|02 57 00 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6|.W..............|
|
||||
* |until 0xdd.7 (156) | |
|
||||
0xd0| 00 00| ..| audio_data: raw bits
|
||||
|
Loading…
Reference in New Issue
Block a user