media: Add matroska chapters to opus

master
Simon Bruder 2021-09-17 18:16:06 +02:00
parent 6e9db83282
commit 551d013b60
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,13 @@
:::shell
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
### Copy DVD stream to file [with dvd already copied to local directory]