This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
copy_dvd [2019-09-17 22:03:50] mi [Check if the DVD uses CSS copy protection] |
copy_dvd [2021-12-26 14:54:08] (current) mi |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Copying / transcoding a DVD with ffmpeg ====== | + | = Copying / transcoding a DVD with ffmpeg |
* First, copy the DVD to a hard drive | * First, copy the DVD to a hard drive | ||
- | ===== For unencrypted DVDs: ===== | + | == For unencrypted DVDs: |
* Use VLC to check which are the correct files. In the example below, they are VTS_01_1.VOB to VTS_01_3.VOB. | * Use VLC to check which are the correct files. In the example below, they are VTS_01_1.VOB to VTS_01_3.VOB. | ||
Line 29: | Line 29: | ||
Or to copy only the first subtitle track, use : <code>-c:v copy -c:a copy -c:s copy</code> | Or to copy only the first subtitle track, use : <code>-c:v copy -c:a copy -c:s copy</code> | ||
+ | === More options | ||
- | ===== Check if the DVD uses CSS copy protection ===== | + | vob_opt=(-probesize 1G -analyzeduration 1G -r 25 -fflags +genpts) |
+ | h264_opt=(-c:v libx264 -tune film -pix_fmt yuv420p -profile:v high -level 4.0 -preset fast -crf 18) | ||
+ | filter_opt=(-filter:v "yadif=0:-1:0, scale=iw*sar:ih:flags=lanczos, setsar=1") | ||
+ | col_opt=(-colorspace bt470bg -color_primaries bt470bg -color_trc gamma28) | ||
+ | keyframes_opt=(-g 25) | ||
+ | audio_opt=(-c:a aac -b:a 160k) | ||
+ | test="-t 120" # 120 seconds for testing | ||
+ | |||
+ | then | ||
+ | |||
+ | ffmpeg "${vob_opt[@]}" -i "$in" $test "${col_opt[@]}" "${h264_opt[@]}" "${keyframes_opt[@]}" "${filter_opt[@]}" "${audio_opt[@]}" "$out" | ||
+ | |||
+ | == Check if the DVD uses CSS copy protection | ||
* Try playing single .VOB files in VLC. | * Try playing single .VOB files in VLC. | ||
* Or use ''check-dvd-css.pl'' with one of the .VOB files : | * Or use ''check-dvd-css.pl'' with one of the .VOB files : | ||
Line 73: | Line 86: | ||
} | } | ||
</file> | </file> | ||
+ | |||
+ | =Extract subtitles | ||
+ | |||
+ | List content with ''lsdvd -x''. From the output, select the VTS index for the movie, and select the index of the wanted subtitle track. | ||
+ | |||
+ | vtsid=2 # "Title: 02, [...] VTS: 02" will use VTS_02_0.IFO | ||
+ | subid=0 # "Subtitle: 01" : 1st subtitle track is index 0 | ||
+ | |||
+ | mencoder -dvd-device VIDEO_TS dvd://1 -nosound -ovc 'copy' -o /dev/null -ifo VIDEO_TS/VTS_0${vtid}_0.IFO -sid $subid -vobsubout vobsubs-$subid | ||
+ | |||
+ | (See also https://www.rigacci.org/wiki/doku.php/doc/appunti/linux/video/vobcopy) | ||
{{tag>public video perl}} | {{tag>public video perl}} |