From 479f8561e84bf1ded9102a5d3ef758c853daea95 Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Mon, 1 Dec 2025 14:14:05 -0500 Subject: [PATCH 1/2] fix typo --- vrecord | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vrecord b/vrecord index b8760b2d..ee4f2c29 100755 --- a/vrecord +++ b/vrecord @@ -2939,7 +2939,7 @@ if [[ "${DEVICE_INPUT_CHOICE}" = "0" ]] ; then MP4NAME="${DIR}/${FULL_OUTPUT_ID}.mp4" EXTRAOUTPUTS+=("${MIDDLEOPTIONS_ALL[@]}" -movflags write_colr+faststart "${RECORD_COMMAND_MP4[@]}" -pix_fmt yuv420p -c:v h264 -c:a aac -map "[mp4_v_out]" "${AUDIO_CHANNEL_MAP[@]}" "${MP4NAME}") fi - if [[ "${FORMAT}" = "matroska" ]] ; then + if [[ "${FORMAT}" = "Matroska" ]] ; then _review_option "EMBED_LOGS_CHOICE" "${EMBED_LOGS_OPTIONS[@]}" fi fi From e749e9b4280dbd97293b2c21e1d3887904b18d96 Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Mon, 1 Dec 2025 14:23:12 -0500 Subject: [PATCH 2/2] add post-process to make a timecode vtt file --- Resources/vrecord_functions | 2 ++ vrecord | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Resources/vrecord_functions b/Resources/vrecord_functions index a18f4e86..f771ca7e 100644 --- a/Resources/vrecord_functions +++ b/Resources/vrecord_functions @@ -65,6 +65,7 @@ _update_config_file(){ echo "QCTOOLSXML_CHOICE=\"${QCTOOLSXML_CHOICE}\"" echo "MP4_CHOICE=\"${MP4_CHOICE}\"" echo "FRAMEMD5_CHOICE=\"${FRAMEMD5_CHOICE}\"" + echo "TIMECODEVTT_CHOICE=\"${TIMECODEVTT_CHOICE}\"" echo "EMBED_LOGS_CHOICE=\"${EMBED_LOGS_CHOICE}\"" echo "PLAYBACKVIEW_CHOICE=\"${PLAYBACKVIEW_CHOICE}\"" echo "PLAYBACKVIEW_CHOICE_PASS=\"${PLAYBACKVIEW_CHOICE_PASS}\"" @@ -265,6 +266,7 @@ _get_summary(){ echo "Auxiliary files created in ${LOGDIR}" echo "Access MP4: ${MP4_CHOICE}" echo "Frame MD5s: ${FRAMEMD5_CHOICE}" + echo "Timecode VTT: ${TIMECODEVTT_CHOICE}" echo "QCTools XML: ${QCTOOLSXML_CHOICE}" echo "Playback: ${PLAYBACKVIEW_CHOICE} view (for recording) and ${PLAYBACKVIEW_CHOICE_PASS} view (for passthrough)" elif [ "${DEVICE_INPUT_CHOICE}" = "1" ] ; then diff --git a/vrecord b/vrecord index ee4f2c29..ad625f56 100755 --- a/vrecord +++ b/vrecord @@ -776,6 +776,11 @@ SIDECAR_FILES_GUI=" \"${FRAMEMD5_CHOICE}\" FRAMEMD5_CHOICE + + + \"${TIMECODEVTT_CHOICE}\" + TIMECODEVTT_CHOICE + $(_gtk_vbox_list "QCTOOLSXML_CHOICE" "180" "QCTools XML?" "${QCTOOLSXML_OPTIONS[@]}") @@ -3154,6 +3159,16 @@ if [[ "${DEVICE_INPUT_CHOICE}" = 0 ]] ; then _report -d "QCTools analysis is complete." fi + # make a timecode vtt + if [[ "$TIMECODEVTT_CHOICE}" = "true" ]] && [[ "${FORMAT}" = "Matroska" ]] && [[ -n "${TIMECODE_CHOICE}" ]] && [[ "${TIMECODE_CHOICE}" != "none" ]] ; then + _report -d "Working on the timecode vtt file..." + TIMECODEXML_TMP="$(_maketemp .mediatimecode.txt)" + TIMECODEXML_VTT="${LOGDIR}/${FULL_OUTPUT_ID}.timecode.vtt" + mediainfo --ParseSpeed=1 --Output=TimeCodeXML "${VRECORD_OUTPUT}" > "${TIMECODEXML_TMP}" + # need to test if timecode file has any data or not before committing to a vtt + timecodexml2webvtt "${TIMECODEXML_TMP}" > "${TIMECODEXML_VTT}" + _mv_tmp_file "${TIMECODEXML_TMP}" "${TIMECODEXML_VTT}" + fi # check for discontinuities in the Frame MD5s; if user chose not to use Frame MD5s, check for frame discontinuties in the FFmpeg file if [[ "${FRAMEMD5_CHOICE}" = "true" ]] ; then PTS_DISCONTINUITY=$(cat "${FRAMEMD5NAME}" | grep -v "^#" | cut -d, -f3 | sed 's/ //g' | grep -v "^0$" | awk '{if($1!=p+1){if(p+1==$1-1){printf p+1" "}else{printf p+1"-"$1-1" "}}{p=$1}}')