Jump to content
Djoss

[Support] Djoss - HandBrake

753 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

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.