From 551d013b60c3964c27f7f8aa0da109ea780f8910 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 17 Sep 2021 18:16:06 +0200 Subject: [PATCH] media: Add matroska chapters to opus --- docs/media/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/media/index.md b/docs/media/index.md index 5073924..17df905 100644 --- a/docs/media/index.md +++ b/docs/media/index.md @@ -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]