doc:appunti:linux:video:vobcopy
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:video:vobcopy [2021/02/19 09:53] – [Converting a DVD with subtitles to MKV using ffmpeg] niccolo | doc:appunti:linux:video:vobcopy [2021/02/19 17:13] (current) – [Converting a DVD with subtitles to MKV using ffmpeg] niccolo | ||
---|---|---|---|
Line 78: | Line 78: | ||
I got a rather complicate DVD to rip from, basically the problems are: | I got a rather complicate DVD to rip from, basically the problems are: | ||
- | * Subtitles are in dvdsub format (which is normal for DVD). | + | * Subtitles are in **dvdsub** format (which is normal for DVD), which need **palette** info to be displayed correctly. |
- | * Some subtitles streams | + | * Different |
- | * Languages of subtitles are not automatically detected. | + | |
+ | |||
+ | === Inspect | ||
Using lsdvd directly on the DVD disk, you can see the **video** tracks, **audio** streams and **subtitles** availables: | Using lsdvd directly on the DVD disk, you can see the **video** tracks, **audio** streams and **subtitles** availables: | ||
Line 96: | Line 98: | ||
</ | </ | ||
- | First of all I ripped the first track (the only one I'm really interested in) from the DVD into a directory: | + | === Rip the track === |
+ | |||
+ | First of all I **ripped the first track** (the only one I'm really interested in) from the DVD into a directory: | ||
< | < | ||
Line 102: | Line 106: | ||
</ | </ | ||
- | Using the **mediainfo** tool you can inspect the resulting vob file to see how many **video**, **audio** and **text** (subtitles) streams are contained into. FIXME how to view languages? | + | Using the **mediainfo** tool you can inspect the resulting vob file to verify that **video**, **audio** and **text** (subtitles) streams are the ones we expect. |
- | Then I extracted the first (#0) dvdsub stream (there are 22!) from the DVD: | + | === Get subtitles palette info === |
+ | |||
+ | Then I extracted the first (#0) **dvdsub stream** (there are 22!) from the DVD: | ||
< | < | ||
Line 120: | Line 126: | ||
| | ||
</ | </ | ||
+ | |||
+ | As an alternative you can get the the **.IFO** of the track (for the first track it is **VIDEO_TS/ | ||
+ | |||
+ | Also **lsdvd** should be able to print the palette, using the option **-P**. But in my tests it produced a palette with different color values, which displayed incorrectly in the final result. | ||
+ | |||
+ | === Transcode with ffmpeg === | ||
Finally I launched the **ffmpeg** incantation: | Finally I launched the **ffmpeg** incantation: | ||
<code bash> | <code bash> | ||
- | ffmpeg -probesize | + | ffmpeg -probesize |
- | -palette | + | -palette |
- | -i " | + | -i ' |
-map ' | -map ' | ||
- | -metadata: | + | |
- | -metadata: | + | -map ' |
- | ... | + | -map ' |
+ | -map ' | ||
+ | -map ' | ||
+ | -map ' | ||
+ | -map ' | ||
+ | | ||
+ | -metadata: | ||
+ | | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -metadata: | ||
+ | -codec:s ' | ||
+ | -vf yadif \ | ||
+ | -codec:v ' | ||
+ | -b:v ' | ||
+ | -ac 2 -codec:a ' | ||
+ | ' | ||
</ | </ | ||
+ | |||
+ | Without the **%%-probesize%%** and **%%-analyzeduration%%** options (both are required), '' | ||
+ | |||
+ | < | ||
+ | Stream map ' | ||
+ | </ | ||
+ | |||
+ | If you don't explicitly map the streams, you will get only a warning message during the transcode: | ||
+ | |||
+ | < | ||
+ | New subtitle stream 0:27 at pos:8284174 and DTS: | ||
+ | </ | ||
+ | |||
+ | I mapped (i.e. selected to be inserted into the output) the **video track**, then **two adio tracks** (there were four), and finally **24 text subtitles tracks** (they are actually bitmaps in dvdsub format). The order of the **%%-map%%** options is used to re-arrange the position of the subtitles, overriding the autodetect performed by '' | ||
+ | |||
+ | It is mandatory to use the **%%-codec: | ||
+ | |||
+ | Yes, the source video has annoying **interlacing artifacts**, | ||
+ |
doc/appunti/linux/video/vobcopy.1613724800.txt.gz · Last modified: 2021/02/19 09:53 by niccolo