mirror of
https://github.com/wader/fq.git
synced 2024-12-24 13:52:02 +03:00
a7a101ca67
Also add authors to avro and macho decoders Generated with: for i in $(go run . -r -n '_registry | [([([.files[][].name | split(".")[0]] | unique[]), (.formats[].name)] | count[] | select(.[1] == 2)[0]), (.formats[] | select(.decode_in_arg).name)] | unique[]'); do DIR=$(dirname $(find format -name $i.go)); echo "$ fq -h $i" > "$DIR/testdata/help_$i.fqtest" ; done
55 lines
1.5 KiB
Plaintext
55 lines
1.5 KiB
Plaintext
$ fq -h mp4
|
|
mp4: ISOBMFF, QuickTime and similar decoder
|
|
|
|
Options
|
|
=======
|
|
|
|
allow_truncated=false Allow box to be truncated
|
|
decode_samples=true Decode supported media samples
|
|
|
|
Decode examples
|
|
===============
|
|
|
|
# Decode file as mp4
|
|
$ fq -d mp4 . file
|
|
# Decode value as mp4
|
|
... | mp4
|
|
# Decode file using mp4 options
|
|
$ fq -d mp4 -o allow_truncated=false -o decode_samples=true . file
|
|
# Decode value as mp4
|
|
... | mp4({allow_truncated:false,decode_samples:true})
|
|
|
|
Lookup mp4 box using a mp4 box path.
|
|
====================================
|
|
|
|
# <decode value box> | mp4_path($path) -> <decode value box>
|
|
$ fq 'mp4_path(".moov.trak[1]")' file.mp4
|
|
|
|
Get mp4 box path for a decode value box.
|
|
========================================
|
|
|
|
# <decode value box> | mp4_path -> string
|
|
$ fq 'grep_by(.type == "trak") | mp4_path' file.mp4
|
|
|
|
Force decode a single box
|
|
=========================
|
|
|
|
$ fq -n '"AAAAHGVsc3QAAAAAAAAAAQAAADIAAAQAAAEAAA==" | frombase64 | mp4({force:true}) | d'
|
|
|
|
Speed up decoding by not decoding samples
|
|
=========================================
|
|
|
|
# manually decode first sample as a aac_frame
|
|
$ fq -o decode_samples=false '.tracks[0].samples[0] | aac_frame | d' file.mp4
|
|
|
|
Entries for first edit list as values
|
|
=====================================
|
|
|
|
$ fq 'first(grep_by(.type=="elst").entries) | tovalue' file.mp4
|
|
|
|
References
|
|
==========
|
|
- ISO/IEC base media file format (MPEG-4 Part 12) (https://en.wikipedia.org/wiki/ISO/IEC_base_media_file_format)
|
|
- Quicktime file format (https://developer.apple.com/standards/qtff-2001.pdf)
|
|
|