Skip to content

Instantly share code, notes, and snippets.

@kwent
Last active December 16, 2015 05:09
Show Gist options
  • Save kwent/5382866 to your computer and use it in GitHub Desktop.
Save kwent/5382866 to your computer and use it in GitHub Desktop.
Mkvmerge | Remuxer une saison à la volée. Soit une saison de 23 épisodes auxquelles je veux ajouter des fichiers de sous titres (.srt) Français et Anglais.
sh /root/merge.sh 1 20 "./MKV" "./VF" "./VO" "./output"
./MKV:
total 21584746
-rwx------@ 1 kwent staff 574M 6 oct 2012 The.Big.Bang.Theory.S06E01.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 500M 9 oct 2012 The.Big.Bang.Theory.S06E02.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 493M 15 oct 23:47 The.Big.Bang.Theory.S06E03.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 541M 21 oct 16:41 The.Big.Bang.Theory.S06E04.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 528M 27 oct 13:43 The.Big.Bang.Theory.S06E05.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 523M 4 nov 00:21 The.Big.Bang.Theory.S06E06.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 668M 12 nov 20:30 The.Big.Bang.Theory.S06E07.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 494M 1 déc 15:47 The.Big.Bang.Theory.S06E09.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 533M 14 déc 18:12 The.Big.Bang.Theory.S06E10.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 524M 21 déc 23:41 The.Big.Bang.Theory.S06E08.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 531M 3 jan 23:09 The.Big.Bang.Theory.S06E11.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 505M 5 jan 17:36 The.Big.Bang.Theory.S06E12.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 559M 14 jan 22:59 The.Big.bang.Theory.S06E13.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 499M 5 fév 22:03 The.Big.Bang.Theory.S06E14.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 496M 13 fév 23:30 The.Big.Bang.Theory.S06E15.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 530M 18 fév 21:04 The.Big.Bang.Theory.S06E16.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 585M 25 fév 23:08 The.Big.Bang.Theory.S06E17.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 497M 10 mar 19:58 The.Big.Bang.Theory.S06E18.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 471M 15 mar 16:39 The.Big.Bang.Theory.S06E19.720p.HDTV.X264-DIMENSION.mkv
-rwx------@ 1 kwent staff 487M 6 avr 15:09 The.Big.Bang.Theory.S06E20.720p.HDTV.X264-DIMENSION.mkv
./VO:
total 1250
-rwx------@ 1 kwent staff 31K 5 oct 2012 tbbtvo-02.srt
-rwx------@ 1 kwent staff 30K 11 oct 2012 tbbtvo-03.srt
-rwx------@ 1 kwent staff 31K 1 nov 06:37 tbbtvo-05.srt
-rwx------@ 1 kwent staff 29K 1 nov 06:37 tbbtvo-04.srt
-rwx------@ 1 kwent staff 33K 1 nov 22:12 tbbtvo-06.srt
-rwx------@ 1 kwent staff 32K 9 nov 03:43 tbbtvo-07.srt
-rwx------@ 1 kwent staff 30K 4 déc 03:32 tbbtvo-09.srt
-rwx------@ 1 kwent staff 30K 6 déc 20:27 tbbtvo-10.srt
-rwx------@ 1 kwent staff 35K 18 déc 07:21 tbbtvo-11.srt
-rwx------@ 1 kwent staff 33K 4 jan 08:50 tbbtvo-12.srt
-rwx------@ 1 kwent staff 32K 18 jan 02:47 tbbtvo-13.srt
-rwx------@ 1 kwent staff 29K 1 fév 16:30 tbbtvo-14.srt
-rwx------@ 1 kwent staff 33K 15 fév 08:50 tbbtvo-15.srt
-rwx------@ 1 kwent staff 29K 13 mar 15:40 tbbtvo-17.srt
-rwx------@ 1 kwent staff 31K 13 mar 15:40 tbbtvo-16.srt
-rwx------@ 1 kwent staff 30K 15 mar 15:41 tbbtvo-19.srt
-rwx------@ 1 kwent staff 29K 23 mar 15:24 tbbtvo-18.srt
-rwx------@ 1 kwent staff 29K 5 avr 10:22 tbbtvo-20.srt
-rwx------@ 1 kwent staff 30K 14 avr 15:11 tbbtvo-01.srt
-rwx------@ 1 kwent staff 30K 14 avr 15:11 tbbtvo-08.srt
./VF:
total 1032
-rwx------ 1 kwent staff 24K 14 avr 15:05 tbbtvf-02.srt
-rwx------ 1 kwent staff 26K 14 avr 15:08 tbbtvf-01.srt
-rwx------ 1 kwent staff 25K 14 avr 15:09 tbbtvf-03.srt
-rwx------ 1 kwent staff 23K 14 avr 15:09 tbbtvf-04.srt
-rwx------ 1 kwent staff 26K 14 avr 15:09 tbbtvf-05.srt
-rwx------ 1 kwent staff 26K 14 avr 15:09 tbbtvf-06.srt
-rwx------ 1 kwent staff 27K 14 avr 15:09 tbbtvf-07.srt
-rwx------ 1 kwent staff 24K 14 avr 15:09 tbbtvf-08.srt
-rwx------ 1 kwent staff 25K 14 avr 15:09 tbbtvf-09.srt
-rwx------ 1 kwent staff 25K 14 avr 15:10 tbbtvf-10.srt
-rwx------@ 1 kwent staff 29K 14 avr 15:10 tbbtvf-11.srt
-rwx------@ 1 kwent staff 27K 14 avr 15:10 tbbtvf-12.srt
-rwx------@ 1 kwent staff 26K 14 avr 15:10 tbbtvf-13.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-14.srt
-rwx------@ 1 kwent staff 26K 14 avr 15:10 tbbtvf-15.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-16.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-17.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-18.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-19.srt
-rwx------@ 1 kwent staff 24K 14 avr 15:10 tbbtvf-20.srt
#!/bin/bash
echo -e "Mkvmerge - Remux en série."
PATH_TO_MEDIA=$3
FR_PATH=$4'/'
EN_PATH=$5'/'
OUTPUT_FOLDER=$6
echo -e "Remux des episodes $1 à l'épisode $2"
echo -e "Répértoire des médias à transcoder: $3"
echo -e "FR_PATH: $4"
echo -e "EN_PATH: $5"
echo -e "Notes: .srt files need to be in UTF-8 format"
echo -e "Répértoire de destination: $6"
echo -e
for i in `seq $1 $2`
do
#Prefix '0' pour les épisodes < 10
if test $i -lt 10
then
namefile="The.Big.Bang.Theory.S06E0$i.720p.HDTV.X264-DIMENSION"
FR_FILENAME="tbbtvf-0$i"
EN_FILENAME="tbbtvo-0$i"
else
namefile="The.Big.Bang.Theory.S06E$i.720p.HDTV.X264-DIMENSION"
FR_FILENAME="tbbtvf-$i"
EN_FILENAME="tbbtvo-$i"
fi
echo -e "Media entrant: $PATH_TO_MEDIA/$namefile.mkv"
echo -e "Media sortant: $OUTPUT_FOLDER/$namefile.mkv"
echo -e "EN SRT: $EN_PATH$EN_FILENAME.srt"
echo -e "FR SRT: $FR_PATH$FR_FILENAME.srt"
mkvmerge -v -o "$OUTPUT_FOLDER/$namefile.mkv" "--language" "1:eng" "--default-track" "1:no" "--forced-track" "1:no" "--display-dimensions" "1:1280x720" "--default-track" "2:yes" "--forced-track" "2:no" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "$PATH_TO_MEDIA/$namefile.mkv" "--language" "0:eng" "--track-name" "0:English" "--default-track" "0:no" "--forced-track" "0:no" "-s" "0" "-D" "-A" "-T" "--no-global-tags" "--no-chapters" "$EN_PATH$EN_FILENAME.srt" "--language" "0:fre" "--track-name" "0:French" "--forced-track" "0:no" "-s" "0" "-D" "-A" "-T" "--no-global-tags" "--no-chapters" "$FR_PATH$FR_FILENAME.srt" "--track-order" "0:1,0:2,2:0,1:0"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment