1
1
mirror of https://github.com/wader/fq.git synced 2025-01-03 19:19:43 +03:00

editlit.jq: Update after mp4 field renames

This commit is contained in:
Mattias Wadman 2021-08-31 17:18:05 +02:00
parent b33f2cd678
commit 69c6d150e2

View File

@ -23,27 +23,33 @@
time_scale: $mvhd.time_scale, time_scale: $mvhd.time_scale,
duration_s: ($mvhd.duration / $mvhd.time_scale), duration_s: ($mvhd.duration / $mvhd.time_scale),
tracks: tracks:
[ .boxes[] [ .boxes[]
| select(.type == "trak") | select(.type == "trak")
| first(.. | select(.type == "mdhd")?) as $mdhd | first(.. | select(.type == "mdhd")?) as $mdhd
| first(.. | select(.type == "hdlr")?) as $hdlr | first(.. | select(.type == "hdlr")?) as $hdlr
| first(.. | select(.type == "stsd")?) as $stsd | first(.. | select(.type == "stsd")?) as $stsd
| first(.. | select(.type == "elst")?) as $elst | first(.. | select(.type == "elst")?) as $elst
| { | first(.. | select(.type == "stts")?) as $stts
component_type: $hdlr.component_subtype, | ([$stts.entries[] | .count * .delta] | add) as $stts_sum
data_format: $stsd.sample_descriptions[0].data_format, | {
media_scale: $mdhd.time_scale, component_type: $hdlr.component_subtype,
edit_list: # the sample descriptors are handled as boxes by the mp4 decoder
[ $elst.table[] data_format: $stsd.boxes[0].type,
| { media_scale: $mdhd.time_scale,
time_scale: $mdhd.time_scale, edit_list:
track_duration: .track_duration, [ $elst.entries[]
media_time: .media_time, | {
track_duration_s: (.track_duration / $mvhd.time_scale), track_duration: .segment_duration,
media_time_s: (.media_time / $mdhd.time_scale) media_time: .media_time,
track_duration_s: (.segment_duration / $mvhd.time_scale),
media_time_s: (.media_time / $mdhd.time_scale)
}
],
stts: {
sum: $stts_sum,
sum_s: ($stts_sum / $mdhd.time_scale)
} }
] }
} ]
]
} }
) )