mirror of
https://github.com/wader/fq.git
synced 2024-11-22 15:45:45 +03:00
doc: Move formats to own file
This commit is contained in:
parent
31d7611f55
commit
242525f8de
10
Makefile
10
Makefile
@ -34,9 +34,13 @@ testcli:
|
||||
@pkg/cli/test.sh pkg/cli/test.exp
|
||||
|
||||
.PHONY: doc
|
||||
doc: doc/file.mp3 doc/file.mp4
|
||||
doc: doc/file.mp3 doc/file.mp4 doc/formats.svg
|
||||
@doc/mdsh.sh *.md doc/*.md
|
||||
|
||||
.PHONY: doc/formats.svg
|
||||
doc/formats.svg:
|
||||
doc/formats_diagram.jq | dot -Tsvg -o doc/formats.svg
|
||||
|
||||
doc/file.mp3: Makefile
|
||||
ffmpeg -y -f lavfi -i sine -f lavfi -i testsrc -map 0:0 -map 1:0 -t 20ms "$@"
|
||||
|
||||
@ -56,10 +60,6 @@ lint:
|
||||
depgraph.svg:
|
||||
go run github.com/kisielk/godepgraph@latest github.com/wader/fq | dot -Tsvg -o godepgraph.svg
|
||||
|
||||
.PHONY: formats.svg
|
||||
formats.svg:
|
||||
dev/formats_dot.jq | dot -Tsvg -o formats.svg
|
||||
|
||||
# make memprof ARGS=". test.mp3"
|
||||
# make cpuprof ARGS=". test.mp3"
|
||||
.PHONY: prof
|
||||
|
23
README.md
23
README.md
@ -48,7 +48,7 @@ file.png: PNG image data, 320 x 240, 8-bit/color RGB, non-interlaced
|
||||
- Make structured binary data accessible.
|
||||
- Nested formats and bit-oriented decoding.
|
||||
- Quick CLI tool that mimics jq as much as possible.
|
||||
- Do bits and bytes transformation and conversions.
|
||||
- Do bit and byte transformations and conversions.
|
||||
- Programmer's calculator.
|
||||
|
||||
**NOTE:** fq is early in development and many things are missing, broken or do not make sense. That also means there is a great opportunity to help out.
|
||||
@ -67,12 +67,24 @@ brew install wader/tap/fq
|
||||
|
||||
### Build from source
|
||||
|
||||
Make sure you have go 1.17 or later and then do:
|
||||
Make sure you have go 1.17 or later installed.
|
||||
|
||||
To install directly from git repository do:
|
||||
```sh
|
||||
# build and install latest master
|
||||
# build and install latest release
|
||||
go install github.com/wader/fq@latest
|
||||
# or build and install latest master
|
||||
go install github.com/wader/fq@master
|
||||
# copy binary to $PATH if needed
|
||||
cp "$(go env GOPATH)/bin/fq" /usr/local/bin
|
||||
```
|
||||
|
||||
To build and run tests from source directory:
|
||||
```sh
|
||||
make test fq
|
||||
# copy binary to $PATH if needed
|
||||
cp fq /usr/local/bin
|
||||
```
|
||||
and the binary should end up at `$GOPATH/bin/fq`.
|
||||
|
||||
## Usage
|
||||
|
||||
@ -94,8 +106,7 @@ aac_frame, adts, adts_frame, apev2, av1_ccr, av1_frame, av1_obu, avc_annexb, avc
|
||||
|
||||
[#]: sh-end
|
||||
|
||||
|
||||
For more format details see [usage.md](doc/usage.md).
|
||||
See [formats](doc/formats.md) for more details.
|
||||
|
||||
## TODO and ideas
|
||||
|
||||
|
75
doc/formats.md
Normal file
75
doc/formats.md
Normal file
@ -0,0 +1,75 @@
|
||||
## Supported formats
|
||||
|
||||
[./formats_table.jq]: sh-start
|
||||
|
||||
|Name |Description |Uses|
|
||||
|- |- |-|
|
||||
|`aac_frame` |Advanced Audio Coding frame |<sub></sub>|
|
||||
|`adts` |Audio Data Transport Stream |<sub>`adts_frame`</sub>|
|
||||
|`adts_frame` |Audio Data Transport Stream frame |<sub>`aac_frame`</sub>|
|
||||
|`apev2` |APEv2 metadata tag |<sub>`image`</sub>|
|
||||
|`av1_ccr` |AV1 Codec Configuration Record |<sub></sub>|
|
||||
|`av1_frame` |AV1 frame |<sub>`av1_obu`</sub>|
|
||||
|`av1_obu` |AV1 Open Bitstream Unit |<sub></sub>|
|
||||
|`avc_annexb` |H.264/AVC Annex B |<sub>`avc_nalu`</sub>|
|
||||
|`avc_au` |H.264/AVC Access Unit |<sub>`avc_nalu`</sub>|
|
||||
|`avc_dcr` |H.264/AVC Decoder Configuration Record |<sub>`avc_nalu`</sub>|
|
||||
|`avc_nalu` |H.264/AVC Network Access Layer Unit |<sub>`avc_sps` `avc_pps` `avc_sei`</sub>|
|
||||
|`avc_pps` |H.264/AVC Picture Parameter Set |<sub></sub>|
|
||||
|`avc_sei` |H.264/AVC Supplemental Enhancement Information |<sub></sub>|
|
||||
|`avc_sps` |H.264/AVC Sequence Parameter Set |<sub></sub>|
|
||||
|`bzip2` |bzip2 compression |<sub>`probe`</sub>|
|
||||
|`dns` |DNS packet |<sub></sub>|
|
||||
|`elf` |Executable and Linkable Format |<sub></sub>|
|
||||
|`exif` |Exchangeable Image File Format |<sub></sub>|
|
||||
|`flac` |Free Lossless Audio Codec file |<sub>`flac_metadatablocks` `flac_frame`</sub>|
|
||||
|`flac_frame` |FLAC frame |<sub></sub>|
|
||||
|`flac_metadatablocks` |FLAC metadatablocks |<sub>`flac_picture` `vorbis_comment`</sub>|
|
||||
|`flac_picture` |FLAC metadatablock picture |<sub>`image`</sub>|
|
||||
|`gif` |Graphics Interchange Format |<sub></sub>|
|
||||
|`gzip` |gzip compression |<sub>`probe`</sub>|
|
||||
|`hevc_annexb` |H.265/HEVC Annex B |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_au` |H.265/HEVC Access Unit |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_dcr` |H.265/HEVC Decoder Configuration Record |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_nalu` |H.265/HEVC Network Access Layer Unit |<sub></sub>|
|
||||
|`icc_profile` |International Color Consortium profile |<sub></sub>|
|
||||
|`id3v1` |ID3v1 metadata |<sub></sub>|
|
||||
|`id3v11` |ID3v1.1 metadata |<sub></sub>|
|
||||
|`id3v2` |ID3v2 metadata |<sub>`image`</sub>|
|
||||
|`jpeg` |Joint Photographic Experts Group file |<sub>`exif` `icc_profile`</sub>|
|
||||
|`json` |JSON |<sub></sub>|
|
||||
|`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 file |<sub>`id3v2` `id3v1` `id3v11` `apev2` `mp3_frame`</sub>|
|
||||
|`mp3_frame` |MPEG audio layer 3 frame |<sub>`xing`</sub>|
|
||||
|`mp4` |MPEG-4 file and similar |<sub>`aac_frame` `av1_ccr` `av1_frame` `flac_frame` `flac_metadatablocks` `id3v2` `image` `jpeg` `mp3_frame` `avc_au` `avc_dcr` `mpeg_es` `hevc_au` `hevc_dcr` `mpeg_pes_packet` `opus_packet` `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>|
|
||||
|`mpeg_pes` |MPEG Packetized elementary stream |<sub>`mpeg_pes_packet` `mpeg_spu`</sub>|
|
||||
|`mpeg_pes_packet` |MPEG Packetized elementary stream packet |<sub></sub>|
|
||||
|`mpeg_spu` |Sub Picture Unit (DVD subtitle) |<sub></sub>|
|
||||
|`mpeg_ts` |MPEG Transport Stream |<sub></sub>|
|
||||
|`ogg` |OGG file |<sub>`ogg_page` `vorbis_packet` `opus_packet`</sub>|
|
||||
|`ogg_page` |OGG page |<sub></sub>|
|
||||
|`opus_packet` |Opus packet |<sub>`vorbis_comment`</sub>|
|
||||
|`png` |Portable Network Graphics file |<sub>`icc_profile` `exif`</sub>|
|
||||
|`protobuf` |Protobuf |<sub></sub>|
|
||||
|`protobuf_widevine` |Widevine protobuf |<sub>`protobuf`</sub>|
|
||||
|`pssh_playready` |PlayReady PSSH |<sub></sub>|
|
||||
|`raw` |Raw bits |<sub></sub>|
|
||||
|`tar` |Tar archive |<sub>`probe`</sub>|
|
||||
|`tiff` |Tag Image File Format |<sub>`icc_profile`</sub>|
|
||||
|`vorbis_comment` |Vorbis comment |<sub>`flac_picture`</sub>|
|
||||
|`vorbis_packet` |Vorbis packet |<sub>`vorbis_comment`</sub>|
|
||||
|`vp8_frame` |VP8 frame |<sub></sub>|
|
||||
|`vp9_cfm` |VP9 Codec Feature Metadata |<sub></sub>|
|
||||
|`vp9_frame` |VP9 frame |<sub></sub>|
|
||||
|`vpx_ccr` |VPX Codec Configuration Record |<sub></sub>|
|
||||
|`wav` |WAV file |<sub>`id3v2` `id3v1` `id3v11`</sub>|
|
||||
|`webp` |WebP image |<sub>`vp8_frame`</sub>|
|
||||
|`xing` |Xing header |<sub></sub>|
|
||||
|`image` |Group |<sub>`gif` `jpeg` `png` `tiff` `webp`</sub>|
|
||||
|`probe` |Group |<sub>`adts` `bzip2` `elf` `flac` `gif` `gzip` `jpeg` `json` `matroska` `mp3` `mp4` `mpeg_ts` `ogg` `png` `tar` `tiff` `wav` `webp`</sub>|
|
||||
|
||||
[#]: sh-end
|
||||
|
||||
![alt text](formats.svg "Format diagram")
|
1246
doc/formats.svg
Normal file
1246
doc/formats.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 79 KiB |
80
doc/usage.md
80
doc/usage.md
@ -39,6 +39,10 @@ mp3> .frames[0] | repl
|
||||
|
||||
Use Ctrl-C to exits REPL, Ctrl-C to interrupt current evaluation.
|
||||
|
||||
## Support formats
|
||||
|
||||
See [formats](formats.md)
|
||||
|
||||
### Arguments
|
||||
|
||||
<pre sh>
|
||||
@ -168,82 +172,6 @@ To add own functions you can use `init.fq` that will be read from
|
||||
- `$HOME/.config/fq/init.jq` on Linux, BSD etc
|
||||
- `%AppData%\fq\init.jq` on Windows (TODO: not tested)
|
||||
|
||||
## Formats
|
||||
|
||||
[./formats_table.jq]: sh-start
|
||||
|
||||
|Name |Description |Uses|
|
||||
|- |- |-|
|
||||
|`aac_frame` |Advanced Audio Coding frame |<sub></sub>|
|
||||
|`adts` |Audio Data Transport Stream |<sub>`adts_frame`</sub>|
|
||||
|`adts_frame` |Audio Data Transport Stream frame |<sub>`aac_frame`</sub>|
|
||||
|`apev2` |APEv2 metadata tag |<sub>`image`</sub>|
|
||||
|`av1_ccr` |AV1 Codec Configuration Record |<sub></sub>|
|
||||
|`av1_frame` |AV1 frame |<sub>`av1_obu`</sub>|
|
||||
|`av1_obu` |AV1 Open Bitstream Unit |<sub></sub>|
|
||||
|`avc_annexb` |H.264/AVC Annex B |<sub>`avc_nalu`</sub>|
|
||||
|`avc_au` |H.264/AVC Access Unit |<sub>`avc_nalu`</sub>|
|
||||
|`avc_dcr` |H.264/AVC Decoder Configuration Record |<sub>`avc_nalu`</sub>|
|
||||
|`avc_nalu` |H.264/AVC Network Access Layer Unit |<sub>`avc_sps` `avc_pps` `avc_sei`</sub>|
|
||||
|`avc_pps` |H.264/AVC Picture Parameter Set |<sub></sub>|
|
||||
|`avc_sei` |H.264/AVC Supplemental Enhancement Information |<sub></sub>|
|
||||
|`avc_sps` |H.264/AVC Sequence Parameter Set |<sub></sub>|
|
||||
|`bzip2` |bzip2 compression |<sub>`probe`</sub>|
|
||||
|`dns` |DNS packet |<sub></sub>|
|
||||
|`elf` |Executable and Linkable Format |<sub></sub>|
|
||||
|`exif` |Exchangeable Image File Format |<sub></sub>|
|
||||
|`flac` |Free Lossless Audio Codec file |<sub>`flac_metadatablocks` `flac_frame`</sub>|
|
||||
|`flac_frame` |FLAC frame |<sub></sub>|
|
||||
|`flac_metadatablocks` |FLAC metadatablocks |<sub>`flac_picture` `vorbis_comment`</sub>|
|
||||
|`flac_picture` |FLAC metadatablock picture |<sub>`image`</sub>|
|
||||
|`gif` |Graphics Interchange Format |<sub></sub>|
|
||||
|`gzip` |gzip compression |<sub>`probe`</sub>|
|
||||
|`hevc_annexb` |H.265/HEVC Annex B |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_au` |H.265/HEVC Access Unit |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_dcr` |H.265/HEVC Decoder Configuration Record |<sub>`hevc_nalu`</sub>|
|
||||
|`hevc_nalu` |H.265/HEVC Network Access Layer Unit |<sub></sub>|
|
||||
|`icc_profile` |International Color Consortium profile |<sub></sub>|
|
||||
|`id3v1` |ID3v1 metadata |<sub></sub>|
|
||||
|`id3v11` |ID3v1.1 metadata |<sub></sub>|
|
||||
|`id3v2` |ID3v2 metadata |<sub>`image`</sub>|
|
||||
|`jpeg` |Joint Photographic Experts Group file |<sub>`exif` `icc_profile`</sub>|
|
||||
|`json` |JSON |<sub></sub>|
|
||||
|`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 file |<sub>`id3v2` `id3v1` `id3v11` `apev2` `mp3_frame`</sub>|
|
||||
|`mp3_frame` |MPEG audio layer 3 frame |<sub>`xing`</sub>|
|
||||
|`mp4` |MPEG-4 file and similar |<sub>`aac_frame` `av1_ccr` `av1_frame` `flac_frame` `flac_metadatablocks` `id3v2` `image` `jpeg` `mp3_frame` `avc_au` `avc_dcr` `mpeg_es` `hevc_au` `hevc_dcr` `mpeg_pes_packet` `opus_packet` `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>|
|
||||
|`mpeg_pes` |MPEG Packetized elementary stream |<sub>`mpeg_pes_packet` `mpeg_spu`</sub>|
|
||||
|`mpeg_pes_packet` |MPEG Packetized elementary stream packet |<sub></sub>|
|
||||
|`mpeg_spu` |Sub Picture Unit (DVD subtitle) |<sub></sub>|
|
||||
|`mpeg_ts` |MPEG Transport Stream |<sub></sub>|
|
||||
|`ogg` |OGG file |<sub>`ogg_page` `vorbis_packet` `opus_packet`</sub>|
|
||||
|`ogg_page` |OGG page |<sub></sub>|
|
||||
|`opus_packet` |Opus packet |<sub>`vorbis_comment`</sub>|
|
||||
|`png` |Portable Network Graphics file |<sub>`icc_profile` `exif`</sub>|
|
||||
|`protobuf` |Protobuf |<sub></sub>|
|
||||
|`protobuf_widevine` |Widevine protobuf |<sub>`protobuf`</sub>|
|
||||
|`pssh_playready` |PlayReady PSSH |<sub></sub>|
|
||||
|`raw` |Raw bits |<sub></sub>|
|
||||
|`tar` |Tar archive |<sub>`probe`</sub>|
|
||||
|`tiff` |Tag Image File Format |<sub>`icc_profile`</sub>|
|
||||
|`vorbis_comment` |Vorbis comment |<sub>`flac_picture`</sub>|
|
||||
|`vorbis_packet` |Vorbis packet |<sub>`vorbis_comment`</sub>|
|
||||
|`vp8_frame` |VP8 frame |<sub></sub>|
|
||||
|`vp9_cfm` |VP9 Codec Feature Metadata |<sub></sub>|
|
||||
|`vp9_frame` |VP9 frame |<sub></sub>|
|
||||
|`vpx_ccr` |VPX Codec Configuration Record |<sub></sub>|
|
||||
|`wav` |WAV file |<sub>`id3v2` `id3v1` `id3v11`</sub>|
|
||||
|`webp` |WebP image |<sub>`vp8_frame`</sub>|
|
||||
|`xing` |Xing header |<sub></sub>|
|
||||
|`image` |Group |<sub>`gif` `jpeg` `png` `tiff` `webp`</sub>|
|
||||
|`probe` |Group |<sub>`adts` `bzip2` `elf` `flac` `gif` `gzip` `jpeg` `json` `matroska` `mp3` `mp4` `mpeg_ts` `ogg` `png` `tar` `tiff` `wav` `webp`</sub>|
|
||||
|
||||
[#]: sh-end
|
||||
|
||||
TODO: format graph?
|
||||
|
||||
## Own decoders and use as library
|
||||
|
||||
TODO
|
||||
|
Loading…
Reference in New Issue
Block a user