This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
mkv [2022-12-11 19:16:08] mi [Extract subtitles] |
mkv [2024-01-27 11:07:45] (current) mi [Extract subtitles] |
||
|---|---|---|---|
| Line 30: | Line 30: | ||
| mkvinfo --summary "$f" | head -10 \ | mkvinfo --summary "$f" | head -10 \ | ||
| | perl -nle 'if ( /^Track (\d+): subtitles, codec ID: ([A-Z_]+).*extract track ID: (\d+)(?:, language: (\S+))?/ ) { | | perl -nle 'if ( /^Track (\d+): subtitles, codec ID: ([A-Z_]+).*extract track ID: (\d+)(?:, language: (\S+))?/ ) { | ||
| - | warn "$_ = $1: type=$2, xtrack=$3, lang=$4\n"; print "$2 $3 $4" }' \ | + | warn "$_=$1: type=$2, xtrack=$3, lang=$4\n"; print "$2 $3 $4" }' \ |
| | while read type t lang; do d=$(dirname "$f"); b=$(basename "$f"); | | while read type t lang; do d=$(dirname "$f"); b=$(basename "$f"); | ||
| echo "#Run this:# mkvextract tracks \"\$f\" $t:'$d/$b-$lang-$t.$type'"; done | echo "#Run this:# mkvextract tracks \"\$f\" $t:'$d/$b-$lang-$t.$type'"; done | ||
| Line 53: | Line 53: | ||
| mkvpropedit $mkvfile --chapters $mkvile-chapters.txt | mkvpropedit $mkvfile --chapters $mkvile-chapters.txt | ||
| + | |||
| + | * Create chapters file from 2 columns tab-delimited list of timecode and name : | ||
| + | <code>perl -ne 'BEGIN{$fps=24}; $c=sprintf("CHAPTER%02d", $n++); | ||
| + | ($tc, $name)=split(/\t/); | ||
| + | $tc =~ s!:(\d\d)$!sprintf(".%03d",$1*1000/$fps)!e; | ||
| + | print "$c=$tc\n", | ||
| + | "${c}NAME=$name"' $My_ChaptersList_File | ||
| + | </code> | ||