From f15f9bc1a438439977aaedaab45d52baceb76e9f Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Mon, 21 Aug 2023 09:37:44 +0200 Subject: [PATCH] doc,moc3,caff: Add author and regenerate docs --- README.md | 2 +- doc/formats.md | 10 +- doc/formats.svg | 2320 ++++++++++++++++++++++--------------------- format/caff/caff.go | 5 + format/caff/caff.md | 2 + format/moc3/moc3.go | 6 + format/moc3/moc3.md | 2 + 7 files changed, 1201 insertions(+), 1146 deletions(-) create mode 100644 format/caff/caff.md create mode 100644 format/moc3/moc3.md diff --git a/README.md b/README.md index e2f69fa3a..d8a778cd6 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ jsonl, macho_fat, [markdown](doc/formats.md#markdown), [matroska](doc/formats.md#matroska), -moc3, +[moc3](doc/formats.md#moc3), [mp3](doc/formats.md#mp3), mp3_frame, mp3_frame_vbri, diff --git a/doc/formats.md b/doc/formats.md index e266ae0b4..92129bb75 100644 --- a/doc/formats.md +++ b/doc/formats.md @@ -77,7 +77,7 @@ |`macho_fat` |Fat Mach-O macOS executable (multi-architecture) |`macho`| |[`markdown`](#markdown) |Markdown || |[`matroska`](#matroska) |Matroska file |`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`| -|`moc3` |MOC3 file || +|[`moc3`](#moc3) |MOC3 file || |[`mp3`](#mp3) |MP3 file |`id3v2` `id3v1` `id3v11` `apev2` `mp3_frame`| |`mp3_frame` |MPEG audio layer 3 frame |`mp3_frame_tags`| |`mp3_frame_vbri` |MP3 frame Fraunhofer encoder variable bitrate tag || @@ -510,6 +510,9 @@ Decode value as caff ... | caff({uncompress:true}) ``` +### Authors +- [@ronsor](https://github.com/ronsor) + ## cbor ### Convert represented value to JSON @@ -750,6 +753,11 @@ $ fq 'grep_by(.id == "Tracks") | matroska_path' file.mkv - https://www.matroska.org/technical/codec_specs.html - https://wiki.xiph.org/MatroskaOpus +## moc3 + +### Authors +- [@ronsor](https://github.com/ronsor) + ## mp3 ### Options diff --git a/doc/formats.svg b/doc/formats.svg index a2f063cd4..f2b3ef955 100644 --- a/doc/formats.svg +++ b/doc/formats.svg @@ -4,2136 +4,2168 @@ - - + + formats - + adts - -adts - -adts_frame + +adts + +adts_frame adts_frame - -adts_frame - -aac_frame + +adts_frame + +aac_frame adts:e->adts_frame:n - - + + aac_frame - -aac_frame + +aac_frame adts_frame:e->aac_frame:n - - + + apev2 - -apev2 - -image + +apev2 + +image image - -image + +image apev2:e->image:n - - + + - + jpeg - -jpeg - -exif - -icc_profile + +jpeg + +exif + +icc_profile - + image->jpeg:n - - + + - + mp4 - -mp4 - -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 + +mp4 + +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 - + image->mp4:n - - + + - + png - -png - -icc_profile - -exif + +png + +icc_profile + +exif - + image->png:n - - + + - + tiff - -tiff - -icc_profile + +tiff + +icc_profile - + image->tiff:n - - + + - + webp - -webp - -vp8_frame + +webp + +vp8_frame - + image->webp:n - - + + - + gif - -gif + +gif - + image->gif:n - - + + ar - -ar - -probe + +ar + +probe probe - -probe + +probe ar:e->probe:n - - + + - + probe->adts:n - - + + - + probe->ar:n - - + + avi - -avi - -avc_au - -hevc_au - -mp3_frame - -flac_frame + +avi + +avc_au + +hevc_au + +mp3_frame + +flac_frame - + probe->avi:n - - + + bitcoin_blkdat - -bitcoin_blkdat - -bitcoin_block + +bitcoin_blkdat + +bitcoin_block - + probe->bitcoin_blkdat:n - - + + bzip2 - -bzip2 - -probe + +bzip2 + +probe - + probe->bzip2:n - - + + + + + +caff + +caff + +probe + + + +probe->caff:n + + - + flac - -flac - -flac_metadatablocks - -flac_frame + +flac + +flac_metadatablocks + +flac_frame - + probe->flac:n - - + + - + gzip - -gzip - -probe + +gzip + +probe - + probe->gzip:n - - + + - + probe->jpeg:n - - + + - + macho_fat - -macho_fat - -macho + +macho_fat + +macho - + probe->macho_fat:n - - + + - + macho - -macho + +macho - + probe->macho:n - - + + - + matroska - -matroska - -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 + +matroska + +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 - + probe->matroska:n - - + + - + mp3 - -mp3 - -id3v2 - -id3v1 - -id3v11 - -apev2 - -mp3_frame + +mp3 + +id3v2 + +id3v1 + +id3v11 + +apev2 + +mp3_frame - + probe->mp3:n - - + + - + probe->mp4:n - - + + - + probe->png:n - - + + - + ogg - -ogg - -ogg_page - -vorbis_packet - -opus_packet - -flac_metadatablock - -flac_frame + +ogg + +ogg_page + +vorbis_packet + +opus_packet + +flac_metadatablock + +flac_frame - + probe->ogg:n - - + + - + pcap - -pcap - -link_frame - -tcp_stream - -ipv4_packet + +pcap + +link_frame + +tcp_stream + +ipv4_packet - + probe->pcap:n - - + + - + pcapng - -pcapng - -link_frame - -tcp_stream - -ipv4_packet + +pcapng + +link_frame + +tcp_stream + +ipv4_packet - + probe->pcapng:n - - + + - + tar - -tar - -probe + +tar + +probe - + probe->tar:n - - + + - + probe->tiff:n - - + + - + wav - -wav - -id3v2 - -id3v1 - -id3v11 + +wav + +id3v2 + +id3v1 + +id3v11 - + probe->wav:n - - + + - + probe->webp:n - - + + - + zip - -zip - -probe + +zip + +probe - + probe->zip:n - - + + - + aiff - -aiff + +aiff - + probe->aiff:n - - + + - + apple_bookmark - -apple_bookmark + +apple_bookmark - + probe->apple_bookmark:n - - + + - + avro_ocf - -avro_ocf + +avro_ocf - + probe->avro_ocf:n - - + + - + bplist - -bplist + +bplist - + probe->bplist:n - - + + - + elf - -elf + +elf - + probe->elf:n - - + + - + probe->gif:n - - + + - + html - -html + +html - + probe->html:n - - + + - + json - -json + +json - + probe->json:n - - + + - + jsonl - -jsonl + +jsonl - + probe->jsonl:n - - + + - + luajit - -luajit + +luajit - + probe->luajit:n - - + + + + + +moc3 + +moc3 + + + +probe->moc3:n + + - + mpeg_ts - -mpeg_ts + +mpeg_ts - + probe->mpeg_ts:n - - + + - + toml - -toml + +toml - + probe->toml:n - - + + - + tzif - -tzif + +tzif - + probe->tzif:n - - + + - + wasm - -wasm + +wasm - + probe->wasm:n - - + + - + xml - -xml + +xml - + probe->xml:n - - + + - + yaml - -yaml + +yaml - + probe->yaml:n - - + + av1_frame - -av1_frame - -av1_obu + +av1_frame + +av1_obu av1_obu - -av1_obu + +av1_obu av1_frame:e->av1_obu:n - - + + avc_annexb - -avc_annexb - -avc_nalu + +avc_annexb + +avc_nalu avc_nalu - -avc_nalu - -avc_sps - -avc_pps - -avc_sei + +avc_nalu + +avc_sps + +avc_pps + +avc_sei avc_annexb:e->avc_nalu:n - - + + avc_sps - -avc_sps + +avc_sps avc_nalu:e->avc_sps:n - - + + avc_pps - -avc_pps + +avc_pps avc_nalu:e->avc_pps:n - - + + avc_sei - -avc_sei + +avc_sei avc_nalu:e->avc_sei:n - - + + avc_au - -avc_au - -avc_nalu + +avc_au + +avc_nalu avc_au:e->avc_nalu:n - - + + avc_dcr - -avc_dcr - -avc_nalu + +avc_dcr + +avc_nalu avc_dcr:e->avc_nalu:n - - + + avi:e->avc_au:n - - + + hevc_au - -hevc_au - -hevc_nalu + +hevc_au + +hevc_nalu avi:e->hevc_au:n - - + + mp3_frame - -mp3_frame - -mp3_frame_tags + +mp3_frame + +mp3_frame_tags avi:e->mp3_frame:n - - + + flac_frame - -flac_frame + +flac_frame avi:e->flac_frame:n - - + + - + hevc_nalu - -hevc_nalu - -hevc_vps - -hevc_pps - -hevc_sps + +hevc_nalu + +hevc_vps + +hevc_pps + +hevc_sps - + hevc_au:e->hevc_nalu:n - - + + - + mp3_frame_tags - -mp3_frame_tags + +mp3_frame_tags - + mp3_frame:e->mp3_frame_tags:n - - + + bitcoin_block - -bitcoin_block - -bitcoin_transaction + +bitcoin_block + +bitcoin_transaction bitcoin_blkdat:e->bitcoin_block:n - - + + bitcoin_transaction - -bitcoin_transaction - -bitcoin_script + +bitcoin_transaction + +bitcoin_script bitcoin_block:e->bitcoin_transaction:n - - + + bitcoin_script - -bitcoin_script + +bitcoin_script bitcoin_transaction:e->bitcoin_script:n - - + + bsd_loopback_frame - -bsd_loopback_frame - -inet_packet + +bsd_loopback_frame + +inet_packet inet_packet - -inet_packet + +inet_packet bsd_loopback_frame:e->inet_packet:n - - + + - + ipv4_packet - -ipv4_packet - -ip_packet + +ipv4_packet + +ip_packet - + inet_packet->ipv4_packet:n - - + + - + ipv6_packet - -ipv6_packet - -ip_packet + +ipv6_packet + +ip_packet - + inet_packet->ipv6_packet:n - - + + bzip2:e->probe:n - - + + + + + +caff:e->probe:n + + - + ether8023_frame - -ether8023_frame - -inet_packet + +ether8023_frame + +inet_packet - + ether8023_frame:e->inet_packet:n - - + + - + flac:e->flac_frame:n - - + + - + flac_metadatablocks - -flac_metadatablocks - -flac_metadatablock + +flac_metadatablocks + +flac_metadatablock - + flac:e->flac_metadatablocks:n - - + + - + flac_metadatablock - -flac_metadatablock - -flac_streaminfo - -flac_picture - -vorbis_comment + +flac_metadatablock + +flac_streaminfo + +flac_picture + +vorbis_comment - + flac_metadatablocks:e->flac_metadatablock:n - - + + - + flac_streaminfo - -flac_streaminfo + +flac_streaminfo - + flac_metadatablock:e->flac_streaminfo:n - - + + - + flac_picture - -flac_picture - -image + +flac_picture + +image - + flac_metadatablock:e->flac_picture:n - - + + - + vorbis_comment - -vorbis_comment - -flac_picture + +vorbis_comment + +flac_picture - + flac_metadatablock:e->vorbis_comment:n - - + + - + flac_picture:e->image:n - - + + - + vorbis_comment:e->flac_picture:n - - + + - + gzip:e->probe:n - - + + - + hevc_annexb - -hevc_annexb - -hevc_nalu + +hevc_annexb + +hevc_nalu - + hevc_annexb:e->hevc_nalu:n - - + + - + hevc_vps - -hevc_vps + +hevc_vps - + hevc_nalu:e->hevc_vps:n - - + + - + hevc_pps - -hevc_pps + +hevc_pps - + hevc_nalu:e->hevc_pps:n - - + + - + hevc_sps - -hevc_sps + +hevc_sps - + hevc_nalu:e->hevc_sps:n - - + + - + hevc_dcr - -hevc_dcr - -hevc_nalu + +hevc_dcr + +hevc_nalu - + hevc_dcr:e->hevc_nalu:n - - + + - + id3v2 - -id3v2 - -image + +id3v2 + +image - + id3v2:e->image:n - - + + - + ip_packet - -ip_packet + +ip_packet - + ipv4_packet:e->ip_packet:n - - + + - + udp_datagram - -udp_datagram - -udp_payload + +udp_datagram + +udp_payload - + ip_packet->udp_datagram:n - - + + - + icmp - -icmp + +icmp - + ip_packet->icmp:n - - + + - + icmpv6 - -icmpv6 + +icmpv6 - + ip_packet->icmpv6:n - - + + - + tcp_segment - -tcp_segment + +tcp_segment - + ip_packet->tcp_segment:n - - + + - + ipv6_packet:e->ip_packet:n - - + + - + exif - -exif + +exif - + jpeg:e->exif:n - - + + - + icc_profile - -icc_profile + +icc_profile - + jpeg:e->icc_profile:n - - + + - + macho_fat:e->macho:n - - + + - + matroska:e->aac_frame:n - - + + - + matroska:e->image:n - - + + - + matroska:e->av1_frame:n - - + + - + matroska:e->avc_au:n - - + + - + matroska:e->avc_dcr:n - - + + - + matroska:e->hevc_au:n - - + + - + matroska:e->mp3_frame:n - - + + - + matroska:e->flac_frame:n - - + + - + matroska:e->flac_metadatablocks:n - - + + - + matroska:e->hevc_dcr:n - - + + - + av1_ccr - -av1_ccr + +av1_ccr - + matroska:e->av1_ccr:n - - + + - + mpeg_asc - -mpeg_asc + +mpeg_asc - + matroska:e->mpeg_asc:n - - + + - + mpeg_pes_packet - -mpeg_pes_packet + +mpeg_pes_packet - + matroska:e->mpeg_pes_packet:n - - + + - + mpeg_spu - -mpeg_spu + +mpeg_spu - + matroska:e->mpeg_spu:n - - + + - + opus_packet - -opus_packet - -vorbis_comment + +opus_packet + +vorbis_comment - + matroska:e->opus_packet:n - - + + - + vorbis_packet - -vorbis_packet - -vorbis_comment + +vorbis_packet + +vorbis_comment - + matroska:e->vorbis_packet:n - - + + - + vp8_frame - -vp8_frame + +vp8_frame - + matroska:e->vp8_frame:n - - + + - + vp9_cfm - -vp9_cfm + +vp9_cfm - + matroska:e->vp9_cfm:n - - + + - + vp9_frame - -vp9_frame + +vp9_frame - + matroska:e->vp9_frame:n - - + + - + opus_packet:e->vorbis_comment:n - - + + - + vorbis_packet:e->vorbis_comment:n - - + + - + mp3:e->apev2:n - - + + - + mp3:e->mp3_frame:n - - + + - + mp3:e->id3v2:n - - + + - + id3v1 - -id3v1 + +id3v1 - + mp3:e->id3v1:n - - + + - + id3v11 - -id3v11 + +id3v11 - + mp3:e->id3v11:n - - + + - + mp3_frame_vbri - -mp3_frame_vbri + +mp3_frame_vbri - + mp3_frame_tags->mp3_frame_vbri:n - - + + - + mp3_frame_xing - -mp3_frame_xing + +mp3_frame_xing - + mp3_frame_tags->mp3_frame_xing:n - - + + - + mp4:e->aac_frame:n - - + + - + mp4:e->image:n - - + + - + mp4:e->av1_frame:n - - + + - + mp4:e->avc_au:n - - + + - + mp4:e->avc_dcr:n - - + + - + mp4:e->hevc_au:n - - + + - + mp4:e->mp3_frame:n - - + + - + mp4:e->flac_frame:n - - + + - + mp4:e->flac_metadatablocks:n - - + + - + mp4:e->hevc_dcr:n - - + + - + mp4:e->id3v2:n - - + + - + mp4:e->jpeg:n - - + + - + mp4:e->icc_profile:n - - + + - + mp4:e->av1_ccr:n - - + + - + mp4:e->mpeg_pes_packet:n - - + + - + mp4:e->opus_packet:n - - + + - + mp4:e->vorbis_packet:n - - + + - + mp4:e->vp9_frame:n - - + + - + mpeg_es - -mpeg_es - -mpeg_asc - -vorbis_packet + +mpeg_es + +mpeg_asc + +vorbis_packet - + mp4:e->mpeg_es:n - - + + - + mp4:e->png:n - - + + - + prores_frame - -prores_frame + +prores_frame - + mp4:e->prores_frame:n - - + + - + protobuf_widevine - -protobuf_widevine - -protobuf + +protobuf_widevine + +protobuf - + mp4:e->protobuf_widevine:n - - + + - + pssh_playready - -pssh_playready + +pssh_playready - + mp4:e->pssh_playready:n - - + + - + vpx_ccr - -vpx_ccr + +vpx_ccr - + mp4:e->vpx_ccr:n - - + + - + mpeg_es:e->mpeg_asc:n - - + + - + mpeg_es:e->vorbis_packet:n - - + + - + png:e->exif:n - - + + - + png:e->icc_profile:n - - + + - + protobuf - -protobuf + +protobuf - + protobuf_widevine:e->protobuf:n - - + + - + mpeg_pes - -mpeg_pes - -mpeg_pes_packet - -mpeg_spu + +mpeg_pes + +mpeg_pes_packet + +mpeg_spu - + mpeg_pes:e->mpeg_pes_packet:n - - + + - + mpeg_pes:e->mpeg_spu:n - - + + - + ogg:e->flac_frame:n - - + + - + ogg:e->flac_metadatablock:n - - + + - + ogg:e->opus_packet:n - - + + - + ogg:e->vorbis_packet:n - - + + - + ogg_page - -ogg_page + +ogg_page - + ogg:e->ogg_page:n - - + + - + pcap:e->ipv4_packet:n - - + + - + link_frame - -link_frame + +link_frame - + pcap:e->link_frame:n - - + + - + tcp_stream - -tcp_stream + +tcp_stream - + pcap:e->tcp_stream:n - - + + - + link_frame->bsd_loopback_frame:n - - + + - + link_frame->ether8023_frame:n - - + + - + link_frame->ipv4_packet:n - - + + - + link_frame->ipv6_packet:n - - + + - + sll2_packet - -sll2_packet - -inet_packet + +sll2_packet + +inet_packet - + link_frame->sll2_packet:n - - + + - + sll_packet - -sll_packet - -inet_packet + +sll_packet + +inet_packet - + link_frame->sll_packet:n - - + + - + rtmp - -rtmp - -amf0 - -mpeg_asc + +rtmp + +amf0 + +mpeg_asc - + tcp_stream->rtmp:n - - + + - + tls - -tls - -asn1_ber + +tls + +asn1_ber - + tcp_stream->tls:n - - + + - + dns_tcp - -dns_tcp + +dns_tcp - + tcp_stream->dns_tcp:n - - + + - + pcapng:e->ipv4_packet:n - - + + - + pcapng:e->link_frame:n - - + + - + pcapng:e->tcp_stream:n - - + + - + rtmp:e->mpeg_asc:n - - + + - + amf0 - -amf0 + +amf0 - + rtmp:e->amf0:n - - + + - + sll2_packet:e->inet_packet:n - - + + - + sll_packet:e->inet_packet:n - - + + - + tar:e->probe:n - - + + - + tiff:e->icc_profile:n - - + + - + asn1_ber - -asn1_ber + +asn1_ber - + tls:e->asn1_ber:n - - + + - + udp_payload - -udp_payload + +udp_payload - + udp_datagram:e->udp_payload:n - - + + - + dns - -dns + +dns - + udp_payload->dns:n - - + + - + wav:e->id3v2:n - - + + - + wav:e->id3v1:n - - + + - + wav:e->id3v11:n - - + + - + webp:e->vp8_frame:n - - + + - + zip:e->probe:n - - + + - + bencode - -bencode + +bencode - + bits - -bits + +bits - + bson - -bson + +bson - + bytes - -bytes + +bytes - + cbor - -cbor + +cbor - + csv - -csv + +csv - + fairplay_spc - -fairplay_spc + +fairplay_spc - + markdown - -markdown + +markdown - + msgpack - -msgpack + +msgpack - + pg_btree - -pg_btree + +pg_btree - + pg_control - -pg_control + +pg_control - + pg_heap - -pg_heap + +pg_heap diff --git a/format/caff/caff.go b/format/caff/caff.go index 29bdee286..11f2f2273 100644 --- a/format/caff/caff.go +++ b/format/caff/caff.go @@ -3,6 +3,7 @@ package caff import ( "bytes" "compress/flate" + "embed" "io" "github.com/wader/fq/format" @@ -12,6 +13,9 @@ import ( "github.com/wader/fq/pkg/scalar" ) +//go:embed caff.md +var caffFS embed.FS + var probeGroup decode.Group func init() { @@ -28,6 +32,7 @@ func init() { {Groups: []*decode.Group{format.Probe}, Out: &probeGroup}, }, }) + interp.RegisterFS(caffFS) } const ( diff --git a/format/caff/caff.md b/format/caff/caff.md new file mode 100644 index 000000000..960b0dbee --- /dev/null +++ b/format/caff/caff.md @@ -0,0 +1,2 @@ +### Authors +- [@ronsor](https://github.com/ronsor) diff --git a/format/moc3/moc3.go b/format/moc3/moc3.go index adb3e15ae..453ec4b6a 100644 --- a/format/moc3/moc3.go +++ b/format/moc3/moc3.go @@ -3,12 +3,17 @@ package moc3 // https://github.com/OpenL2D/moc3ingbird/blob/master/src/moc3.hexpat import ( + "embed" + "github.com/wader/fq/format" "github.com/wader/fq/pkg/decode" "github.com/wader/fq/pkg/interp" "github.com/wader/fq/pkg/scalar" ) +//go:embed moc3.md +var moc3FS embed.FS + func init() { interp.RegisterFormat( format.MOC3, @@ -17,6 +22,7 @@ func init() { Groups: []*decode.Group{format.Probe}, DecodeFn: decodeMOC3, }) + interp.RegisterFS(moc3FS) } const ( diff --git a/format/moc3/moc3.md b/format/moc3/moc3.md new file mode 100644 index 000000000..960b0dbee --- /dev/null +++ b/format/moc3/moc3.md @@ -0,0 +1,2 @@ +### Authors +- [@ronsor](https://github.com/ronsor)