HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

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
DoubleTroubleTriple
Posts: 5
Joined: Mon Aug 10, 2015 12:28 am

HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by DoubleTroubleTriple »

I have a Windows 7 x64 system running Windows Media Center and I am wanting to compress the recordings to a more manageable size.

I am currently using Dirmon2 to pull subtitles out of these recordings ... Dirmon2 monitors the recording folder ("F:/Recorded TV") and after a recording is complete, Dirmon2 runs an instance of ccextractorwin.exe (which pulls out the subtitles and deposits an SRT file in the same directory as the original recording).

My thought was to then have Dirmon2 (which allows for command line options) to then run an instance of HandBrake to take the original .wtv file and shrink it into the default .mp4 format (the recordings are standard definition), but I'm unsure of the command line options to get this to work.

I just want to get the base functionality to work (i.e., "-i source -o destination") and then I will tweak the HandBrake settings/options as needed.

How might this work with my recording directory being "F:/Recorded TV" and then I would like to output the compressed files to "G:/Processed"?

(Not sure of the correct location for this question (Windows or CLI) so I am cross-posting. Hopefully this isn't an issue and my apologies if it is.)
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by mduell »

Double posting certainly isn't the answer.

viewtopic.php?f=11&t=32953
DoubleTroubleTriple
Posts: 5
Joined: Mon Aug 10, 2015 12:28 am

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by DoubleTroubleTriple »

Thanks for the response. As noted in the comment you responded to:
(Not sure of the correct location for this question (Windows or CLI) so I am cross-posting. Hopefully this isn't an issue and my apologies if it is.)
Should a CLI question only go in the CLI forum? Or should Windows-based questions that are about the CLI only go in the Windows forum? I checked the FAQ and read through the posting guidelines and didn't see this addressed. My intent wasn't to cause conflict with a double-post.

My apologies.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by BradleyS »

No worries, I locked the duplicate. In the future, just put it where you think it makes sense and if needed, a moderator can move it. This is better than duplicates. In this case, CLI is fine.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by BradleyS »

If you're looking for HandBrake to add the SRT, you probably want something like:

Code: Select all

HandBrakeCli.exe -i "F:/Recorded TV/name" --srt-file="F:/Recorded TV/name.srt" -o "G:/Processed/name.mp4"
There are additional SRT options such as --srt-codeset, --srt-lang, --srt-default, and --srt-burn. The first two control the character encoding and language, default controls whether the subs are displayed by default on playback, and burn makes the subs part of the video itself (no subtitle track). The CLI help has extended information on these options (--help).

For example: if your extractor uses UTF-8 encoding instead of latin1, your subtitles are in English, and you want them to display automatically (in players that support this):

Code: Select all

HandBrakeCli.exe -i "F:/Recorded TV/name" --srt-file="F:/Recorded TV/name.srt" --srt-codeset="UTF-8" --srt-lang="eng" --srt-default -o "G:/Processed/name.mp4"
Unless you employ some clever scripting, you'll probably end up with file names like name.wtv.mp4, which may be just fine.
DoubleTroubleTriple
Posts: 5
Joined: Mon Aug 10, 2015 12:28 am

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by DoubleTroubleTriple »

Thanks for the response.

The current process I am using to pull out subtitles (running an instance of ccextractorwin.exe) is sufficient for now. I may eventually drop ccextractor and use HandBrake for subtitles too, but until I can get HandBrake to work, I need to keep ccextractor in the mix.

Once I can get HandBrake to produce smaller files that are more suitable for archival storage, then I can also use it for the subtitle piece.
BradleyS wrote:Unless you employ some clever scripting, you'll probably end up with file names like name.wtv.mp4, which may be just fine.
Yes, this is one of the issues I'm having ... file names. I neglected to expound upon this in my initial post, but this is the crux of my issue. I would prefer to keep the file name of the original file but obviously it will now be smaller in size and carry a .mp4 extension. Dirmon2 will wait until a recording is complete and then it will run an instance of ccextractor (pulling out the subtitles) and then I want to run an instance of HandBrake for the making-the-file-smaller process (keeping the original file as I use them for a few weeks before eventually discarding the original for the compressed copy that is kept for long term storage).

But I'm not sure how to automatically call HandBrake from within Dirmon2 in a way that uses the original file name.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by mduell »

That would be a question for the Dirmon2 support, not HB.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by BradleyS »

DoubleTroubleTriple wrote:The current process I am using to pull out subtitles (running an instance of ccextractorwin.exe) is sufficient for now. I may eventually drop ccextractor and use HandBrake for subtitles too, but until I can get HandBrake to work, I need to keep ccextractor in the mix.
I must have misunderstood your question. Are you not looking for help with subtitles? Or just general CLI help? Hopefully I've answered your questions; if not, please clarify and I'll try to help further.
DoubleTroubleTriple wrote:I'm not sure how to automatically call HandBrake from within Dirmon2 in a way that uses the original file name.
See mduell's response.
DoubleTroubleTriple
Posts: 5
Joined: Mon Aug 10, 2015 12:28 am

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by DoubleTroubleTriple »

ccextractor doesn't require a file name element in the command line options of Dirmon2 ... whereas this is required for HandBrake, so that is why I was thinking this is something y'all might be able to help with.

This looks to be why someone created the MCEBuddy application as it does what I am ultimately after (monitors a Windows Media Center recording folder and then automatically runs HandBrake to compress the file as needed) -- but it is a bit of a clumsy solution on its own and I was hoping to get the same results through a Dirmon2/HandBrake solution directly.

Oh well. Thanks for the help.
AlBundy
Bright Spark User
Posts: 377
Joined: Mon Dec 31, 2012 4:47 am

Re: HandBrake CLI options for Dirmon2 (monitoring a Windows Media Center recording folder)

Post by AlBundy »

Post Reply