Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Handbrake

  1. #1

    Handbrake

    Anyone using Handbrake on their VB for converting to MP4?

    I've found it really useful to convert movies with subtitles (foreign films or ones with forced subs) so they are hard coded into the movie.

    I created an automated background script, it lets me choose the output quality (normal or high), whether I want subtitles, and also if I want to shutdown the VB after encoding.

    I can queue several jobs to run overnight, and it's automatically switches off once all jobs have completed.

    If anyone wants a copy I can post the coding for you.

  2. #2
    Administrator andrew's Avatar
    Join Date
    Nov 2008
    Location
    New Hampshire
    Posts
    3,653
    Handbrake is great. It uses H264 which is very high quality for not a lot of space. I'm sure many users would be interested in your script. You can just post your script here. Click on advanced mode when you post. That will allow you to select the Code wrap (#) button so your code will be well formated in your post.

  3. #3
    Encoding take a long time on high profile (HP Microserver), but quality and filesize is great. Will post code later.

  4. #4

    Handbrake mkv2mp4 script

    Code:
    if [ -f "/storage/movies/$1.mkv" ]
    then
        case $2 in
        "-f")
            HandBrakeCLI --preset="High Profile" -i "/storage/movies/$1.mkv" -o "/storage/movies/mp4/$1.mp4" -N eng -s scan -F 1 --subtitle-burn
            shift
            ;;
        "-s")
            HandBrakeCLI --preset="High Profile" -i "/storage/movies/$1.mkv" -o "/storage/movies/mp4/$1.mp4" -N eng --subtitle-burn
            shift
            ;;
        "-n")
            HandBrakeCLI -i "/storage/movies/$1.mkv" -o "/storage/movies/mp4/$1.mp4"
            shift
            ;;
        "-hq")
            HandBrakeCLI --preset="High Profile" -i "/storage/movies/$1.mkv" -o "/storage/movies/mp4/$1.mp4"
            shift
            ;;
        *)
            HandBrakeCLI -i "/storage/movies/$1.mkv" -o "/storage/movies/mp4/$1.mp4"
            ;;
        esac
        sleep 10
        if [ "$2" == "-off" ]
        then
            if ps ax | grep -v grep | grep HandBrakeCLI > /dev/null
            then
                echo "$(date) - Another encoding jobs is already running."
            else
                echo "$(date) - No other encoding jobs are running, shutting down server in 1 minute."
                shutdown -hy 1
            fi
        fi
    else
        echo
        echo "Filename /storage/movies/$1.mkv does not exist!"
        echo
        echo "List of files in movies folder:"
        ls /storage/movies/*.mkv -1
        echo
        echo "Usage: nohup ./mkv2mp4 \"filename\" {switches} > /var/log/cdrip.log &"
        echo
        echo "Switches:"
        echo "    -n    Normal quality (default)"
        echo "    -hq    High quality"
        echo "    -s    High quality with english subtitles"
        echo "    -f    High quality with forced english subtitles"
        echo "    -off    Shutdown server after encoding (see note below)"
        echo
        echo "Notes:"
        echo "    * Please enter filename without .mkv extension"
        echo "    * Don't enter full path MKV files are picked up from /storage/movies"
        echo "    * You need to make sure you have a folder /storage/movies/mp4"
        echo "    * Output from cdrip.log can be monitored from the Web GUI (Ripping Status)"
        echo "    * If you are already ripping or encoding, choose a different log file name"
        echo "    * If running multiple jobs with the shutdown option, only the last job will shutdown"
        echo "    * Subtitles are always hard coded into the video stream"
        echo
    fi
    Last edited by mcdougc; 02-07-2012 at 01:29 PM.

  5. #5
    Here is the info on how to install Handbrake:

    http://info.vortexbox.org/tiki-index.php?page=HandBrake

  6. #6
    Senior Member waltonb's Avatar
    Join Date
    Sep 2011
    Posts
    156
    Cool, thanks for documenting this. I've been offloading the handbrake work to my quad-core laptop, which can render a DVD mkv to m4v in ~15 minutes. OTOH, a bluray rip takes a couple of hours. I've not tried it on my Microserver... 8 hours? yikes.

    I'll definitely try out your cmdline script, so far have only been using the gui, which is tedious.

    best -bruce.

  7. #7
    Any problems let me know, and I'll help if I can.
    I created a directory /storage/scripts and put it in there, also I store the output log files there.
    I can easily check progress by opening the log files from the SMB share.

    Wow that is quick! Was that on normal or high profile?

    My HP server is fairly quick on normal, high takes ages, but it's very convenient.

  8. #8
    Senior Member waltonb's Avatar
    Join Date
    Sep 2011
    Posts
    156
    Probably "normal", though I've been using the GUI version and I don't know how the default gui settings match up to those in the script. Maybe I'll even try some overnight batches and get some timings. I'm also interested in how the audio settings work out. I.e. DTS 5.1 surround, etc.

  9. #9
    I do recommend high profile over normal, picture quality is almost identical to source.

    If you want more control over sound, you can see all the switches for the various presets, and customise to your needs. I'm sure you would be able to convert DTS to another format.

    https://trac.handbrake.fr/wiki/BuiltInPresets

    https://trac.handbrake.fr/wiki/CLIGuide

  10. #10
    Senior Member Macross's Avatar
    Join Date
    Nov 2011
    Location
    Lake Forest, CA
    Posts
    668
    I tried this on some of my anime mkv's with subtitles, and I still get no subtitles in the mp4 file during playback on my sony media streamer. If anyone has some helpful hints I would really appreciate it. I would like to see some Cowboy Bebop subbed. I did use the subtitle encoding, but still nothing. TIA

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •