When using HandBrake, it found it quite a nice feature that it can recognize the correct movie name that is on a DVD (of course not all, but a lot). When using HandBrake CLI, I could not find an option to do that autodiscovery.

Did I miss something? How does the GUI do it? Any recommendations for getting the movie name from the commandline? It does not need to be HandBrake CLI, I can stitch it together myself.

For clarification of my question: I am not after the movie title number (as in the argument to the -t option), but after the movie name, as in "Lock, Stock and Two Smoking Barrels". The gui does recognize this, at least for some DVDs. How is that acomplished?


I have not found this feature in the CLI myself. According to this: https://forum.handbrake.fr/viewtopic.php?f=6&t=15874#p74897 (opens from Help->Guide in my Handbrake), Handbrake (GUI) by default selects the longest title as this is usually the main feature.

If you supply 0 to the -t option for CLI, it will list all the titles so that you can select the longest.

Another technique I have used is what is described in the solution section in the forum post above, simply start the DVD in VLC and then check which title is playing.

| improve this answer | |
  • I seem to have miss phrased my question ... What I was after was the name of the movie, like "The Simpsons Movie", "Lock, Stock and Two Smoking Barrels", ... I have updated my question. – Isaac Nov 27 '15 at 8:02

What I have been doing is to use `lsblk', i.e. (replace /dev/sr0 with the device file of your DVD device):

lsblk -n -o LABEL /dev/sr0

lsblk is part of util-linux (at least on Ubuntu), so it should already be installed.

If you wish to, you can process the label to make it nicer (like making it lowercase, changing underscores to dashes):

lsblk -n -o LABEL  /dev/sr0 | tr '[:upper:]' '[:lower:]' | sed -e 's/_/-/g'
| improve this answer | |

I finally found a solution with the help of the HandBrake Forum:

HandBrakeCLI --scan  -i /dev/sr0 | awk -F: '/DVD Title/ {print $3}' |python -c "import sys; print(sys.stdin.read().title().replace('_', ' '))" |head -1

So what this does is it filter libdvdnavs logoutput. Probably not a stable solution, because the log output of lbdvdnav is probably not to be considred a stable api. However it works for.

| improve this answer | |

or you could just do lsdvd LSDVD(1)

NAME lsdvd - read the content info of a DVD

SYNOPSIS lsdvd [ options ] [-t track_number] [dvd path]

DESCRIPTION An application for reading the contents of a DVD and printing the contents to your terminal and dump for further processing in external applications.

OPTIONS FOR EXTRA INFORMATION -a Dump information about audio streams.

   -d     Dump information about cells.

   -n     Dump information about angles (video layers).

   -c     Dump chapter information.

   -s     Dump subpicture information (e.g. subtitles).

   -P     Dump palette information.

   -v     Dump video information.

FORMATTING OPTIONS -Oh Dump output human readable (default setting).

   -Op    Dump output as a Perl hash. (Using -p is deprecated).

   -Oy    Dump output as Python.

   -Or    Dump output in Ruby format.

   -Ox    Dump output in XML.

: OTHER OPTIONS -h Display help.

   -q     Quiet output - do not summarize output.

   -V     Display version information.

LICENSE lsdvd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

AUTHORS lsdvd was written by Chris Philips.

   This manual page was written by Moritz Muehlenhoff <jmm@inutil.org> for the Debian GNU/Linux system (but may be used by others).
| improve this answer | |
  • This is not really an answer to the question. It is only an alternative. – zx485 Jan 20 '19 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.