Handbrake CLI looping through TV episodes on DVD ISO

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
stealthrt
Posts: 2
Joined: Sat Sep 25, 2021 8:54 pm

Handbrake CLI looping through TV episodes on DVD ISO

Post by stealthrt »

HandBrake 1.4.1
Windows 10 20H2 x64
No logs needed at this time

Hey all I am trying to figure out how to go about using the Handbrake CLI tool to get the different episodes/titles/chapters from my ISO DVD. I can see them in the handbrake GUI and all but I am wanting to automate so that I don't have to keep renaming each episode before it can encode it. Currently it just tells me that it will have the same name as all the other files

Image

Image

Image

Even when I tell it to rename each file by its title and it's chapter name:

Image

So this is why I want to get this same functionality but using the CLI instead. However, I am not really seeing where I can use a loop to get each chapter, encode it, then move to the next chapter and do the same thing.

Looking at the documentation I can see it has a place with the chapter listings:

Code: Select all

Source Options
---------------------------------------------------------------

   -i, --input <string>Set input file or device ("source")    -t,
  --title <number>     Select a title to encode (0 to scan all titles
                       only, default: 1)
   --min-duration      Set the minimum title duration (in seconds).
                       Shorter titles will be ignored (default: 10).
   --scan              Scan selected title only.
   --main-feature      Detect and select the main feature title.    -c, --chapters <string> Select chapters (e.g. "1-3" for chapters
                       1 to 3 or "3" for chapter 3 only,
                       default: all chapters)
   --angle <number>    Select the video angle (DVD or Blu-ray only)
   --previews <number:boolean>
                       Select how many preview images are generated,
                       and whether to store to disk (0 or 1).
                       (default: 10:0)  
   --start-at-preview <number>
                       Start encoding at a given preview.    
   --start-at <string:number>
                       Start encoding at a given offset in seconds,
                       frames, or pts (on a 90kHz clock)
                       (e.g. seconds:10, frames:300, pts:900000).
                       Units must match 
   --stop-at units, if specified.    
   --stop-at  <string:number>
                       Stop encoding after a given duration in seconds,
                       frames, or pts (on a 90kHz clock) has passed
                       (e.g. seconds:10, frames:300, pts:900000).
                       Duration is relative to 
   --start-at, if specified.
                       Units must match 
   --start-at units, if specified.
And using this command:

Code: Select all

handbrakecli.exe -i "V:\shows\A SERIES\A SERIES VOLUME 1\A_SERIES_DISC1.iso" -t 0
I get ALOT of data but mainly I want to find how many chapters it has and it does display that within the plethora of data it spits out:

Code: Select all

 + chapters:
    + 1: duration 00:22:20
    + 2: duration 00:22:21
    + 3: duration 00:22:24
    + 4: duration 00:22:17
    + 5: duration 00:22:19
    + 6: duration 00:22:24
    + 7: duration 00:22:16
And that is where I am stuck at. I'm not sure of the command to get each of those titles individually and encode them and just keep looking until it reaches the end.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Handbrake CLI looping through TV episodes on DVD ISO

Post by Woodstock »

Not all DVDs are mastered the same. Even within a series, the number of titles and chapters per title can vary widely. A series like the anime Bleach, which has 366 episodes spread over 90+ DVDs, used at least 4 different layouts over the releases of disk sets, differing in number of episodes per title, chapters per episode, and even including "single episodes per title" and "multiple episodes per title" on a single disk.

Automating that in a generalized manner will be a daunting task.

There are other tools available that can do the "splitting" portion for you, then you can deal with a simpler automation of the encoding.
stealthrt
Posts: 2
Joined: Sat Sep 25, 2021 8:54 pm

Re: Handbrake CLI looping through TV episodes on DVD ISO

Post by stealthrt »

thanks for the info, Woodstock.
Post Reply