Splitting Chapters into separate files, automatically

Archive of historical feature requests.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
kurosawa
Posts: 2
Joined: Wed Nov 06, 2013 5:47 pm

Splitting Chapters into separate files, automatically

Post by kurosawa »

First I wanna thank you for your great software.

I want to rip my star trek collection but only have the ability to rip chapter after chapter manually or to make just one file.
Could you add a feature to make the rip, chapter by chapter into separate files, automatically? That would be great. Thanks.
GregiBoy
Veteran User
Posts: 908
Joined: Sat Feb 12, 2011 9:23 pm

Re: Splitting Chapters into separate files, automatically

Post by GregiBoy »

I think you are getting confused with terminology here.

On the disk should be held "Titles" which are each "Episode".

Within each "Title" there are "Chapters" which are usually time points within the "Title" that you can skip to.
kurosawa
Posts: 2
Joined: Wed Nov 06, 2013 5:47 pm

Re: Splitting Chapters into separate files, automatically

Post by kurosawa »

ok, i have to check this.

i recently ripped a music-video dvd and each video was listed as a chapter.

1. video = chapter 1
2. video = chapter 2

and so on.

edit:
damn. with my star trek dvd i can choose each episode through the title selection and rip it. thanks for the tip. problem solved...

edit2:
But... on the other hand I still have to set the Settings (audio, subtile) for each title.

edit3:
... i can set audio and subtitle in options.

i think a moderator can close/ delete this entry. thanks.
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

Having the ability to transcode DVD chapters into discrete files - as opposed to one big file with chapter markers - would be very helpful indeed.
Smithcraft
Veteran User
Posts: 2697
Joined: Thu Jan 22, 2009 8:04 pm

Re: Splitting Chapters into separate files, automatically

Post by Smithcraft »

That's why it's already in Handbrake.

SC
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

Smithcraft wrote:That's why it's already in Handbrake.

SC
Oh really?

While it certainly is the case that chapters can be extracted to separate files, this doesn't seem to be an automatic process. On the face of it, the only way to achieve this is by selecting the chapters from the drop-downs so as to queue them as individual jobs.

For a title with only a handful of chapters this is is probably okay. We however, are transcoding DVDs with upwards of 30 chapters per title; so using the GUI in this way becomes very tedious.

If there is a way to achieve this goal already then we can't find it - either by experimentation, in the help files, the wiki pages or elsewhere.

Maybe we didn't make ourselves totally clear - although the thread as a whole ought to have rounded out the picture (hence posting here instead of creating a new one), but glibly retorting without so much as even trying to understand or indeed, offering any pointers, really doesn't help anyone; which is why we are here in the first place.
Smithcraft
Veteran User
Posts: 2697
Joined: Thu Jan 22, 2009 8:04 pm

Re: Splitting Chapters into separate files, automatically

Post by Smithcraft »

Sorry, if it wasn't sufficient for you.

If the GUI doesn't offer the controls that you want, then you should consider using the CLI instead.

SC
hvisage
Posts: 1
Joined: Tue Dec 24, 2013 8:07 pm

Re: Splitting Chapters into separate files, automatically

Post by hvisage »

Smithcraft wrote:Sorry, if it wasn't sufficient for you.

If the GUI doesn't offer the controls that you want, then you should consider using the CLI instead.

SC
And today I'm encoding a music DVD and looking for this same function, though I'd be happy to do the CLI thingy, just, where can I get an "example" CLI command list from my current settings? Ie. the way I'm currently encoing, I'd like to have a CLI paramters list/line, which I can then massage accordingly?

Hope I make sense :(
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

hvisage wrote:
And today I'm encoding a music DVD and looking for this same function, though I'd be happy to do the CLI thingy, just, where can I get an "example" CLI command list from my current settings? Ie. the way I'm currently encoing, I'd like to have a CLI paramters list/line, which I can then massage accordingly?

Hope I make sense :(
As far as we can tell, there is no native support for this on the command line either. However, it is possible to write a script or batch file which cycles through title/chapters, using for example, a for/while loop.

This would represent a semi-automatic solution because the CLI doesn't provide for returning the number of titles or chapters as a distinct variable - which means having to use either CLI or GUI to ascertain these initially, followed by passing them to the script/batch as arguments (which again could be flawed because bounds checking would be impossible).
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Splitting Chapters into separate files, automatically

Post by s55 »

The Scan outputs all the chapters. Others have written scripts based on scan output before, there may be examples kicking around the forum.

Either way, This kind of thing is out of project scope. We'd really need an editing interface and that's not really the goal of HandBrake.
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

s55 wrote: Either way, This kind of thing is out of project scope. We'd really need an editing interface and that's not really the goal of HandBrake.
We're unsure if that statement makes sense or not. Given that Handbrake already offers the ability to extract material on a title or time period basis (with resultant jobs queued accordingly), why not just add the option to cater for chapters also? Surely this is just an 'extension' of the existing use-case?
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Splitting Chapters into separate files, automatically

Post by s55 »

If we added every "extension" users asked for, there would thousands of buttons/menus littered all over the UI. (Particularly when it's not a common request)

If we were to do something like this, it would have to be a simple but flexible system that's going to cater for many many use cases and that's something that takes more time and interest than we have.
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

s55 wrote: If we added every "extension" users asked for, there would thousands of buttons/menus littered all over the UI. (Particularly when it's not a common request)
This is not an extension request per se; we're not asking for anything brand new. The request is merely to make using an already existing feature more accessible and more effective. :cry:
s55 wrote: If we were to do something like this, it would have to be a simple but flexible system that's going to cater for many many use cases and that's something that takes more time and interest than we have.
:o Is it really that much work? Handbrake already handles 'single title to single file' without a problem.

Naturally the Handbrake team will decide what they want to do - either way, we are pleased just to have it. Yet nonetheless, it seems a feature that is in high enough demand (as 5 mins on Google will show) and is certainly supported by other, less worthy transcoders.

Thanks for listening. 8)
OchoHa
Posts: 1
Joined: Thu Dec 26, 2013 1:13 pm

Re: Splitting Chapters into separate files, automatically

Post by OchoHa »

It's pretty easy on the command line (I presume you're using bourne shell, or similar):

Code: Select all

for n in {1..30} ; do HandBrakeCLI [options] -c ${n} ; done
Where [options] contains your input device, output file, titles, and your presets and tuning options.
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

Thanks for the reply but unfortunately this won't work for me as I am in PC land... :-(
ty2010
Novice
Posts: 72
Joined: Mon Feb 18, 2013 7:09 am

Re: Splitting Chapters into separate files, automatically

Post by ty2010 »

xanda wrote:(which again could be flawed because bounds checking would be impossible).
No bounds checking needed, if it's not there, it won't code it unless you explicitly tell it to. I do excessively long batches of varied stuff but I'm also lazy so I use this to my advantage. :P

For excessive titles or chapters to be individually coded I spit out my bare bones spread sheet template, which is basically AB(#1-100)CD(#1-100)EF on individual lines. I open it with notepad and replaceall AB, CD and EF with appropriate sections of code.

Example:

set HB="C:\Program Files\Handbrake\HandBrakeCLI.exe"

for /d %%a in (*) do start "encode" /b /low /wait %HB% -i "%%a" -t # -o "x:\x\%%a-t#.mkv" -m -f mkv --vidsettings -e x264 -settigns -a 1,2,3,4,5,6,7,8,9 -E faac(or other single format) -settings subtitle 1,2,3,4,5,6,7,8,9,10 -x settings:settings

This will spit out MKV files in directory x:\x with files labeled by directory name appended by -t#, # being the 1-100. All subtitles up to 10 will be saved as well as up to 9 audio tracks in the SINGLE format selected, it gets messy when multiple formats are used. Using the single audio format like this it will only put out as many tracks as there were in the original and will ignore the extras listed. This is the format I use for DVDs in folders on the media server to convert.

The exact same method can be used for chapters, -c# instead of -t#. If there are multiple titles this can be manually added/changed with the replaceall in notepad for 2 or 3 or it can be incorporated in the original number listing spread sheet. All can be spit out directly from the spread sheet but it's a little more of a pain for making tweaks as notepad loads and saves faster without excess prompts.

DOS memory for batches can run out but I haven't purposely tested that, I suspect if you tried 100 titles in combination with 100 chapters each with a lot of settings it could happen. Usually disks are title heavy or things you would want individual chapter heavy. I've run 10 title +40 chapters each for those I wanted individual chapter files without trouble and haven't run into a disk where I've needed to up it yet.

I tried loops with varying success, sometimes they don't want to go or do unpredictable things when small modifications are made, particularly when nested. Cut paste n go is a little clunky but it's flexible and reliable.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Splitting Chapters into separate files, automatically

Post by mduell »

xanda wrote:If there is a way to achieve this goal already then we can't find it - either by experimentation, in the help files, the wiki pages or elsewhere.
A trivial shell/batch script is probably your best bet.
hvisage wrote:And today I'm encoding a music DVD and looking for this same function, though I'd be happy to do the CLI thingy, just, where can I get an "example" CLI command list from my current settings? Ie. the way I'm currently encoing, I'd like to have a CLI paramters list/line, which I can then massage accordingly?
Since it sounds like you're a windows user, you can start with the CLI command shown at the top of the encoding log for a similar encode.
xanda wrote:This is not an extension request per se; we're not asking for anything brand new. The request is merely to make using an already existing feature more accessible and more effective.
The automation you're requesting is an extension of the existing user interface, requiring both design work and space for this feature.
Kador
Posts: 1
Joined: Fri Jan 09, 2015 12:01 pm

Re: Splitting Chapters into separate files, automatically

Post by Kador »

Hello

I second the people who asked for this feature. Even if it's possible to split chapters into separate files using cli, it should be great to have a simple checkbox "New file for each chapter". As everything is already in the code, it shouldn't be hard to implement.

Again, Cli is ok, but not for everybody, and saying "just use the cli" as an answer to requests, makes me thinking "then, why is there a gui after all ?". Your choice :-)

Thanks for reading.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Splitting Chapters into separate files, automatically

Post by mduell »

Kador wrote:I second the people who asked for this feature. Even if it's possible to split chapters into separate files using cli, it should be great to have a simple checkbox "New file for each chapter". As everything is already in the code, it shouldn't be hard to implement.
Great, can we expect your patch for all 3 platforms on reviewboard on Monday?
Kador wrote:Again, Cli is ok, but not for everybody, and saying "just use the cli" as an answer to requests, makes me thinking "then, why is there a gui after all ?"
I ask the same thing all the time.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Splitting Chapters into separate files, automatically

Post by Woodstock »

GUI works for a large percentage of the things most people want to do. But it doesn't do EVERYTHING, because the screen would be so busy no one would be able to find those things they "normally" need to do.

Frankly, automating extraction of single chapters into individual files falls outside that "most people do" criteria. It's also simple to do with a batch/shell script calling the CLI... as shown in the example above.
Deleted User 11865

Re: Splitting Chapters into separate files, automatically

Post by Deleted User 11865 »

Or manually, if you do it for only a few discs…
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

Woodstock wrote:GUI works for a large percentage of the things most people want to do. But it doesn't do EVERYTHING, because the screen would be so busy no one would be able to find those things they "normally" need to do.

A suitably vague and typically dismissive reply which basically amounts to 'we can't be bothered'. Our guess is that you are a professed software engineer, right? Maybe even involved in the project itself, or at least acting on their behalf. This would also explain the references to 'most people' and 'normal' use.

Woodstock wrote:
Frankly, automating extraction of single chapters into individual files falls outside that "most people do" criteria. It's also simple to do with a batch/shell script calling the CLI... as shown in the example above.

Frankly, this isn't an answer. Nor is it even a reason. And if it were, it wouldn't - and indeed doesn't - cut any ice. Yet condescending it certainly is. How so? In saying it falls outside that "most people do" criteria, has it occurred to the 'Team that most people don't do it precisely because the tool just doesn't help them to? Ergo if it did then more people would?

Stepping back to consider (a) what is being asked for and (b) what the response has been to date and (c) why on earth it has taken a forum post this long, and with the level of interest it has attracted, to result in precisely nothing, this is what we observe from our perspective:-

a) An additional option to rip file/chapter. Oh sure, the GUI would be hideously complex to have this option as a radio button or checkbox - wouldn't it? Not at all. According to one of the Handbrake team, in an earlier posting, this is already supposed to be available anyway; in our view, the GUI needs a bit of spit'n'polish to make it truly accessible/usable - that's all.

b) Write yourself a script. Excuse us? Considering that:-
  • Those that could do this DON'T need Handbrake period, GUI or not.
  • For those that would try, Handbrake doesn't help in its failure to provide basic return variables (such as number of chapters/titles etc.) to the shell, so that a robust and convenient control loop might be derived. If it did, at least then some kind & clever person could write a single script (per platform), whereby a single file or directory could be transcoded from a simple CLI invocation and with a limited (or better still, none whatsoever) knowledge of the source material i.e. hands-up anyone who wants to sift through all the chapters and titles beforehand to write a script..? :shock: No, we didn't think anyone would take that either...
  • Not to be overlooked: those that can't (which might actually be the vast majority of Handbrake GUI users/customers and among whom we include ourselves): this is way too far off the reservation to contemplate.
c) The Handbrake team's reticence to provide this capability (note the absence of the non-word 'functionality') has never been based on any reasoning that's sound or credible; at least none that has been shared in this forum anyway. As for the assertion that 'most people won't want to do this kind of thing', this is not just risible but insulting. How so? Because this thread has had a long enough shelf-life to counter that argument; 5 mins on Google would counter it also; common sense trumps both of these anyway as a sound reason for simply getting on with it.

It is not our way to vent in such a manner toward those who willingly provide such a service, without charge and for the good of others. But there is a problem here with an attitude towards the end-users which may, we hate to say, eventually lead to Handbrake's raison d'être being eroded to a considerable degree.

We love Handbrake and are still grateful to have it. Like the Handbrake team, we too give of our time and expertise to charitable causes for which Handbrake is vital - no we are not using Handbrake to rip our own DVD collection for our own pleasure (we don't need or want to).

However, not having this feature is akin to riding a motorcycle with only one handlebar - perhaps doable, but very unpleasant. What exacerbates the whole scenario is putting proverbial 'pen to paper' here, with the time and effort required, only to be knocked back with apparent indifference and, dare we say it, half-truths.

This feature would really set Handbrake apart and, in our opinion, open it up to a much much wider audience. Please Handbrake Team, please reconsider.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Splitting Chapters into separate files, automatically

Post by mduell »

a) The GUIs are largely a disaster. The spaghetti has gotten slightly less angry over the last year, but they're far away from good.

Adding this feature, and the 100 other features of similar appeal ("I want to split every 10 minutes...", "I want to split every time the screen turns black for more than a second...", "I want to split every x minutes, but only if the title is longer than 3x minutes...", etc), is not a positive change on the whole.

I'm a CLI user because of the GUIs. See VidCoder for an attempt at an alternative to the official GUIs.

b) First bullet is ridiculous; being able to parse the chapters out of the scan log with a script is a far cry from not needing HB.

Second bullet, all the chapter information is in the scan log; it's well formed enough you could regex it out without much issue.

Third bullet, no doubt. But the limited audience this appeals to could learn with a bit of effort on their end.

c) Yea, it's some secret conspiracy by the HB team against the dozen people in this thread who want the feature. I think you sorely misunderstand how HB development works: the developers work on features and bugs they find interesting and want to work on.

It doesn't matter if you're using HB to save starving orphan puppies or encode violent [Censored] for profit. HandBrake's raison d'être is video encoding for the contributors to HB.

Your motorcycle analogy is comically off target, and bordering on actually offensive.
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Splitting Chapters into separate files, automatically

Post by s55 »

Just to be clear, anyone who doesn't have a "Contributor" rank on the forum, doesn't officially speak for the project. Don't assume because someone says something, it's official word.
xanda
Posts: 11
Joined: Sat Apr 16, 2011 12:00 pm

Re: Splitting Chapters into separate files, automatically

Post by xanda »

mduell wrote: a) The GUIs are largely a disaster. The spaghetti has gotten slightly less angry over the last year, but they're far away from good.
So what you're saying is: because other GUIs have made a hash, then HB is not going to bother.
mduell wrote: Adding this feature, and the 100 other features of similar appeal ("I want to split every 10 minutes...", "I want to split every time the screen turns black for more than a second...", "I want to split every x minutes, but only if the title is longer than 3x minutes...", etc), is not a positive change on the whole.
This is not a new response either. Nobody here is asking for anything remotely like what has been described here. If the world+dog wants to get in the queue and ask for things like this, well fine, tell them 'yay or nay' as required. But that's not what we're asking for here. We are asking for this request and this request alone, and as previously stated, it's something that should have been there from the onset.
mduell wrote: b) First bullet is ridiculous; being able to parse the chapters out of the scan log with a script is a far cry from not needing HB.
Not true. Anybody who is able to develop a shell/DOS script to such a degree can easily turn to the wealth of other CLI tools such as transcode, ffmpeg etc. The point here is this: good as these are, other users who're not blessed with such skills are indeed intimidated by trying to work out the complexities of the command-line options. So they turn to Handbrake instead because of its GUI.
mduell wrote: Second bullet, all the chapter information is in the scan log; it's well formed enough you could regex it out without much issue.
The scan log is indeed formed clearly and yes it's possible to regex the data to get something useful.
But without much issue? We tried (and tried and tried and tried) but never got anywhere approaching useful let alone successful - and that despite all the kind help offered. Clearly we don't have the acumen for this (sorry about that). If we did, and had been successful, then we'd have willingly fed it back via a forum like this; hence our requests here for the feature to be presented as standard. And for the sake of repetition: this again, is why those unfortunate not to have these abilities are asking for it in the first instance.
mduell wrote: Third bullet, no doubt. But the limited audience this appeals to could learn with a bit of effort on their end.
They could could they? This assumes that scripting and coding is within everyone's grasp regardless of their circumstances. If that is true, then why all the repeated requests for this, both here and elsewhere? And too, despite all the guidance both here and in coding forums elsewhere.

BTW
mduell wrote:the limited audience this appeals to
is patently inaccurate also.
mduell wrote: c) Yea, it's some secret conspiracy by the HB team against the dozen people in this thread who want the feature. I think you sorely misunderstand how HB development works: the developers work on features and bugs they find interesting and want to work on.
Nobody ever said anything about conspiracy - until now at least.
But now we get to the crux of the matter: HB team just don't want to do it. Clearly they feel it beneath them. For all the arguments about levels of demand and the supposed ease of writing scripts etc., what it boils down to is: "we can't be bothered and we don't want to help".

"Nobody ever wants to sweep the streets but the streets still need sweeping all the same"
mduell wrote: It doesn't matter if you're using HB to save starving orphan puppies or encode violent [Censored] for profit.
HandBrake's raison d'être is video encoding for the contributors to HB.
Does this imply that non-advanced users are not contributors to HB?
If that is so, then this statement is tantamount to an admission that, as far as the HB team are concerned, unless a user is already a competent person from their perspective, they simply won't qualify to receive anything from this project.

Well if that is the the case, maybe the rest of us ought just go away and stop bothering the HB team then?
mduell wrote: Your motorcycle analogy is comically off target, and bordering on actually offensive.
Is that a fact now? Perhaps you ought try transcoding material which is split into a dozen titles with an excess of 30 titles each (some as many as 60+). Then you'll have some understanding of why the motorcycle analogy is more apt than you might think. And yes, I have done both in real life.
Locked