mirror of
https://github.com/wader/fq.git
synced 2024-11-25 23:13:19 +03:00
22 lines
692 B
Plaintext
Executable File
22 lines
692 B
Plaintext
Executable File
#!/usr/bin/env fq -d mp4 -f
|
|
|
|
( first(.boxes[] | select(.type == "moov")?)
|
|
| first(.boxes[] | select(.type == "mvhd")?) as $mvhd
|
|
| { time_scale: $mvhd.time_scale,
|
|
duration: ($mvhd.duration / $mvhd.time_scale),
|
|
tracks:
|
|
[ .boxes[]
|
|
| select(.type == "trak")
|
|
| [("mdhd", "stsd", "elst") as $t | first(grep_by(.type == $t))] as [$mdhd, $stsd, $elst]
|
|
| { data_format: $stsd.boxes[0].type,
|
|
media_scale: $mdhd.time_scale,
|
|
edit_list:
|
|
[ $elst.entries[]
|
|
| { track_duration: (.segment_duration / $mvhd.time_scale),
|
|
media_time: (.media_time / $mdhd.time_scale)
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
) |