Extract Subtitles From Dvd Ubuntu

This article will describe installing deb packages which are in DVD. This will help to recovery when the network packages are removed by mistake.

  1. Extract Subtitles From Dvd Ubuntu Usb
  2. Extract Subtitles From Dvd Ubuntu Download
  3. Rip Subtitles From Dvd

Extract subs from (non-encrypted, on hard drive) DVDs and convert to Advanced Substation Alpha format. It can also convert sup (PGS) and sub/idx formats to same. 'I wrote this because I hate the blocky, too-high-on-the-screen look of regular DVD subtitles and wanted to re-encode my DVD collection in h264/aac/assa in an mkv container.' Extracting subtitles from a DVD is hence a two step process. First the VOB file needs to be demuxed and the subtitle stream extracted, and then the stream needs to be fed into an OCR software to convert the images into text. That’s quite a task. Fortunately, DVDSubEdit is a software that does both seamlessly and transparently to the user. I want to use the command line to extract subtitles from video files. I want to extract subtitles from a lot of files. That is why I want a CLI tool. Ideally it should work with any video format that supports embedded subtitles. For example: subextract -f RevolutionOS.mp4 Extracting English.srt Extracting French.srt Extracting Russina.srt All.

Table of Contents

  • 3. Create DVD which has custom deb packages

1 Add cdrom to repository list with apt-cdrom

Mount cdrom to /media/cdrom.

Add cdrom to repository list with apt-cdrom.

The apt-cdrom changes /etc/apt/sources.list. For removing cdrom from repository list, remove 'deb cdrom:' statement in /etc/apt/sources.list.

2 Few packages in ubuntu-16.04-desktop-amd64.iso

ubuntu-16.04-desktop-amd64.iso has only 24 packages. ubuntu-16.04-desktop-amd64.iso is LiveDVD. For installing, copy root filesystem of LiveDVD to storage and install 24 packages to storage.

ubuntu-16.04-server-amd64.iso has 1244 packages. But it has no desktop environment packages.

3 Create DVD which has custom deb packages

This article will create DVD which has desktop environment packages. And this will add DVD to repository list.

3.1 Download deb packages

Download deb packages of ubuntu-desktop and dependencies with this script.

3.2 Create GPG key

When creating GPG key, the following message will be output and console will be hung.

For avoid this hung, update /dev/urandom with rng-tools.

Create gpg config file.

Create GPG key with gpg batch mode, and import GPG key.

3.3 Create repository

Install reprepro which creates repository with apt.

Get subkey value for GPG key of repository.

Create iso directory and store reprepro config file to there.

Create repository with reprepro.

Copy GPG public key to iso directory.

3.4 Create DVD

Subtitles

Create iso image with genisoimage. Please burn iso image to DVD media.

3.5 Add cdrom to repository list

Insert DVD media and mount cdrom to /media/cdrom.

Add GPG key with apt-key.

Add cdrom to repository list with apt-cdrom. Because the database has no entry of this DVD, input repository name 'Ubuntu 16.04 repo'.

Now you can install deb packages from DVD.

There are occasions where you legitimately need tools to help that would otherwise be considered the domain of “pirates” and “ne’er-do-wells”. In this particular scenario, my grandparents send a DVD from the United States (Region1) to us in Belgium (Region2). Not only will the DVD not play back on a region locked DVD player, there are also no Dutch subtitles.

There are however technological solutions to this type of problem, including such programs as dvd::rip, vobsub2srt and a few websites dedicted to crowdsourced subtitles.

Our first task is to properly rip a DVD. There are many options here, but I chose dvd::rip because it just works. It creates a small xvid (avi) file that is compatible with a set-top DVD player and it is also allows ripping of any subtitles found on the DVD. If may wish to dig into the documentation to really understand the details of dvd:rip. I’ll give you a step-by-step run down on how I did things.

dvd::rip

  1. Install the program and it’s libraries.
  2. Following the directions and make sure the directories are set, dvd drive is found and that libraries are installed.
  3. On the left will be tabs, use this as a process. Begin with “Storage” where you set the project name, dvd drive to use and “Copy data from DVD to hard disk before encoding” which will make things faster.
  4. On “Rip Title” you need to read the data on the DVD and select which files to rip. First “Read DVD table of contents”, select the Title or Titles you wish to rip, usually the one with the most Chapters and/or Runtime is your target. Highlight that entry, select on the right your audio track (en for English, other en entries are usually commentary tracks). Set “Specify chapter mode” to None so that it is ripped as one file and not a set of files (per chapter) and set the “Grab subtitle preview images” to All so that you can select what subtitles you wish use, if any. The last step here is to “Rip selected title(s)/chapter(s) which will take a few minutes.
  5. Select next the “Clip & Zoom” which will allow you to set the correct format (size) that is perfect for your TV. You need to be careful here because the source (DVD) can be different such as: letterbox (widescreen) 1.85:1 ratio, anamorphic (widescreen) 16:9 ratio, or pan & scan (fullscreen) 4:3 ratio. Look at the back of your DVD box to verify. To test different settings, do a grab frame and try various “Autoadjust” presets until you find something that looks right. If you are playing back on an older DVD player with USB divx/xvid/avi support, then try to pick Small Frame Size, which is about 480p. This will make playing back smother as your hardware DVD player doesn’t have enough CPU power to downscale higher resolutions.
  6. Moving to the Subtitles screen, you can select the DVD title that you ripped and the correct subtitle you wish to rip. You can either “Activate this subtitle” for rendering or “Create now” which will produce separate files which you can use later. I prefer another method of handling subtitles than hard-rendering them to the rip. After “Create Now”, you will have extra files that we can convert to SubRip text file format (SRT) later.
  7. After that we go to the “Transcode” tab which is the ‘meat’ of the program. We select our DVD title, select a container of AVI, make sure the “Video codec” is xvid, “By target size”‘s “Target media” to One x 700MB which will create one file at an acceptable bitrate. On the Audio Options side, “Select track” to the one we ripped and select MP3. I set the Samplerate to 192kbit/s to get better audio. the rest I set to defaults. On the bottom left gives you an “Calculated storage”. If you are content with your choices, go to “Operate” and select “Transcode” and wait a bit more.
  8. Success! Try out your newly made AVI file with VLC or another player to make sure it is to you liking. If you got an error, you can go to the “Logging” tab on the left and see where you went wrong.

At this point, you should have an AVI file that you can play back in your video player or DVD player. However the job is not yet finished as we also need the subtitles for those in their native language. We saw that we could ‘Rip’ subtitles with dvd::rip but the files we have are in the VOB format idx/ifo/sub format which may or may not be readable by your player. We can convert this format to a SRT text-based file which is widely supported subtitle format using a tool called: VobSub2SRT.

VobSub2SRT

  1. Download and build VobSub2SRT yourself or install the package via PPA.
  2. You will also need to install ‘tesseract-ocr‘ and any of the language files necessary to handle the subtitle language you ripped earlier.
  3. From the command line, go to where your ripped subtitles are and run the command to convert (OCR) them into an SRT file.

    vobsub2srt –lang en dolphinetail-001-sid00

    This will use english (en) from the idx/sub files to make the srt file. You can find out which languages you can pick from using the –langlist parameter.

  4. [email protected]:~/.dvdrip-data/dolphinetail/avi/001$ vobsub2srt –lang en dolphinetail-001-sid00
    Selected VOBSUB language: 0 language: enen
    Wrote Subtitles to ‘dolphinetail-001-sid00.srt’

    Success! Just copy the SRT file to where your AVI is and your player should recognize and automatically use the subtitle file.

There are times when you have the film but there is not subtitle for your language of choice. This is where crowd sourcing comes in as there is no shortage of people wanting to either subtitle the film for free as volunteer work or for some other altruistic or non-altruistic reason.

Crowdsourced Subtitles

Extract Subtitles From Dvd Ubuntu
  • Bierdopje: Dutch subtitles for films and series.
  • OpenSubtitles: Multi-lingual subtitles for films and series
  • Podnapisi: Older Multi-lingual subtitles for films and series

Extract Subtitles From Dvd Ubuntu Usb

Resizing Video
There can be moments where you have a file you want to play back on your DVD player and it complains that the resolution is not supported. This because it doesn’t have a CPU powerful enough to downscale your film to your TV’s resolution. I found this Video Conversion Guide which helped. You just need to figure out what your TV’s native resolution is, and try to match it. For example my TV is an old CRT PAL monster and the source is a 1280×720 video. The DVD player doesn’t support that resolution, but it is 16:9 ratio. We then convert the mkv to an avi to stay within the same ratio and play back on an old style PanScan CRT.

mencoder input.avi -ovc xvid -vf scale=648:364 -oac mp3lame -lameopts cbr:br=192 -xvidencopts pass=2:bitrate=-1400000:threads=4 -o output.avi

This converts the film 648:364, however you should keep in mind your TV’s resolution. The guide gives a better understanding and there is no need to repeat the information here.

Extract Subtitles From Dvd Ubuntu Download

DvdMedia

Rip Subtitles From Dvd

The end result should be a film for your USB in with a subtitle of your choice.