media: Add matroska chapters to opus

This commit is contained in:
Simon Bruder 2021-09-17 18:16:06 +02:00
parent 6e9db83282
commit 551d013b60
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -22,6 +22,13 @@
:::shell :::shell
parec [ -d DEVICE ] | flac --endian=little --channels=2 --bps=16 --sample-rate=48000 --sign=signed -o foo.flac - parec [ -d DEVICE ] | flac --endian=little --channels=2 --bps=16 --sample-rate=48000 --sign=signed -o foo.flac -
### Copy Matroska Chapters to Opus
Requires the metadata to fit in one ogg page (so no cover art :().
:::shell
mkvextract file.mka chapters | xq -r 'def pad: tostring | (3 - length) as $l | ("0" * $l)[:$l] + .; [[.Chapters.EditionEntry.ChapterAtom[] | {start: .ChapterTimeStart, name: .ChapterDisplay.ChapterString}] | to_entries[] | "CHAPTER\(.key|pad)=\(.value.start)\nCHAPTER\(.key|pad)NAME=\(.value.name)"] | join("\n")' | opustags -i -S file.opus
## Video ## Video
### Copy DVD stream to file [with dvd already copied to local directory] ### Copy DVD stream to file [with dvd already copied to local directory]