Jump to content
Djoss

[Support] Djoss - HandBrake

780 posts in this topic Last Reply

Recommended Posts

5 hours ago, Djoss said:

 

Instead of using Extra Parameters, your can add a "Device" and set its value to "/dev/dri/".

Amazing, that did the trick! Could've sworn I had tried that, but oh well.  

Out of curiosity, what's the difference between using extra parameters vs adding a device?

 

Thanks for all your help with this!

Share this post


Link to post

I have been using HB for some time and I am loving it, but I have discovered that, at the moment it is see's a text, Image or Subtitle file then it trys to convert it and deletes the file. 

 

so am I right that if I do the following then if it see's a txt, image or subtitle file then it will just move it to the destination. I have highlighted my Modification in red.

 

CONVERTED_FILE="$1"
SOURCE_FILE="$2"
PRESET="$3"

echo "pre-conversion: Output File = $CONVERTED_FILE"
echo "pre-conversion: Source File = $SOURCE_FILE"
echo "pre-conversion: Preset = $PRESET"

EXTENSION="$(echo "${SOURCE_FILE##*.}" | tr '[:upper:]' '[:lower:]')"
case "$EXTENSION" in
    avi|mp4)
        # Nothing to do.  Allow conversion of known video files.
        echo "pre-conversion: allowing file conversion."
        ;;
    mkv|srt|jpeg|txt)
        # Do not convert MKVs.  Move the file to its final destination.
        EXTENSION="$(echo "${CONVERTED_FILE##*.}" | tr '[:upper:]' '[:lower:]')"
        if [ "$EXTENSION" = "mkv";"srt";"jpeg";"txt"; ]; then
            echo "pre-conversion: file conversion not required, moving file."
            mkdir -p "$(dirname "$CONVERTED_FILE")"
            mv "$SOURCE_FILE" "$CONVERTED_FILE"
        else
            echo "ERROR: Destination file has unexpected extension '$EXTENSION'."
        fi
        ;;
    *)
        # Remove unknown files.
        echo "pre-conversion: preventing file conversion by removing file."
        rm "$SOURCE_FILE"

Share this post


Link to post

I would do something like this:

CONVERTED_FILE="$1"
SOURCE_FILE="$2"
PRESET="$3"
echo "pre-conversion: Output File = $CONVERTED_FILE"
echo "pre-conversion: Source File = $SOURCE_FILE"
echo "pre-conversion: Preset = $PRESET"
EXTENSION="$(echo "${SOURCE_FILE##*.}" | tr '[:upper:]' '[:lower:]')"
case "$EXTENSION" in
    avi|mp4)
        # Nothing to do.  Allow conversion of known video files.
        echo "pre-conversion: allowing file conversion."
        ;;
    mkv|srt|jpeg|txt)
        echo "pre-conversion: file conversion not required, moving file."
        mkdir -p "$(dirname "$CONVERTED_FILE")"
        mv "$SOURCE_FILE" "$(dirname "$CONVERTED_FILE")"/
        ;;
    *)
        # Remove unknown files.
        echo "pre-conversion: preventing file conversion by removing file."
        rm "$SOURCE_FILE"
esac

 

Share this post


Link to post

I've been doing a lot of ripping recently and started getting warnings about my Docker image getting too full. I noticed that this container is putting Handbrake's temp files (2-pass btree files) into the container. Might be prudent to have HB's temp folder be able to be located outside the container's file system.

Share this post


Link to post
20 minutes ago, Taddeusz said:

I've been doing a lot of ripping recently and started getting warnings about my Docker image getting too full. I noticed that this container is putting Handbrake's temp files (2-pass btree files) into the container. Might be prudent to have HB's temp folder be able to be located outside the container's file system.

Where are located these files exactly in the container?

Share this post


Link to post
1 hour ago, Djoss said:

Where are located these files exactly in the container?

This looks like it may be complicated unless you can specify a temp path. They are in /tmp/hb.<ghb process number>.

Share this post


Link to post
20 hours ago, Djoss said:

Where are located these files exactly in the container?

Right now I have /tmp in the container pointing to /mnt/user/appdata/HandBrake/tmp.

Share this post


Link to post

Hi,

 

I have been using this docker for a long time with great success but am looking to change my process of automation.  the problem I have is radarr looks for a movie with the structure /root/movie folder/movie.mkv but when using handbrake I end up with /root/movie.mkv

Is there a way for handbrake to keep folder structure so the encoded movie would be /root/movie folder/movie.mkv ?

 

I tried this in extra parameters but it still does not keep the folder structure

 

--cap-add=SYS_NICE -e AUTOMATED_CONVERSION_OUTPUT_SUBDIR:SAME_AS_SOURCE

 

Thanks!

Edited by mbc0
add

Share this post


Link to post

Sorry found it! 

 

missed the "Automatic Video Converter: Output Subdirectory:"

 

 

 

Share this post


Link to post

Hi, having problems with getting qsv to work.. I have scanned through most of this thread..

have read this https://github.com/jlesage/docker-handbrake/blob/master/README.md#intel-quick-sync-video

 

I understand the right kind of processor need to be find first ?,

this is what I get into my log

[cont-init.d] 95-check-qsv.sh: executing...
[cont-init.d] 95-check-qsv.sh: Processor: Intel(R) Core(TM) i5-9400T CPU @ 1.80GHz
[cont-init.d] 95-check-qsv.sh: Intel Quick Sync Video not supported: device directory /dev/dri not exposed to the container.
[cont-init.d] 95-check-qsv.sh: exited 0.

 

Processor is fairly new, and has Intel Quick Sync Video support according to intel web page.

Does the support need to be in Unraid or in Handbrake ? 

 

I assume I need to wait that this series of processors will be supported ?

 

Share this post


Link to post
1 hour ago, airfish said:

Hi, having problems with getting qsv to work.. I have scanned through most of this thread..

have read this https://github.com/jlesage/docker-handbrake/blob/master/README.md#intel-quick-sync-video

 

I understand the right kind of processor need to be find first ?,

this is what I get into my log

[cont-init.d] 95-check-qsv.sh: executing...
[cont-init.d] 95-check-qsv.sh: Processor: Intel(R) Core(TM) i5-9400T CPU @ 1.80GHz
[cont-init.d] 95-check-qsv.sh: Intel Quick Sync Video not supported: device directory /dev/dri not exposed to the container.
[cont-init.d] 95-check-qsv.sh: exited 0.

 

Processor is fairly new, and has Intel Quick Sync Video support according to intel web page.

Does the support need to be in Unraid or in Handbrake ? 

 

I assume I need to wait that this series of processors will be supported ?

 

9th Gen QSV is not yet supported by Unraid. The next version will include the necessary kernel/drivers to support the newer CPU’s.

Share this post


Link to post

@airfish, in addition to what @Taddeusz, make sure that:

The second point is what is missing according to the log.  I don't know if it's because it's not configured in container's settings or if because the device is not available due to your unsupported cpu...

 

 

Share this post


Link to post
16 hours ago, Djoss said:

@airfish, in addition to what @Taddeusz, make sure that:

The second point is what is missing according to the log.  I don't know if it's because it's not configured in container's settings or if because the device is not available due to your unsupported cpu...

 

 

@Djoss, @Taddeusz, thanks a lot for commenting.

Djoss, I did all those you mention, and couldn´t start the container with the dri device as it was not existing. Tried several times, started the array, booted the pc etc.

 

BUT, "something has happened overnight", the dri device (or directory) is now existing and I can add the device now.

And.. Handbrake has now the Intel QSV option, which was the target :) 

 

So, I´m off to testing the thing. Kudos to you both, greetings from Finland :)

Edited by airfish
corrections

Share this post


Link to post

I just installed Unraid 6.8.0 rc1 this morning and went to run something through Handbrake and noticed it’s not starting.

Quote

s6-svwait: fatal: timed out
[services.d] starting app...
[app] starting HandBrake...
[services.d] done.
[openbox] starting...
Openbox-Message: Failed to open the display from the DISPLAY environment variable.

(ghb:1322): Gtk-WARNING **: 14:39:10.155: cannot open display: :0
[xvfb] starting...
(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X0-lock
(EE)
[x11vnc] starting...
12/10/2019 14:39:11 passing arg to libvncserver: -rfbport
12/10/2019 14:39:11 passing arg to libvncserver: 5900
12/10/2019 14:39:11 passing arg to libvncserver: -rfbportv6
12/10/2019 14:39:11 passing arg to libvncserver: -1
12/10/2019 14:39:11 passing arg to libvncserver: -httpportv6
12/10/2019 14:39:11 passing arg to libvncserver: -1
12/10/2019 14:39:11 passing arg to libvncserver: -desktop
12/10/2019 14:39:11 passing arg to libvncserver: HandBrake
12/10/2019 14:39:11 x11vnc version: 0.9.14 lastmod: 2015-11-14 pid: 1390
12/10/2019 14:39:11 XOpenDisplay(":0") failed.
12/10/2019 14:39:11 Trying again with XAUTHLOCALHOSTNAME=localhost ...

12/10/2019 14:39:11 ***************************************
12/10/2019 14:39:11 *** XOpenDisplay failed (:0)

*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:

- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:

gdm: -auth /var/gdm/:0.Xauth
-auth /var/lib/gdm/:0.Xauth
kdm: -auth /var/lib/kdm/A:0-crWk72
-auth /var/run/xauth/A:0-crWk72
xdm: -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
dtlogin: -auth /var/dt/A:0-UgaaXa

Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

Starting with x11vnc 0.9.9 you can have it try to guess by using:

-auth guess

(see also the x11vnc -findauth option.)

Only root will have read permission for the file, and so x11vnc must be run
as root (or copy it). The random characters in the filenames will of course
change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html
[openbox] starting...
Openbox-Message: Failed to open the display from the DISPLAY environment variable.
[services.d] stopping services
[services.d] stopping app...
[services.d] stopping openbox...
[services.d] stopping statusmonitor...
[services.d] stopping logmonitor...
[services.d] stopping x11vnc...
[services.d] stopping autovideoconverter...
[xvfb] starting...
(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X0-lock
(EE)
[xvfb] starting...
(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X0-lock
(EE)
[xvfb] starting...
(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X0-lock
(EE)
[xvfb] starting...
(EE)
Fatal server error:
(EE) Can't read lock file /tmp/.X0-lock
(EE)
[services.d] stopping nginx...
[services.d] stopping xvfb...
[services.d] stopping certsmonitor...
[services.d] stopping s6-fdholderd...
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

 

Share this post


Link to post
On 10/12/2019 at 6:25 PM, Taddeusz said:

I just installed Unraid 6.8.0 rc1 this morning and went to run something through Handbrake and noticed it’s not starting.

Could you provide the output of:

docker inspect HandBrake

 

Share this post


Link to post
15 minutes ago, Taddeusz said:

@Djoss I'm not sure what changed but I just noticed that it was started and is running. If it's at all a help here is the output anyway.

handbrake.txt 11.32 kB · 1 download

Ok, not sure what happened.  Let me know if you see the issue again.

Share this post


Link to post

Hi @Djoss

 

Thanks for the container.

Im a novice so sorry for the question if its simple!

 

How can i tell whether handbrake is using my GPU?

I can see if emby is transcoding by using

watch nvidia-smi

or from the emby settings page.

 

The Unraid dashboard shows the cpu cores pinned to Handbrake maxing out whenever it is in use, and this makes me wonder if it is using the P2000 card?

Thanks for your help.

 

 

Hardware -

Unraid Nvidia 6.7.2

2 x Xeon E5 2690

32GB Ram

Dell T620 server

Share this post


Link to post
On 10/14/2019 at 12:27 PM, dgs2001 said:

Hi @Djoss

 

Thanks for the container.

Im a novice so sorry for the question if its simple!

 

How can i tell whether handbrake is using my GPU?

I can see if emby is transcoding by using


watch nvidia-smi

or from the emby settings page.

 

The Unraid dashboard shows the cpu cores pinned to Handbrake maxing out whenever it is in use, and this makes me wonder if it is using the P2000 card?

Thanks for your help.

 

 

Hardware -

Unraid Nvidia 6.7.2

2 x Xeon E5 2690

32GB Ram

Dell T620 server

 

When GPU acceleration is available, you will have a specific encoder for it in the video encoder list.

 

For example, for Intel QSV, you have to chose "H.264 (Intel QSV)" in the list.

 

Note that this container doesn't support Nvidia acceleration.  I think there is another one available through Community Applications that supports it.

Share this post


Link to post
On 10/15/2019 at 8:04 PM, Djoss said:

 

When GPU acceleration is available, you will have a specific encoder for it in the video encoder list.

 

For example, for Intel QSV, you have to chose "H.264 (Intel QSV)" in the list.

 

Note that this container doesn't support Nvidia acceleration.  I think there is another one available through Community Applications that supports it.

Hi Djoss,

 

Thankls for the clarification, I have this sorted now. I was looking in the 'Preferences' menu instead of the encoder list.

 

I have now selected the encoder as 'nvenc' and confirm all is working and can be seen with the watch nvidia-smi command in terminal.

 

Happy to report that enoding with nvenc on a quattro p2000 is roughly 10 times faster than using ten cores/threads of the 2 xeon cpu's I have so thanks for the great work you do :)

Share this post


Link to post

Good evening.  I am new to Unraid and this docker container, but not new to Handbrake itself.  I can get HB to automatically convert files and i can do them manually.  So far the docker looks like it will work great.  However, I am having one small problem.

 

Regardless of what preset I use, the audio quality is horrific. The MKV file is fine and i can convert it on my local machine just fine. It is only in the docker container where the issue exists. I have tried using the default preset of "Fast 1080p30" and others. Audio results are the same each time.  Is there something else I'm missing or am not doing?

 

Thanks in advance!

Share this post


Link to post
On 12/1/2019 at 7:39 PM, techguru6966 said:

Good evening.  I am new to Unraid and this docker container, but not new to Handbrake itself.  I can get HB to automatically convert files and i can do them manually.  So far the docker looks like it will work great.  However, I am having one small problem.

 

Regardless of what preset I use, the audio quality is horrific. The MKV file is fine and i can convert it on my local machine just fine. It is only in the docker container where the issue exists. I have tried using the default preset of "Fast 1080p30" and others. Audio results are the same each time.  Is there something else I'm missing or am not doing?

 

Thanks in advance!

So you are using the default preset without any change to it?

Could you try to change the audio encoder to see if it helps?

Share this post


Link to post

So I saw this question posted a few months back but it didn't seem to go anywhere regarding subtitles. I have HandBrake set to transcode to an .mkv container with H.264 encoding. I am burning foreign audio subtitles and grabbing the first English subs found. HandBrake is defaulting those subtitles on and I don't see any way to disable that. I would prefer to have the subs included but left off until I enable in Plex/VLC.

 

Any ideas?

HandBrake Subtitles 1.png

HandBrake Subtitles 2.png

Share this post


Link to post
16 hours ago, Jagaroth said:

So I saw this question posted a few months back but it didn't seem to go anywhere regarding subtitles. I have HandBrake set to transcode to an .mkv container with H.264 encoding. I am burning foreign audio subtitles and grabbing the first English subs found. HandBrake is defaulting those subtitles on and I don't see any way to disable that. I would prefer to have the subs included but left off until I enable in Plex/VLC.

 

Any ideas?

HandBrake Subtitles 1.png

HandBrake Subtitles 2.png

In the track list, if you click the pencil icon for your English track, try to uncheck "Set Default Track" to see if it helps.

Share this post


Link to post
17 minutes ago, Djoss said:

In the track list, if you click the pencil icon for your English track, try to uncheck "Set Default Track" to see if it helps.

Thanks. To clarify, when using the GUI to initiate a transcode I can and have unchecked that box to remove the default tag. When I do this the file works properly and no subtitles display by default in playback. However, I am setting this up to be automated through watch folders and the preset I have created does not maintain that subtitle status. Anytime I load the preset it checks the default box back on. I don't see any way of getting that to be maintained when HandBrake starts a new transcode.

Share this post


Link to post

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.