Coder Social home page Coder Social logo

docker-handbrake's Introduction

docker-handbrake

This is a Docker container for running HandBrake, a video encoder. The container features both a UI version of HandBrake, as well as a fully-automated version. In the automated version, you drop a file into a watch directory and the container will begin encoding it, putting the resulting file into the output directory.

This docker image is available on Docker Hub.

Usage

Interactive Method

To use this container for a user interface to HandBrake:

docker run --name=HandBrakeUI -e WIDTH=1280 -e HEIGHT=720 -p 3389:3389 -p 8080:8080 -v /path/to/movies/dir:/media:rw -v /path/to/config:/config:rw coppit/handbrake

In this mode, the /media path in the container is shared with the host, so put movies that you want to convert there. When you run the UI, save the output movies into the same directory so that you can access them in the host.

There are two ways to use the interactive user interface. One is to connect to the UI in your web browser with the URL http://host:8080/#/client/c/HandBrake. The second is to connect with a remote desktop client using port 3389. There are RDP clients for multiple platforms:

The second method is to point your web browser to http://:8080/. This will launch a web browser-based user interface.

Of course, if you change the host ports, then when you connect you'll have to specify the server as <host ip>:<host port>. Feel free to drop the 3389 mapping if you don't plan to use RDP, or the 8080 mapping if you don't plan to use the web browser.

Non-Interactive Method

If you want to run the container without a UI:

docker run --name=HandBrakeCLI --cap-add=SYS_NICE -v /path/to/watch/dir:/watch:ro -v /path/to/output/dir:/output:rw -v /path/to/config:/config:rw coppit/handbrake

In this mode, drop the files into /path/to/watch/dir, and they will be encoded into /path/to/output/dir.

Adding the flag --cap-add=SYS_NICE allows the container to run HandBrake at a lower priority.

Both Methods

You can also combine all of the flags into one big command, to support both the UI as well as the automated conversion.

docker run --name=HandBrake -e WIDTH=1280 -e HEIGHT=720 -p 3389:3389 -p 8080:8080 --cap-add=SYS_NICE -v /path/to/watch/dir:/watch:ro -v /path/to/output/dir:/output:rw -v /path/to/movies/dir:/media:rw -v /path/to/config:/config:rw coppit/handbrake

Configuration

After your container is launched the first time, a file called "HandBrake.conf" will be created in your config directory. Edit that file to change the settings that control how changes are detected in the watch folder, and how HandBrake is run. See the config file for documentation about the settings.

You can also configure these settings by setting environment variables when running the container (-e flag). Note that the environment values supercede the config file values.

With the default configuration, files written to the watch directory will be renamed and copied to the output directory. It is recommended that you do not overlap your watch and output directories when creating the container.

The USE_UI setting controls whether the user interface features are enabled. Set this to "yes" to enable the UI, which uses approximately 266MB of RAM at idle, as opposed to 31MB of RAM. On my machine it uses .16% CPU instead of .04% CPU.

Credits

This docker container was initially based on the sparklyballs/handbrake container.

docker-handbrake's People

Contributors

coppit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jason-bean

docker-handbrake's Issues

Monitoring stops detecting changes

Using configuration

SETTLE_DURATION=00:00:20
MAX_WAIT_TIME=00:20:00
IGNORE_EVENTS_WHILE_COMMAND_IS_RUNNING=1

I spam the watch folder with a few hundred files, and sometimes the SETTLE_DURATION is ignored, even though with debug = 1 I can see tons of inotify events triggering.

When conversion has begun and the watch folder is receiving more files, the conversion will just stop at some point and no new changes are detected, even after the container has finished existing conversions and is completely idle.

Triggering more changes at this point shows inotifys triggering, but that's all.

Running killall monitor.py inside the container wakes the detection up again and things continue working as expected (new changes trigger detection again).

Detect file changes in watch-folder over network fails

Hello,

on my docker machine I got a media-share folder mounted from my NAS with NFS. Now I wan't to push files to this folder with my main-pc but monitor.py won't detect the changes. So I need to change the file on the docker-machine with "mv xyz_12_03_2017.ts xyz.ts" to get HandBrake running automatically. Is it not possible to do or is there a bug with the nfs share?

Greets!

Black Screen Instead of UI

I am getting a black screen after selecting the Handbrake module in the xrdp popup. It goes through the connection messages and then I am dropped to a black screen.

USE_UI=true is in the config file.

permission of folder /media

Hi,
I tried this Container on my Synology NAS. But handbrake always gave the error unable to read folder.
So i had to login via Console and chmod 777 /media, using 755 showed all the files but did not let handbrake write anything.
There seems to be something wrong with the Permissions for folder /media and the user that runs Handbrake.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.