@@ -1560,11 +1560,19 @@ _passthrough_mode(){
15601560 echo " RECORD ${RECORD_COMMAND[@]} "
15611561 fi
15621562
1563+ if [[ " ${PLAYBACKVIEW_CHOICE_PASS} " == " Captions" ]] && [[ " ${RUNTYPE} " == " passthrough" ]] ; then
1564+ " ${SCRIPTDIR} /cchex_to_display" " ${FFREPORT_TMP} " " ${CAP_DISPLAY_TMP} " > /dev/null 2> /dev/null &
1565+ CC_PID=$!
1566+ export FFREPORT=" file=${FFREPORT_TMP} :level=32"
1567+ fi
15631568 if [[ " ${VRECORD_STEPS} " = " 1" ]] ; then
15641569 " ${PLAYER_COMMAND[@]} " 2> " ${VRECORD_INPUT_TMP} "
15651570 elif [[ " ${VRECORD_STEPS} " = " 2" ]] ; then
15661571 " ${RECORD_COMMAND[@]} " 2> " ${VRECORD_INPUT_TMP} " | " ${PLAYER_COMMAND[@]} "
15671572 fi
1573+ if [[ " ${PLAYBACKVIEW_CHOICE_PASS} " == " Captions" ]] && [[ " ${RUNTYPE} " == " passthrough" ]] ; then
1574+ kill " $CC_PID "
1575+ fi
15681576}
15691577
15701578_audiopassthrough_mode (){
@@ -2150,13 +2158,23 @@ color=color=darkgray,scale=${CORNER_W}*${CORNER_ZOOM}*2:${CORNER_H}*2,split=4[l1
21502158[c1b][d1b]hstack,scale=${CORNER_W} *16*2:${CORNER_H} *16:flags=neighbor,drawgrid=w=iw/${CORNER_W} /2:h=ih/${CORNER_H} :t=1:c=green@0.5[cdb];\
21512159[l1t][abt][l2t][abb][l3t][cdt][l4t][cdb]vstack=8,setsar=1/1" ;;
21522160 " Captions" )
2161+ if [[ " ${RUNTYPE} " = " record" ]] ; then
21532162 PLAYBACKFILTER=" \
2154- ${PLAYBACK_FILTER_ADJUSTMENT} format=yuv420p10le|yuv422p10le|yuv444p10le|yuv440p10le,split=4[f1][f2][f3][f4];\
2155- [f1]readeia608=scan_max=2:spw=0.30,drawtext=fontfile=${DEFAULTFONT} :fontcolor=white:fontsize=36:box=1:boxcolor=black@0.5:x=(w-tw)/2:y=h*3/4-ascent:text=Line %{metadata\\ \:lavfi.readeia608.0.line\\ \:-} %{metadata\\ \:lavfi.readeia608.0.cc\\ \:------} - Line %{metadata\\ \:lavfi.readeia608.1.line\\ \:-} %{metadata\\ \:lavfi.readeia608.1.cc\\ \:------}[f1b];\
2156- [f2]crop=iw:1:0:1,scale=iw:2:flags=neighbor,tile=layout=1x120:overlap=119:init_padding=119[caption_scroll];\
2157- [f3]format=gray,crop=iw:1:0:1,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 1':fontcolor=white:fontsize=18:x=20:y=20[wvf];\
2158- [f4]format=gray,crop=iw:1:0:2,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 2':fontcolor=white:fontsize=18:x=20:y=20[wvf2];\
2159- [caption_scroll][f1b][wvf][wvf2]vstack=4" ;;
2163+ ${PLAYBACK_FILTER_ADJUSTMENT} format=yuv420p10le|yuv422p10le|yuv444p10le|yuv440p10le,split=4[f1][f2][f3][f4];\
2164+ [f1]readeia608=scan_max=2:spw=0.30,drawtext=fontfile=${DEFAULTFONT} :fontcolor=white:fontsize=36:box=1:boxcolor=black@0.5:x=(w-tw)/2:y=h*3/4-ascent:text=Line %{metadata\\ \:lavfi.readeia608.0.line\\ \:-} %{metadata\\ \:lavfi.readeia608.0.cc\\ \:------} - Line %{metadata\\ \:lavfi.readeia608.1.line\\ \:-} %{metadata\\ \:lavfi.readeia608.1.cc\\ \:------}[f1b];\
2165+ [f2]crop=iw:1:0:1,scale=iw:2:flags=neighbor,tile=layout=1x120:overlap=119:init_padding=119[caption_scroll];\
2166+ [f3]format=gray,crop=iw:1:0:1,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 1':fontcolor=white:fontsize=18:x=20:y=20[wvf];\
2167+ [f4]format=gray,crop=iw:1:0:2,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 2':fontcolor=white:fontsize=18:x=20:y=20[wvf2];\
2168+ [caption_scroll][f1b][wvf][wvf2]vstack=4"
2169+ else
2170+ PLAYBACKFILTER=" \
2171+ ${PLAYBACK_FILTER_ADJUSTMENT} format=yuv420p10le|yuv422p10le|yuv444p10le|yuv440p10le,split=4[f1][f2][f3][f4];\
2172+ [f1]readeia608=scan_max=2:spw=0.30,metadata=mode=print:key=lavfi.readeia608.0.cc,drawtext=fontfile=${DEFAULTFONT} :fontcolor=white:fontsize=36:box=1:boxcolor=black@0.5:x=(w-tw)/2:y=h*3/4-ascent:text=Line %{metadata\\ \:lavfi.readeia608.0.line\\ \:-} %{metadata\\ \:lavfi.readeia608.0.cc\\ \:------} - Line %{metadata\\ \:lavfi.readeia608.1.line\\ \:-} %{metadata\\ \:lavfi.readeia608.1.cc\\ \:------},drawtext=fontfile=${DEFAULTFONT} :textfile=${CAP_DISPLAY_TMP} :reload=1:fontcolor=white:fontsize=18:x=(w-text_w)/2:y=h-100:shadowcolor=blue:shadowx=1:shadowy=1[f1b];\
2173+ [f2]crop=iw:1:0:1,scale=iw:2:flags=neighbor,tile=layout=1x120:overlap=119:init_padding=119[caption_scroll];\
2174+ [f3]format=gray,crop=iw:1:0:1,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 1':fontcolor=white:fontsize=18:x=20:y=20[wvf];\
2175+ [f4]format=gray,crop=iw:1:0:2,waveform=i=1:g=green,drawtext=fontfile=${DEFAULTFONT} :text='Line 2':fontcolor=white:fontsize=18:x=20:y=20[wvf2];\
2176+ [caption_scroll][f1b][wvf][wvf2]vstack=4"
2177+ fi ;;
21602178 # others
21612179 " Yes" |" Yes, after recording" |" Yes, concurrent with recording" |" No" ) ;;
21622180 * ) _report -w " Error: ${1} is not a valid option." ; return 1 ;;
@@ -2529,6 +2547,8 @@ elif [[ -n "${1}" ]] && [[ -z "${RUNTYPE}" ]] ; then
25292547fi
25302548
25312549VRECORD_INPUT_TMP=" $( _maketemp .vrecord_input.log) "
2550+ FFREPORT_TMP=" $( _maketemp .cffreport.txt) "
2551+ CAP_DISPLAY_TMP=" $( _maketemp .caption_scroll.txt) "
25322552
25332553# manage an include file to pass variables to gtkdialog
25342554VRECORD_VARS_FILE=" /tmp/v_$( echo " ${0} " | sed -e " s/[^A-Za-z0-9.]/_/g" ) _variables.txt"
@@ -2900,6 +2920,12 @@ fi
29002920if [[ " ${VRECORD_STEPS} " = " 2" ]] ; then
29012921 _writeingestlog " Record command" " ${RECORD_COMMAND[@]} "
29022922 _writeingestlog " Playback command" " ${PLAYER_COMMAND[@]} "
2923+
2924+ # start background caption process
2925+ # # disabling cchex_to_display during recording for now. If back here, please kill the CC_PID after use of it is done.
2926+ # # "${SCRIPTDIR}/cchex_to_display" "${FFREPORT_TMP}" "${CAP_DISPLAY_TMP}" > /dev/null 2> /dev/null &
2927+ # # CC_PID=$!
2928+ # # export FFREPORT="file=${FFREPORT_TMP}:level=32"
29032929 " ${RECORD_COMMAND[@]} " 2> >( tee " ${VRECORD_INPUT_TMP} " 1>&2 ) | \
29042930 if [[ " ${DEVICE_INPUT_CHOICE} " = 0 ]] && [[ " ${QCTOOLSXML_CHOICE} " = " Yes, concurrent with recording" ]]; then
29052931 tee >( " ${PLAYER_COMMAND[@]} " ) | " ${QCLI_COMMAND_PIPE[@]} "
0 commit comments