Forums » Tutorial and setups »
Handbrake Post-Processing ???
Added by Chris P. about 12 years ago
Hi,
I'd like to post process the recorded mkv to m4v using the handbrake appletv 3 preset.
Anyone know if the post processing works under Ubuntu 12.04? Anyone know of a working command line for this?
Kryspy
Replies (2)
RE: Handbrake Post-Processing ??? - Added by Fabian Rodriguez about 12 years ago
Hi,
I am trying the same except for Android. Here is what works for me from command line:
/usr/bin/HandBrakeCLI -Z "Android High" --no-dvdnav -O -s 1 -i input_file.ts -o output_file.mp4
You can replace "Android High" with your preset ("AppleTV 3"). I used --no-dvdnav to avoid DVD analysis, -O to enhance for streaming, -s 1 to make usre the first subtitle (CC captioning) is kept.
I've made sure "Replace whitespace in title with '-'" is checked in the digital recorder preferences too.
The above in the post-processing command field becomes this:
/usr/bin/HandBrakeCLI -Z "Android High" --no-dvdnav -O -s 1 -i %f -o /home/hts/Android/%b.mp4
Unfortunately this results in .ts.mp4 extensions (%b includes the extension, I could strip this on a script but I am not there yet). I don't mind that for now.
My problem is .mp4 files generated from the post-processing command are not valid! They are also suspiciously small (<~20K). When I run the same manually, it works.
I tried going via a script, the same happens.
Hopefully other people can clarify this, I must be missing a tiny detail.
RE: Handbrake Post-Processing ??? - Added by Alex . almost 12 years ago
Hi,
Fabian Rodriguez wrote:
My problem is .mp4 files generated from the post-processing command are not valid! They are also suspiciously small (<~20K). When I run the same manually, it works.
I experienced a similar thing using ffmep: I put /usr/bin/ffmpeg -y -i "$1" -b 1000000 -ac 2 "$1.mpeg"
in a script, and the script works fine when run from a shell.
However, it does not work when initiated from tvheadend post-processing; only first 12 seconds are converted; It appears FFMEP stops when there is no outputscreen.
Addin dev/null to the command the following solved the problem for me:
/usr/bin/ffmpeg -y -i "$1" -b 1000000 -ac 2 "$1.mpeg" </dev/null >>/opt/tvheadend/home/convert.log 2>&1
(note that I added a custom logfile to check the output, located at /opt/tvheadend/home)
Guess something similar might be going on in yur case.
Alex.
PS:
Unfortunately this results in .ts.mp4 extensions (%b includes the extension, I could strip this on a script but I am not there yet). I don't mind that for now.
Using %b in the command give the entire filename, using %t gives only the filename without extension ( but I did not implement that in above script)
See http://www.lonelycoder.com/redmine/projects/tvheadend/wiki/Tvheadend_post_recording_scripts