mirror of
https://github.com/wader/fq.git
synced 2024-12-25 22:34:14 +03:00
f4480c6fe5
interp: Refactor format help and also include options interp: Add -o name=@path to load file content as value (not documented yet, might change) interp,decode: Expose decode out value as _out (might change) interp: Refactor foramts.jq into format_{decode,func,include}.jq interp: Refactor torepr into _format_func for generic format function overloading interp: Refactor -o options parsing to be more generic and collect unknowns options to be used as format options decode of decode alises func for format overloaded functions include for format specific jq functions (also _help, torepr etc) flac_frame: Add bits_per_sample option mp3: Add max_unique_header_config and max_sync_seek options mp4: Add decode_samples and allow_truncate options avc_au: Has length_size option hevc_au: Has length_size option aac_frame: Has object_typee option doc: Rewrite format doc generation, less hack more jq
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
# <matroska root value> | matroska_path(".Segment.Tracks[0]") -> element
|
|
# <matroska root value> | matroska_path -> ".Segment.Tracks[0]"
|
|
# <matroska root value> | matroska_path(<matroska root value>) -> ".Segment.Tracks[0]"
|
|
def matroska_path(p):
|
|
_decode_value(
|
|
( if format != "matroska" then error("not matroska format") end
|
|
| _tree_path(.elements; .id; p)
|
|
)
|
|
);
|
|
def matroska_path:
|
|
( . as $c
|
|
| format_root
|
|
| matroska_path($c)
|
|
);
|
|
|
|
def _matroska__help:
|
|
{ examples: [
|
|
{comment: "Lookup element decode value using `matroska_path`", expr: "matroska_path(\".Segment.Tracks[0)\""},
|
|
{comment: "Return `matroska_path` string for a box decode value", expr: "grep_by(.id == \"Tracks\") | matroska_path"}
|
|
],
|
|
links: [
|
|
{url: "https://tools.ietf.org/html/draft-ietf-cellar-ebml-00"},
|
|
{url: "https://matroska.org/technical/specs/index.html"},
|
|
{url: "https://www.matroska.org/technical/basics.html"},
|
|
{url: "https://www.matroska.org/technical/codec_specs.html"},
|
|
{url: "https://wiki.xiph.org/MatroskaOpus"}
|
|
]
|
|
}; |