Handbrake-CLI on Synology NAS in Docker

I set up Docker on my Synology NAS (DS415+) and attempted to execute the handbrake-cli (via this package) through SSH. However, it seems that something is malfunctioning. After running the command sudo docker run -d supercoder/docker-handbrake-cli -i ~/_inProgress/input/movie.mkv -o ~/_inProgress/output/test.mp4, I received the following error message (I’ve abbreviated it for clarity):

hb_init: starting libhb thread
HandBrake 0.10.1 (2015030800) – Linux x86_64 – https://handbrake.fr
4 CPUs detected
Opening /var/services/homes/xxx/_inProgress/input/movie.mkv…
CPU: Intel(R) Atom(TM) CPU C2538 @ 2.40GHz
Intel microarchitecture Silvermont
logical processor count: 4
OpenCL: library not available
hb_scan: path=/var/services/homes/xxx/_inProgress/input/movie.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /var/services/homes/xxx/_inProgress/input/movie.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /var/services/homes/xxx/_inProgress/input/movie.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(/var/services/homes/xxx/_inProgress/input/movie.mkv) failed
bd: not a bd – trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can’t stat /var/services/homes/xxx/_inProgress/input/movie.mkv
No such file or directory
libdvdread: Could not open /var/services/homes/xxx/_inProgress/input/movie.mkv
libdvdnav: vm: failed to open/read the DVD
dvd: not a dvd – trying as a stream/file instead
hb_stream_open: open /var/services/homes/xxx/_inProgress/input/movie.mkv failed
scan: unrecognized file type
libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.
I initially followed this blog post and encountered the same issue.
Interestingly, running the same command on my desktop works seamlessly. Any suggestions on how to resolve this issue?

Solution of the problem

When executing the Docker instance, ensure that your input and output files are present within the container. To achieve this, you must initially mount the input and output directories of your file system as volumes, as demonstrated in the blog post you provided:

-v ~/_inProgress/output/:/output:rw
-v ~/_inProgress/input/:/input:ro

Subsequently, utilize these paths in the options:

-i /input/<file>
-o /output/<file>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top