Skip to content

Commit

Permalink
Added a way to provide custom arguments to HandBrake.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlesage committed Dec 8, 2019
1 parent d32cc96 commit 50942a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ of this parameter has the format `<VARIABLE_NAME>=<VALUE>`.
|`AUTOMATED_CONVERSION_MAX_WATCH_FOLDERS`| Maximum number of watch folders handled by the automatic video converter. | `5` |
|`HANDBRAKE_DEBUG`| Setting this to `1` enables HandBrake debug logging for both the GUI and the automatic video converter. For the latter, the increased verbosity is reflected in `/config/log/hb/conversion.log` (container path). For the GUI, log messages are sent to `/config/log/hb/handbrake.debug.log` (container path). **NOTE**: When enabled, a lot of information is generated and the log file will grow quickly. Make sure to enable this temporarily and only when needed. | (unset) |
|`AUTOMATED_CONVERSION_NO_GUI_PROGRESS`| When set to `1`, progress of videos converted by the automatic video converter is not shown in the HandBrake GUI. | `0` |
|`AUTOMATED_CONVERSION_HANDBRAKE_CUSTOM_ARGS`| Custom arguments to pass to HandBrake when performing a conversion. | (unset) |

### Data Volumes

Expand Down
11 changes: 11 additions & 0 deletions appdefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,17 @@ On systems running unRAID, the `--ulimit core=-1` parameter can be added to the
<mask>false</mask>
</unraid_template>
</environment_variable>
<environment_variable>
<name>AUTOMATED_CONVERSION_HANDBRAKE_CUSTOM_ARGS</name>
<description>Custom arguments to pass to HandBrake when performing a conversion.</description>
<default/>
<unraid_template>
<title>Automatic Video Converter: Custom HandBrake Arguments</title>
<display>advanced</display>
<required>false</required>
<mask>false</mask>
</unraid_template>
</environment_variable>
</environment_variables>
<!-- Volumes -->
<volumes>
Expand Down
6 changes: 4 additions & 2 deletions rootfs/etc/services.d/autovideoconverter/run
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ process_video() {
$HANDBRAKE_CLI -i "$video" \
-o "$OUTPUT_FILE_TMP" \
--title "$TITLE" \
--preset "$AC_PRESET" 2>> \
--preset "$AC_PRESET" \
$AC_HANDBRAKE_CUSTOM_ARGS 2>> \
/config/log/hb/conversion.log | \
/usr/bin/unbuffer -p grep "^Encoding" | \
stdbuf -oL cut -d',' -f2- | \
Expand Down Expand Up @@ -372,10 +373,11 @@ while true; do
AC_KEEP_SOURCE="${AUTOMATED_CONVERSION_KEEP_SOURCE:-1}"
AC_NON_VIDEO_FILE_ACTION="${AUTOMATED_CONVERSION_NON_VIDEO_FILE_ACTION:-ignore}"
AC_NON_VIDEO_FILE_EXTENSIONS="${AUTOMATED_CONVERSION_NON_VIDEO_FILE_EXTENSIONS:-jpg jpeg bmp png gif txt nfo}"
AC_HANDBRAKE_CUSTOM_ARGS="${AUTOMATED_CONVERSION_HANDBRAKE_CUSTOM_ARGS:-}"

# Apply per-watch folder settings.
if [ -n "${DIR#*/watch}" ]; then
for VAR in PRESET FORMAT SOURCE_STABLE_TIME SOURCE_MIN_DURATION OUTPUT_DIR OUTPUT_SUBDIR KEEP_SOURCE NON_VIDEO_FILE_ACTION NON_VIDEO_FILE_EXTENSIONS
for VAR in PRESET FORMAT SOURCE_STABLE_TIME SOURCE_MIN_DURATION OUTPUT_DIR OUTPUT_SUBDIR KEEP_SOURCE NON_VIDEO_FILE_ACTION NON_VIDEO_FILE_EXTENSIONS HANDBRAKE_CUSTOM_ARGS
do
eval "AC_$VAR=\"\${AUTOMATED_CONVERSION_${VAR}_${DIR#*/watch}:-\$AC_$VAR}\""
done
Expand Down

0 comments on commit 50942a4

Please sign in to comment.