@@ -24,7 +24,7 @@ Dependencies: cowsay, amiaopensource/amiaos/decklinksdk,
2424 xmlstarlet
2525Optional Dependencies: deckcontrol, gnuplot, mediaconch, mkvtoolnix, mpv, qcli
2626
27- Usage: ${SCRIPTNAME} [ -e | -r | -p | -a | -x | -v | -h ] [IDENTIFIER]
27+ Usage: ${SCRIPTNAME} [ -e | -r | -p | -a | -x | -n| - v | -h ] [IDENTIFIER]
2828
2929 IDENTIFIER will be used for the filenaming of the output files. It is only
3030 required in record mode.
@@ -39,6 +39,8 @@ Usage: ${SCRIPTNAME} [ -e | -r | -p | -a | -x | -v | -h ] [IDENTIFIER]
3939 too long.
4040 -x reset the configuration: this will replace the default configuration file
4141 at '${CONFIG_FILE} ' with an empty one.
42+ -n reset Vrecord's stored environment variables. These include
43+ variables such as the paths to certain dependencies such as ffmpeg-dl.
4244 -v Run ffmpeg with '-loglevel debug'. Using this option creates a very large
4345 log file, so avoid using this option with 'Visual + Numerical' or any
4446 playback option that display the log as part of the view.
@@ -53,6 +55,9 @@ Advanced options
5355 device. For testing without a decklink device.
5456 -G Share warnings from gtkdialog and vrecord, otherwise there are suppressed
5557 by default.
58+ -D Provide a path to a directory containing dependencies to override
59+ Vrecord's default dependency paths. These new paths will be stored in
60+ Vrecord's environmental variables.
5661 -c Provide a recording configuration file, rather than the default one at
5762 '${CONFIG_FILE} '.
5863
@@ -138,7 +143,7 @@ _process_vars_for_gtk(){
138143
139144 if [[ -z " ${OS_TYPE} " ]] ; then
140145 _setup_env_variables
141- _include_var OS_TYPE RESOURCE_PATH DEFAULTFONT CORE_COUNT OPEN_COMMAND ZCAT_COMMAND COMPUTER_MODEL_NAME DIR_SELECTION_DIALOG
146+ _include_var OS_TYPE RESOURCE_PATH DEFAULTFONT CORE_COUNT OPEN_COMMAND ZCAT_COMMAND COMPUTER_MODEL_NAME DIR_SELECTION_DIALOG GTKDIALOGBIN
142147 if [[ " ${OS_TYPE} " = " macOS" ]] ; then
143148 _include_var COMPUTER_MODEL_ID COMPUTER_PROCESSOR_NAME COMPUTER_PROCESSOR_SPEED COMPUTER_PROCESSOR_COUNT COMPUTER_MEMORY COMPUTER_SERIAL
144149 fi
@@ -156,7 +161,8 @@ _remove_env_vars(){
156161 unset VRECORD_VARS_FILE
157162 unset OS_TYPE RESOURCE_PATH DEFAULTFONT CORE_COUNT OPEN_COMMAND ZCAT_COMMAND COMPUTER_MODEL_NAME DIR_SELECTION_DIALOG
158163 unset COMPUTER_MODEL_ID COMPUTER_PROCESSOR_NAME COMPUTER_PROCESSOR_SPEED COMPUTER_PROCESSOR_COUNT COMPUTER_MEMORY COMPUTER_SERIAL
159- unset CAPTURELOGSUFFIX TIMECODELOGSUFFIX BREW_PREFIX FFMPEG_BIN FFPLAY_BIN FFPROBE_BIN
164+ unset CAPTURELOGSUFFIX TIMECODELOGSUFFIX BREW_PREFIX FFMPEG_BIN FFPLAY_BIN FFPROBE_BIN GTKDIALOGBIN
165+ VRECORD_VARS_FILE=" /tmp/v_$( echo " ${0} " | sed -e " s/[^A-Za-z0-9.]/_/g" ) _variables.txt"
160166}
161167
162168_setup_env_variables (){
@@ -232,6 +238,13 @@ _setup_env_variables(){
232238 echo " Unsupported OS, ${QUERY_OS_TYPE} , detected. Exiting."
233239 exit 1
234240 fi
241+ # set gtkdialog path
242+ if [[ -n " ${DEPENDENCYDIR} " ]] ; then
243+ GTKDIALOGBIN=$( find " ${DEPENDENCYDIR} " -iname " gtkdialog" | head -n1)
244+ fi
245+ if [[ -z " ${GTKDIALOGBIN} " ]] ; then
246+ GTKDIALOGBIN=" $( which gtkdialog) "
247+ fi
235248}
236249
237250_gather_ffmpeg_vars (){
@@ -247,17 +260,25 @@ _gather_ffmpeg_vars(){
247260 BREW_PREFIX+=" .reinstall"
248261 fi
249262 fi
250- if [[ -d " ${BREW_PREFIX} /bin" ]] ; then
263+ if [[ -n " ${DEPENDENCYDIR} " ]] ; then
264+ FFMPEGALT=$( find " ${DEPENDENCYDIR} " -iname " ffmpeg-dl" | head -n1)
265+ fi
266+ if [[ -n " ${FFMPEGALT} " ]] ; then
267+ FFMPEG_BIN=" ${FFMPEGALT} "
268+ FFPLAY_BIN=$( find " ${DEPENDENCYDIR} " -iname " ffplay-dl" | head -n1)
269+ FFPROBE_BIN=$( find " ${DEPENDENCYDIR} " -iname " ffprobe-dl" | head -n1)
270+ elif which ffmpeg-dl & > /dev/null ; then
271+ FFMPEG_BIN=" $( which ffmpeg-dl) "
272+ FFPROBE_BIN=" $( which ffprobe-dl) "
273+ FFPLAY_BIN=" $( which ffplay-dl) "
274+ elif
275+ [[ -d " ${BREW_PREFIX} /bin" ]] ; then
251276 FFMPEG_BIN=" ${BREW_PREFIX} /bin/ffmpeg-dl"
252277 FFPROBE_BIN=" ${BREW_PREFIX} /bin/ffprobe-dl"
278+ FFPLAY_BIN=" ${BREW_PREFIX} /bin/ffplay-dl"
253279 else
254280 FFMPEG_BIN=" $( which ffmpeg) "
255281 FFPROBE_BIN=" $( which ffprobe) "
256- fi
257-
258- if " ${BREW_PREFIX} /bin/ffplay-dl" -v 0 -f lavfi smptebars=duration=1/25 -autoexit ; then
259- FFPLAY_BIN=" ${BREW_PREFIX} /bin/ffplay-dl"
260- else
261282 FFPLAY_BIN=" $( which ffplay) "
262283 fi
263284}
@@ -901,6 +922,19 @@ OPTIONAL_TOOLS_GUI=$(cat << CONFIG_FORM
901922 <action type="exit">env_reset</action>
902923 </button>
903924 </vbox>
925+ <vbox>
926+ <text>
927+ <label>Alternate Dependency Source</label>
928+ </text>
929+ <entry accept="directory">
930+ <default>"${DEPENDENCYDIR} "</default>
931+ <variable>DEPENDENCYDIR</variable>
932+ </entry>
933+ <button tooltip-text="Select alternate dependency directory and then reset environmental variables">
934+ <input file stock="gtk-open"></input>
935+ <action type="fileselect">DEPENDENCYDIR</action>
936+ </button>
937+ </vbox>
904938 </hbox>
905939</frame>
906940CONFIG_FORM
@@ -1462,9 +1496,9 @@ _edit_mode(){
14621496 cat " ${SHARED_FUNCTIONS_FILE} " >> " ${GTK_INC} "
14631497
14641498 if [[ " ${VERBOSE_GTKDIALOG} " = " Y" ]] ; then
1465- eval " $( gtkdialog --include=" ${GTK_INC} " --program MAIN_DIALOG --center) "
1499+ eval " $( " ${GTKDIALOGBIN} " --include=" ${GTK_INC} " --program MAIN_DIALOG --center) "
14661500 else
1467- eval " $( gtkdialog --include=" ${GTK_INC} " --program MAIN_DIALOG --center 2> /dev/null) "
1501+ eval " $( " ${GTKDIALOGBIN} " --include=" ${GTK_INC} " --program MAIN_DIALOG --center 2> /dev/null) "
14681502 fi
14691503 MAIN_DIALOG=" ${MAIN_DIALOG_TMP} "
14701504
@@ -2248,7 +2282,7 @@ _review_all_options(){
22482282
22492283# command-line options to set media id and original variables
22502284OPTIND=1
2251- while getopts " :hc:erpaxvI:O :i:G" opt ; do
2285+ while getopts " :hc:erpaxnvI:O:D :i:G" opt ; do
22522286 case " ${opt} " in
22532287 h) _usage ; exit 0 ;;
22542288 c) CONFIG_FILE=" ${OPTARG} " ;;
@@ -2257,9 +2291,11 @@ while getopts ":hc:erpaxvI:O:i:G" opt ; do
22572291 p) RUNTYPE=" passthrough" ;;
22582292 a) RUNTYPE=" audiopassthrough" ;;
22592293 x) RUNTYPE=" reset" ;;
2294+ n) RUNTYPE=" resetenvironment" ;;
22602295 v) VERBOSE=" true" ;;
22612296 I) EXTRAINPUTOPTIONS=(${OPTARG} ) ;;
22622297 O) EXTRAOUTPUTOPTIONS=(${OPTARG} ) ;;
2298+ D) DEPENDENCYDIR=(" ${OPTARG} " ) && RUNTYPE=" resetenvironment" ;;
22632299 i) ALT_INPUT=" ${OPTARG} " ;;
22642300 G) VERBOSE_GTKDIALOG=" Y" ;;
22652301 :) _report -w " Option -${OPTARG} requires an argument" ; _usage ; exit 1 ;;
@@ -2368,6 +2404,26 @@ if [[ "${RUNTYPE}" = "reset" ]] ; then
23682404 exit 0
23692405 fi
23702406fi
2407+
2408+ if [[ " ${RUNTYPE} " = " resetenvironment" ]] ; then
2409+ if [[ -n " ${DEPENDENCYDIR} " ]] ; then
2410+ _report -q -n " Rewriting the configuration to include dependencies found in ${DEPENDENCYDIR} . Please enter [Y] to confirm: "
2411+ else
2412+ _report -q -n " Resetting the configuration will clear ${VRECORD_VARS_FILE} . Please enter [Y] to confirm: "
2413+ fi
2414+ read RESET_RESPONSE
2415+ if [[ " ${RESET_RESPONSE} " = [Yy] ]] ; then
2416+ _report -d " Clearing ${VRECORD_VARS_FILE} ."
2417+ _remove_env_vars
2418+ _process_vars_for_gtk
2419+ RUNTYPE=" edit"
2420+ STARTUP_VIEW=" INPUTSETTINGS"
2421+ else
2422+ _report -d " Reset aborted. Exiting."
2423+ exit 0
2424+ fi
2425+ fi
2426+
23712427while [[ " ${RUNTYPE} " = " edit" ]] ; do
23722428 STARTUP_VIEW=" INPUTSETTINGS"
23732429 _edit_mode
0 commit comments