Extract Subtitles From Dvd Ffmpeg



  • To extract subtitles from.mp4 files that have subtitles embeded you can use the command line tool ffmpeg. To install it use: sudo apt install ffmpeg (on older ubuntu use sudo ap-get install ffmpeg. Then use the following syntax from within the right folder.
  • You can extract or convert those subtitles. To convert to srt from dvbteletext. Ffmpeg -txtformat text -i inputfile out.srt Your FFmpeg needs to be configured with -enable-libzvbi for this to work, and results in something like this.
  1. Extract Dvd Subtitles From Ffmpeg
  2. Extract Subtitle From Mp4
  3. Ffmpeg Extract Srt
  4. Ffmpeg Burn In Subtitles

Stream 3 has DVBTELETEXT encoded subtitles. FFmpeg doesnt have the capability to decode teletext at present. It is supposed to work with mplayer -demuxer lavf -sid 0 (pressing 'X') but MPlayer claims there is no actual teletext data transmitted. Comment:13 Changed 8 years ago by pross.

In this guide I'll show you how to do that by using FFmpeg (version 3.2.5 or greater) on a Linux-based operating system - I'm currently using Debian Stable, aka Jessie.

FFmpeg is able to deal with a vast amount of audio/video formats and containters. For our task I will be using Matroska Multimedia Container container (.mkv files), as it is capable of storing different audio, video and subtitle tracks together. The video stream will be encoded with H.264 codec, currently the best guy in town. Audio tracks will be encoded in mp3 format.

Let's begin!

Step 1: unify your VOBs

VOB file are usually 1 Gb each in order to be compatible with all operating systems, as some cannot read files larger than that size. The first step then is to join them into a single, big VOB file. To do that, browse to the VIDEO_TS folder and do:

That's it.

Step 2: identify the streams

Now let's inspect the newly created file: we want to find what kind of stuff it contains. Use FFmpeg for that, as follows:

For example, you might end up with something like:

Here FFmpeg reports that my VOB file contains five streams. Starting from the first one, Stream #0:0 contains data regarding the DVD's menu navigation. We can get rid of it. Stream #0:1 is the actual movie. The remaining streams are audio tracks. I'll discard Stream #0:2 as it contains the same data (English audio track) encoded in a different format.

Mind the deep-buried streams!

Normally, while looking for streams, FFmpeg parses only few seconds of the input data as most formats have a global header there that describes everything present in the file. Unfortunately VOBs have no headers and it is likely to find movies that hold additional streams further down the VOB file.

Let FFmpeg scan it thoroughly by adding two more flags: -analyzeduration (in microseconds) and -probesize (in bytes). Honestly I'm not able to tell the difference between those options: put in there some fairly large numbers and tweak them until you are satisfied. For example:

Extract Subtitles From Dvd Ffmpeg

And, not surprisingly, two more streams are found:

Subtitles: let's keep them!

Extract Dvd Subtitles From Ffmpeg

Step 3: encoding

Remove subtitles from mkv ffmpeg

We are ready to pack our DVD into a beautiful .mkv file. The command looks like:

Let me dissect it:

  • -analyzeduration 100M -probesize 100M — keep this one so that FFmpeg is able to find hidden streams;
  • -i output.vob — the input file;
  • -map 0:1 -map 0:3 -map 0:4 -map 0:5 -map 0:6 — here I'm mapping the streams, namely I'm telling FFmpeg to keep Stream 0:1, Stream 0:3, Stream 0:4, Stream 0:5, Stream 0:6 and put them in the output file in that specific order;
  • -metadata[...] — this is used to give streams a title and other additional information, specifically to audio tracks (s:a:0 and s:a:1 where a stands for audio) and subtitles (s:s:0 and s:s:1 where s stands for subtitles);
  • -codec:v libx264 -crf 21 — defines the video codec in use and the constant rate factor (crf), namely the quality level. This method allows the encoder to keep a constant quality level, regardless the output file size: 0 is lossless, 23 is default, and 51 is worst possible. The sane range is between 18 and 28;
  • -codec:a libmp3lame -qscale:a 2 — defines the audio codec in use and the quality level: 0-3 will produce transparent results, 4 (default) should be close to perceptual transparency, 6-9 produces an 'acceptable' quality. Using numbers from 0 to 9 means that the audio track will be encoded in variable bitrate (vbr) mode: smaller files, better quality;
  • -codec:s copys stands for subtitles: copy them as they are;
  • output.mkv — the output file.

Bonus point: if your machine supports it, add the flag -threads N to enable multi-threading and give the encoding a boost. Replace N with the number of your CPU cores.

Sources

Wikipedia - VOB (link)
Wikipedia - Matroska (link)
FFmpeg f.a.q. - 3.16 Why does FFmpeg not see the subtitles in my VOB file? (link)
FFmpeg wiki - FFmpeg and H.264 Encoding Guide (link)
FFmpeg wiki - FFmpeg MP3 Encoding Guide (link)

A file with the .SRT file extension is a SubRip Subtitle file. These types of files hold video subtitle information like the start and end timecodes of the text and the sequential number of subtitles. It's important to note that SRT files themselves are just text files that are used along with video data. This means the SRT file itself does not contain any video or audio data. Sometimes, you may have the need to extract subtitle from DVD to SRT format with preferred language so that you can add them later on a Blu-ray authoring program or put the subtitles in a separate .srt file so that they can show up when when viewing on media players with has the subtitle functions.

Best Program to Extract/Rip Subtitles from DVD to SRT with Desired Language

Although there are many DVD ripping programs on the market, very few of them can do the subtitle extracting job for you. Fortunately, there is an program entitled EaseFab LosslessCopy (available for Windows and Mac users) that supports directly extract SRT files with one desired language or multiple languages from any commercial DVD disc, DVD folder and ISO image file.

Moreover, the program also enables you to rip DVD with desired internal subtitles and audio tracks, enable forced subtitles if you don't want the whole movie to have subtitles, , but just portions that require translation or add online downloaded external srt/ass/ssa subtitles to DVD movies if the foreign language DVD movie do not contain any language subtitles you understand.

Ffmpeg burn in subtitles

Besides handling subtitles in different ways, EaseFab LosslessCopy has top performance when it comes to ripping and copying DVDs, such as:

Extract Subtitle From Mp4

▶ It can rip DVDs protected by DVD CSS, region code, RCE, Sony ArccOS, UOPs, Disney X-project DRM and more independently. 99-title DVDs and workout DVDs are fully supported. It automatically ticks the right title and delivers high-quality output in order. No crashes. It can also deal with Blu-ray files, including UHD 4K discs.
▶ It provides 320+ different output formats. LosslessCopy is able to convert Blu-ray/DVD to MP4, AVI, MKV, MOV, FLV, MPEG MP3, AAC, M4A and other mainstream video/audio formats.
▶ It offers a library of preprogrammed optimization profiles for specific devices such as smartphones, tablets, gaming systems, smart TVs and more.
1:1 Disc Backup: Directly Copy main movie from BD/DVD discs and leave out extras; 1:1 Backup original Blu-ray and DVD to computer hard drive with all languages, subtitle tracks and chapter info; Lossless rip DVD/Blu-ray to MKV with full video, audios, subtitles, menus and chapters.
Advanced Customization tools: LosslessCopy allows you to manually adjust codecs, aspect ratios, bit-rates, frame rates and more before you rip a DVD or Blu-ray. Also, it includes a basic video editor you can use to trim away unwanted footage, crop video, add watermarks and edit subtitles.
▶ With the Intel QSV and NVIDIA CUDA powered hardware acceleration, the conversion is processed on GPU instead of your computer's CPU and you can convert a full DVD disc to H.264 MP4 as short as 10 minutes.

Simple Steps to Extract Subtitles from DVD to SRT Files with Preferred Language

Ffmpeg Extract Srt

Step 1. Load DVD movies

After you open EaseFab LosslessCopy, click Load disc button to add the DVD files you want to rip. On the software main interface, there is a viewing window provided for you to preview the DVD files to ensure the files are what you want to rip. You can also take snapshots of the DVD movies when previewing them. You can also import DVD folder and ISO image files into the program.

Step 2. Select output file format.

From the Format drop-down list, select Subtitle File >SRT Subtitle(*.srt) as the desired output file format.

Step 3. Select subtitles by languages.

Click Settings to open Multi-task Settings window to select subtitles by language. Check any language you'd like to keep. You can either keep native-language subtitles only or multiple subtitles in different languages.

Step 4. Start extracting SRT files from DVD

Press the right-bottom blue Convert and start ripping DVD subtitles to SRT file.

When the SRT extracting process is finished, click Open output folder to locate the generated files, you will get all the subtitles in English, Italian, Spanish... Which is exactly the same as in your original disc. For this situation, you need choose the English subtitle for study.

Sometimes, the extracted SRT subtitles may not what you desire to get, you can still use our program to add additional SRT/ASS/SSA subtitles to movie files. Just open the Edit window, switch to Subtitles, check Enable, you will be able to add your desired subtitles to your converted files.

Ffmpeg Burn In Subtitles

> Resource > DVD Ripping Tips > Simple Guide on Extract Subtitles from DVD as SRT File Format