1
1
mirror of https://github.com/wader/fq.git synced 2025-01-05 12:26:11 +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

@ -29,20 +29,26 @@
| 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
| ([$stts.entries[] | .count * .delta] | add) as $stts_sum
| { | {
component_type: $hdlr.component_subtype, component_type: $hdlr.component_subtype,
data_format: $stsd.sample_descriptions[0].data_format, # the sample descriptors are handled as boxes by the mp4 decoder
data_format: $stsd.boxes[0].type,
media_scale: $mdhd.time_scale, media_scale: $mdhd.time_scale,
edit_list: edit_list:
[ $elst.table[] [ $elst.entries[]
| { | {
time_scale: $mdhd.time_scale, track_duration: .segment_duration,
track_duration: .track_duration,
media_time: .media_time, media_time: .media_time,
track_duration_s: (.track_duration / $mvhd.time_scale), track_duration_s: (.segment_duration / $mvhd.time_scale),
media_time_s: (.media_time / $mdhd.time_scale) media_time_s: (.media_time / $mdhd.time_scale)
} }
] ],
stts: {
sum: $stts_sum,
sum_s: ($stts_sum / $mdhd.time_scale)
}
} }
] ]
} }