[Support] Djoss - HandBrake


Recommended Posts

21 hours ago, CrunchyToast said:

Hello, a couple quick questions here:

  1. Is it possible to ignore already existing files in the /watch directory?
  2. Is it possible to grab a file, have it converted then put back in the same location as the source file? I received an error of "already exists" when trying this. My goal would be to just convert new files and just leave the existing ones.

Thanks.

Having the output and watch folders pointing to the same location is not a supported scenario.  You are better to set the output folder to where your existing files are.  Then put the new files in the watch folder.

Link to comment
39 minutes ago, Djoss said:

Having the output and watch folders pointing to the same location is not a supported scenario.  You are better to set the output folder to where your existing files are.  Then put the new files in the watch folder.

I've been using SpaceInvader's method of converting and importing, but I run into a couple issues. If conversion takes too long Radarr or Sonarr stop looking for the file and I have to import manually. Plus I have to wait a while to watch it unless I convert it later. 

 

I was hoping to find a solution where I could allow Radarr or Sonarr to import the movie, copy to a temp directory then overwrite the original. In my case, transcoding a movie takes longer than watching one. 

 

I will inquire on that post. Thank you. 

Link to comment
13 minutes ago, CrunchyToast said:

I was hoping to find a solution where I could allow Radarr or Sonarr to import the movie, copy to a temp directory then overwrite the original. In my case, transcoding a movie takes longer than watching one. 

You could do this by using post-conversion hook (https://github.com/jlesage/docker-handbrake#hooks).  Use a different/independent output folder and use the hook to move the file to its final location, overwriting the original one.

Link to comment
2 hours ago, Djoss said:

You could do this by using post-conversion hook (https://github.com/jlesage/docker-handbrake#hooks).  Use a different/independent output folder and use the hook to move the file to its final location, overwriting the original one.

I didn't think of that right off the bat. Next problem I would have is once Radarr imports the video file, it renames it. Any idea the best path to overwrite the renamed file? I know I would have to retrieve the new name, but I can't think of how... I think I'd have to create a post process script in Radarr to have it write the new name to a file then this processing script can read the file and overwrite it. 

Link to comment
7 hours ago, CrunchyToast said:

I didn't think of that right off the bat. Next problem I would have is once Radarr imports the video file, it renames it. Any idea the best path to overwrite the renamed file? I know I would have to retrieve the new name, but I can't think of how... I think I'd have to create a post process script in Radarr to have it write the new name to a file then this processing script can read the file and overwrite it. 

Can you use the Radarr's post processing script to copy the (already renamed) file to HandBrake's watch folder?

Link to comment

Hi,

 

I am runnung this docker on a 2950X Threadripper but the docker is barely pressuring any of the 16 cores resulting in approx 30fps HEVC encoding compared to 55fps I get on my 8700K

 

The cores/threads usage according to unraid is very low, any ideas?

 

image.png.cc04677c0da28cbddada959e28ce92dd.png

 

 

autovideoconverter] Encoding: 3.80 % (27.03 fps, avg 29.04 fps, ETA 00h48m21s)
[autovideoconverter] Encoding: 3.84 % (33.93 fps, avg 29.17 fps, ETA 00h48m06s)
[autovideoconverter] Encoding: 3.90 % (40.49 fps, avg 29.34 fps, ETA 00h47m48s)
[autovideoconverter] Encoding: 3.90 % (40.49 fps, avg 29.34 fps, ETA 00h47m48s)
[autovideoconverter] Encoding: 3.98 % (42.86 fps, avg 29.52 fps, ETA 00h47m28s)
[autovideoconverter] Encoding: 4.04 % (47.41 fps, avg 29.64 fps, ETA 00h47m16s)
[autovideoconverter] Encoding: 4.08 % (41.80 fps, avg 29.67 fps, ETA 00h47m11s)
[autovideoconverter] Encoding: 4.13 % (37.09 fps, avg 29.73 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.16 % (30.93 fps, avg 29.70 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.16 % (30.93 fps, avg 29.70 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.18 % (25.92 fps, avg 29.63 fps, ETA 00h47m12s)
[autovideoconverter] Encoding: 4.23 % (23.44 fps, avg 29.61 fps, ETA 00h47m13s)
[autovideoconverter] Encoding: 4.23 % (23.44 fps, avg 29.61 fps, ETA 00h47m13s)
[autovideoconverter] Encoding: 4.28 % (27.78 fps, avg 29.66 fps, ETA 00h47m07s)
[autovideoconverter] Encoding: 4.31 % (28.71 fps, avg 29.60 fps, ETA 00h47m11s)
[autovideoconverter] Encoding: 4.36 % (30.25 fps, avg 29.62 fps, ETA 00h4

 

 

[cont-init.d] 00-app-script.sh: exited 0.
[cont-init.d] 00-app-user-map.sh: executing...
[cont-init.d] 00-app-user-map.sh: exited 0.
[cont-init.d] 00-clean-logmonitor-states.sh: executing...
[cont-init.d] 00-clean-logmonitor-states.sh: exited 0.
[cont-init.d] 00-clean-tmp-dir.sh: executing...
[cont-init.d] 00-clean-tmp-dir.sh: exited 0.
[cont-init.d] 00-set-app-deps.sh: executing...
[cont-init.d] 00-set-app-deps.sh: exited 0.
[cont-init.d] 00-set-home.sh: executing...
[cont-init.d] 00-set-home.sh: exited 0.
[cont-init.d] 00-take-config-ownership.sh: executing...
[cont-init.d] 00-take-config-ownership.sh: exited 0.
[cont-init.d] 00-xdg-runtime-dir.sh: executing...
[cont-init.d] 00-xdg-runtime-dir.sh: exited 0.
[cont-init.d] 10-certs.sh: executing...
[cont-init.d] 10-certs.sh: exited 0.
[cont-init.d] 10-cjk-font.sh: executing...
[cont-init.d] 10-cjk-font.sh: exited 0.
[cont-init.d] 10-nginx.sh: executing...
[cont-init.d] 10-nginx.sh: exited 0.
[cont-init.d] 10-vnc-password.sh: executing...
[cont-init.d] 10-vnc-password.sh: exited 0.
[cont-init.d] 10-web-index.sh: executing...
[cont-init.d] 10-web-index.sh: exited 0.
[cont-init.d] 95-check-optical-drive.sh: executing...
[cont-init.d] 95-check-optical-drive.sh: looking for usable optical drives...
[cont-init.d] 95-check-optical-drive.sh: no usable optical drive found.
[cont-init.d] 95-check-optical-drive.sh: exited 0.
[cont-init.d] 95-check-qsv.sh: executing...
[cont-init.d] 95-check-qsv.sh: Processor: AMD Ryzen Threadripper 2950X 16-Core Processor
[cont-init.d] 95-check-qsv.sh: Intel Quick Sync Video not supported: not an Intel processor.
[cont-init.d] 95-check-qsv.sh: exited 0.
[cont-init.d] handbrake.sh: executing...
[cont-init.d] handbrake.sh: core dump file location: core
[cont-init.d] handbrake.sh: core dump file size: 0 (blocks)
[cont-init.d] handbrake.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] starting s6-fdholderd...
[services.d] starting certsmonitor...
[services.d] starting nginx...
[services.d] starting xvfb...
[nginx] starting...
[certsmonitor] disabling service: secure connection not enabled.
[xvfb] starting...
[services.d] starting autovideoconverter...
[services.d] starting logmonitor...
[services.d] starting statusmonitor...
[logmonitor] no file to monitor: disabling service...
[services.d] starting openbox...
[statusmonitor] no file to monitor: disabling service...
[autovideoconverter] starting...
[openbox] starting...
[autovideoconverter] Processing watch folder '/watch'...
[autovideoconverter] Watch folder '/watch' processing terminated.
[services.d] starting x11vnc...
[services.d] starting app...
[x11vnc] starting...
[app] starting HandBrake...
06/03/2019 12:29:05 passing arg to libvncserver: -rfbport
06/03/2019 12:29:05 passing arg to libvncserver: 5900
06/03/2019 12:29:05 passing arg to libvncserver: -rfbportv6
06/03/2019 12:29:05 passing arg to libvncserver: -1
06/03/2019 12:29:05 passing arg to libvncserver: -httpportv6
06/03/2019 12:29:05 passing arg to libvncserver: -1
06/03/2019 12:29:05 passing arg to libvncserver: -desktop
06/03/2019 12:29:05 passing arg to libvncserver: HandBrake
06/03/2019 12:29:05 x11vnc version: 0.9.14 lastmod: 2015-11-14 pid: 965

 

Edited by mbc0
Link to comment
5 minutes ago, mbc0 said:

Hi,

 

I am runnung this docker on a 2950X Threadripper but the docker is barely pressuring any of the 16 cores resulting in approx 30fps HEVC encoding compared to 55fps I get on my 8700K

 

The cores/threads usage according to unraid is very low, any ideas?

What's your encoder preset? I had mine at "faster" and I dropped it down to "medium" or "slow" and now the usage is high. Try that.

Link to comment

Need some help,  trying to run handbrake in cli mode,  but the environment variables don't seem to work. 

 

The folders work,  but it doesn't use the preset I configured in the GUI, it doesn't erase the files from the watch folder,  nor does it keep the folder structure. 

 

What am I doing wrong?

 

sudo docker run -d \
--name=handbrake \
-p 5800:5800 \
-v /docker/appdata/handbrake:/config:rw \
-v /media/Downloads/complete:/watch:rw \
-v /media/Downloads/re-encoded:/output:rw \
-e AUTOMATED_CONVERSION_PRESET:myh265 \
-e AUTOMATED_CONVERSION_KEEP_SOURCE:0 \
-e AUTOMATED_CONVERSION_OUTPUT_SUBDIR:SAME_AS_SOURCE \
jlesage/handbrake

 

Link to comment
21 minutes ago, mrmagoo_83 said:

Need some help,  trying to run handbrake in cli mode,  but the environment variables don't seem to work. 

 

The folders work,  but it doesn't use the preset I configured in the GUI, it doesn't erase the files from the watch folder,  nor does it keep the folder structure. 

 

What am I doing wrong?

 

sudo docker run -d \
--name=handbrake \
-p 5800:5800 \
-v /docker/appdata/handbrake:/config:rw \
-v /media/Downloads/complete:/watch:rw \
-v /media/Downloads/re-encoded:/output:rw \
-e AUTOMATED_CONVERSION_PRESET:myh265 \
-e AUTOMATED_CONVERSION_KEEP_SOURCE:0 \
-e AUTOMATED_CONVERSION_OUTPUT_SUBDIR:SAME_AS_SOURCE \
jlesage/handbrake

 

Why don't you use the UI to create the container?  It's much more easier to configure the container this way...

 

Your environment variables should have an equal sign instead of a colon. For example: -e "AUTOMATED_CONVERSION_PRESET=myh265"

Link to comment
1 hour ago, Djoss said:

Why don't you use the UI to create the container?  It's much more easier to configure the container this way...

Not only is it easier, but it also makes it possible to easily reinstall it with the same settings.

 

Or are you actually trying to use this docker in some environment other than Unraid? Now that I look more closely at your volume mappings, I assume that must be the case.

Link to comment
20 hours ago, Djoss said:

Can you use the Radarr's post processing script to copy the (already renamed) file to HandBrake's watch folder?

This seems to be working so far. I had to create a custom script for Radarr and Sonarr separately. 

  1. Move or Episode is downloaded and imported
  2. Custom script copies file to the /watch directory
  3. File is encoded
  4. After encoding, file is moved to the /output directory then copied to overwrite the original file

An issue I had was trying to make sure the files were dropped into the correct directory after encoding. Sonarr adds an extra directory that Radarr doesn't have. Wanting to use the container's available functions without adding new packages, I had to come up with a way to identify that extra directory. 

 

Here's the variable I created and finally settled on:

DEPTHCOUNT=$(find "$CONVERTED_FILE" -type f | grep -o / | wc -l)

Seems pretty functional so far. I get to watch videos asap and they still get encoded. 

Link to comment
20 hours ago, mbc0 said:

Hi,

 

I am runnung this docker on a 2950X Threadripper but the docker is barely pressuring any of the 16 cores resulting in approx 30fps HEVC encoding compared to 55fps I get on my 8700K

 

The cores/threads usage according to unraid is very low, any ideas?

 

image.png.cc04677c0da28cbddada959e28ce92dd.png

 

 

autovideoconverter] Encoding: 3.80 % (27.03 fps, avg 29.04 fps, ETA 00h48m21s)
[autovideoconverter] Encoding: 3.84 % (33.93 fps, avg 29.17 fps, ETA 00h48m06s)
[autovideoconverter] Encoding: 3.90 % (40.49 fps, avg 29.34 fps, ETA 00h47m48s)
[autovideoconverter] Encoding: 3.90 % (40.49 fps, avg 29.34 fps, ETA 00h47m48s)
[autovideoconverter] Encoding: 3.98 % (42.86 fps, avg 29.52 fps, ETA 00h47m28s)
[autovideoconverter] Encoding: 4.04 % (47.41 fps, avg 29.64 fps, ETA 00h47m16s)
[autovideoconverter] Encoding: 4.08 % (41.80 fps, avg 29.67 fps, ETA 00h47m11s)
[autovideoconverter] Encoding: 4.13 % (37.09 fps, avg 29.73 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.16 % (30.93 fps, avg 29.70 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.16 % (30.93 fps, avg 29.70 fps, ETA 00h47m05s)
[autovideoconverter] Encoding: 4.18 % (25.92 fps, avg 29.63 fps, ETA 00h47m12s)
[autovideoconverter] Encoding: 4.23 % (23.44 fps, avg 29.61 fps, ETA 00h47m13s)
[autovideoconverter] Encoding: 4.23 % (23.44 fps, avg 29.61 fps, ETA 00h47m13s)
[autovideoconverter] Encoding: 4.28 % (27.78 fps, avg 29.66 fps, ETA 00h47m07s)
[autovideoconverter] Encoding: 4.31 % (28.71 fps, avg 29.60 fps, ETA 00h47m11s)
[autovideoconverter] Encoding: 4.36 % (30.25 fps, avg 29.62 fps, ETA 00h4

 

 

[cont-init.d] 00-app-script.sh: exited 0.
[cont-init.d] 00-app-user-map.sh: executing...
[cont-init.d] 00-app-user-map.sh: exited 0.
[cont-init.d] 00-clean-logmonitor-states.sh: executing...
[cont-init.d] 00-clean-logmonitor-states.sh: exited 0.
[cont-init.d] 00-clean-tmp-dir.sh: executing...
[cont-init.d] 00-clean-tmp-dir.sh: exited 0.
[cont-init.d] 00-set-app-deps.sh: executing...
[cont-init.d] 00-set-app-deps.sh: exited 0.
[cont-init.d] 00-set-home.sh: executing...
[cont-init.d] 00-set-home.sh: exited 0.
[cont-init.d] 00-take-config-ownership.sh: executing...
[cont-init.d] 00-take-config-ownership.sh: exited 0.
[cont-init.d] 00-xdg-runtime-dir.sh: executing...
[cont-init.d] 00-xdg-runtime-dir.sh: exited 0.
[cont-init.d] 10-certs.sh: executing...
[cont-init.d] 10-certs.sh: exited 0.
[cont-init.d] 10-cjk-font.sh: executing...
[cont-init.d] 10-cjk-font.sh: exited 0.
[cont-init.d] 10-nginx.sh: executing...
[cont-init.d] 10-nginx.sh: exited 0.
[cont-init.d] 10-vnc-password.sh: executing...
[cont-init.d] 10-vnc-password.sh: exited 0.
[cont-init.d] 10-web-index.sh: executing...
[cont-init.d] 10-web-index.sh: exited 0.
[cont-init.d] 95-check-optical-drive.sh: executing...
[cont-init.d] 95-check-optical-drive.sh: looking for usable optical drives...
[cont-init.d] 95-check-optical-drive.sh: no usable optical drive found.
[cont-init.d] 95-check-optical-drive.sh: exited 0.
[cont-init.d] 95-check-qsv.sh: executing...
[cont-init.d] 95-check-qsv.sh: Processor: AMD Ryzen Threadripper 2950X 16-Core Processor
[cont-init.d] 95-check-qsv.sh: Intel Quick Sync Video not supported: not an Intel processor.
[cont-init.d] 95-check-qsv.sh: exited 0.
[cont-init.d] handbrake.sh: executing...
[cont-init.d] handbrake.sh: core dump file location: core
[cont-init.d] handbrake.sh: core dump file size: 0 (blocks)
[cont-init.d] handbrake.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] starting s6-fdholderd...
[services.d] starting certsmonitor...
[services.d] starting nginx...
[services.d] starting xvfb...
[nginx] starting...
[certsmonitor] disabling service: secure connection not enabled.
[xvfb] starting...
[services.d] starting autovideoconverter...
[services.d] starting logmonitor...
[services.d] starting statusmonitor...
[logmonitor] no file to monitor: disabling service...
[services.d] starting openbox...
[statusmonitor] no file to monitor: disabling service...
[autovideoconverter] starting...
[openbox] starting...
[autovideoconverter] Processing watch folder '/watch'...
[autovideoconverter] Watch folder '/watch' processing terminated.
[services.d] starting x11vnc...
[services.d] starting app...
[x11vnc] starting...
[app] starting HandBrake...
06/03/2019 12:29:05 passing arg to libvncserver: -rfbport
06/03/2019 12:29:05 passing arg to libvncserver: 5900
06/03/2019 12:29:05 passing arg to libvncserver: -rfbportv6
06/03/2019 12:29:05 passing arg to libvncserver: -1
06/03/2019 12:29:05 passing arg to libvncserver: -httpportv6
06/03/2019 12:29:05 passing arg to libvncserver: -1
06/03/2019 12:29:05 passing arg to libvncserver: -desktop
06/03/2019 12:29:05 passing arg to libvncserver: HandBrake
06/03/2019 12:29:05 x11vnc version: 0.9.14 lastmod: 2015-11-14 pid: 965

 

 

Bumpity Bump ;-)

 

Link to comment
8 hours ago, trurl said:

Not only is it easier, but it also makes it possible to easily reinstall it with the same settings.

 

Or are you actually trying to use this docker in some environment other than Unraid? Now that I look more closely at your volume mappings, I assume that must be the case.

You caught me. I'm running two setups. I have my primary Unraid server which has this docker setup and running,  it is converting all the items as their downloaded,  but I have also setup a standalone Kubuntu machine running on an older PC I just retired. I'm trying to use it to work thru all my old files to cut the work time down.  Thus I'm trying to execute the HB docker from the CLI as there is no container environment. 

Link to comment
4 hours ago, CrunchyToast said:

This seems to be working so far. I had to create a custom script for Radarr and Sonarr separately. 

  1. Move or Episode is downloaded and imported
  2. Custom script copies file to the /watch directory
  3. File is encoded
  4. After encoding, file is moved to the /output directory then copied to overwrite the original file

An issue I had was trying to make sure the files were dropped into the correct directory after encoding. Sonarr adds an extra directory that Radarr doesn't have. Wanting to use the container's available functions without adding new packages, I had to come up with a way to identify that extra directory. 

 

Here's the variable I created and finally settled on:


DEPTHCOUNT=$(find "$CONVERTED_FILE" -type f | grep -o / | wc -l)

Seems pretty functional so far. I get to watch videos asap and they still get encoded. 

Not sure if the extra directory is needed or not, but you can configure the automatic video converter to keep the same folder hierarchy as the input.  See the "Automatic Video Converter: Output Subdirectory" container setting.

Link to comment
3 hours ago, mbc0 said:

 

Bumpity Bump ;-)

 

I'm not sure what could be the problem.  Maybe encoder optimizations are better for Intel than AMD.  Try to check on HandBrake forum to see if there is a known issue.  You could also try the development version ("dev-latest" tag) to see if you have the same performance.

 

Link to comment
1 minute ago, Djoss said:

I'm not sure what could be the problem.  Maybe encoder optimizations are better for Intel than AMD.  Try to check on HandBrake forum to see if there is a known issue.  You could also try the development version ("dev-latest" tag) to see if you have the same performance.

 

Thanks for the reply 🙂 I am getting similar fps using less cores (4 instead of 12) and find it uses more of the 4 cores than 16 so curious! I will let you know my findings!

Link to comment

Hi,

 

Just one issue I am facing is that when using watchfolder the source file is being deleted after encoding, I have the value set to 1 but still deletes.  I am running two of these dockers so I can have two presets on watched folders and they both delete the source files

 

image.thumb.png.06e82b36ab8feb44b319e6098a232110.png

Link to comment
1 minute ago, mbc0 said:

Hi,

 

Just one issue I am facing is that when using watchfolder the source file is being deleted after encoding, I have the value set to 1 but still deletes.  I am running two of these dockers so I can have two presets on watched folders and they both delete the source files

 

image.thumb.png.06e82b36ab8feb44b319e6098a232110.png

Do you have the container logs?  You should see an explicit message telling that it's deleting the file.  Do you see it?

 

Btw, you don't need multiple containers to have multiple watch folders.  See https://github.com/jlesage/docker-handbrake#multiple-watch-folders

Link to comment

ok, multiple containers may be the way forward for me until they fix the usage of available cores see here.

 

https://github.com/HandBrake/HandBrake/pull/1824


 

2 minutes ago, Djoss said:

Do you have the container logs?  You should see an explicit message telling that it's deleting the file.  Do you see it?

 

here is the end of the log file, there is no mention of the file being deleted but it definately deletes it every time!

[autovideoconverter] Encoding: 99.41 % (20.18 fps, avg 33.42 fps, ETA 00h00m01s)
[autovideoconverter] Conversion ended successfully.
[autovideoconverter] Watch folder '/watch' processing terminated.
[autovideoconverter] Change detected in watch folder '/watch'.
[autovideoconverter] Processing watch folder '/watch'...
[autovideoconverter] Watch folder '/watch' processing terminated.

Link to comment
1 hour ago, Djoss said:

Not sure if the extra directory is needed or not, but you can configure the automatic video converter to keep the same folder hierarchy as the input.  See the "Automatic Video Converter: Output Subdirectory" container setting.

I did dig around this. When using same as src it would only do the most immediate folder, not multiple directories. Either way, it's working for me. 

Link to comment
1 hour ago, mbc0 said:

ok, multiple containers may be the way forward for me until they fix the usage of available cores see here.

 

https://github.com/HandBrake/HandBrake/pull/1824


 

 

here is the end of the log file, there is no mention of the file being deleted but it definately deletes it every time!

[autovideoconverter] Encoding: 99.41 % (20.18 fps, avg 33.42 fps, ETA 00h00m01s)
[autovideoconverter] Conversion ended successfully.
[autovideoconverter] Watch folder '/watch' processing terminated.
[autovideoconverter] Change detected in watch folder '/watch'.
[autovideoconverter] Processing watch folder '/watch'...
[autovideoconverter] Watch folder '/watch' processing terminated.

Do you have another container/application/script that could also plays with the directory?

If there is no message indicating the deletion of the file, it's not the auto video converter that removes it...!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.