<div dir="ltr">Just to close this thread out, I finally was able to write a script that combines two camera videos.<br><br>I do have one problem still with Ardour or ffmpeg, please see my update in-line. <br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 24, 2018 at 1:30 PM, robertlazarski <span dir="ltr"><<a href="mailto:robertlazarski@gmail.com" target="_blank">robertlazarski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I have another problem now with this phone, I can't get the phone video wav file sample position per LTC frame to match the q8 sample position. This is what I think is causing a 2 second delay sync problem in a 3 minute or so in a test video that has parts from both the q8 and the phone. <br><br><div class="gmail_extra"><br><div class="gmail_quote"><div>I can't seem to fix this, each LTC frame has a different size in the phone wav file compared to the q8.wav file. Both of the original videos show "CABAC / 1 Ref Frames" . However the phone video audio was recorded as AAC while the q8 video audio was recorded as PCM so maybe that is the issue.<br><br></div><div># phone video in mp4 format and AAC audio, cannot fix this with ffmpeg by any conversion I tried<br></div><div>00000000   00:26:55:01 |     3118     4715  # (4715 - 3118) = 1597<br><br></div><div># q8 mov video and PCM audio<br>00000000   00:26:55:01 |     3123     4724 # (4724 - 3132) = 1601<br><br></div><div>Any idea how to fix this? <br></div><span class="gmail-"><div><br></div></span><br></div></div></div></blockquote><div><br></div><div>There was several issues here, I suspect write speed was one of them so I put in class 10 SD in the Q8 pair and F8 which seemed to help.  <br><br></div><div>Really the main issue though was scripting ffmpeg with segments didn't pan out. I asked a question on the ffmpeg list but had no response, I will follow up there with the details. I had much better luck using ffmpeg "ss" and "to" params by calculating the times with the sample position of the ltc. <br><br>I was able to do a calculated camera transition between the pair of Q8 cameras that way with a little less than .5 millseconds or around 20 sample positions missing in the transitions. I tried to do better but ran out of ideas.  I may try again at some point. <br><br></div><div>The one Ardour problem I still have is that when exporting a video, I do not see the PMC option for the F8 24 bit audio, I only see pcm_s16le . See the output below from mediainfo on the F8 file: <br><br>Audio<br>Format                                   : PCM<br>Format settings                          : Little / Signed<br>Codec ID                                 : 1<br>Duration                                 : 3 min 10 s<br>Bit rate mode                            : Constant<br>Bit rate                                 : 4 608 kb/s<br>Channel(s)                               : 4 channels<br>Sampling rate                            : 48.0 kHz<br>Bit depth                                : 24 bits<br>Stream size                              : 104 MiB (100%)<br><br></div><div>I see this from ffmpeg, I am not sure if I need 24 bits or 32 bits? <br><br>ffmpeg -v error -formats | grep -i pcm | grep 24 | grep little-endian | grep -v unsigned<br><br>DE s24le           PCM signed 24-bit little-endian<br><br>ffmpeg -v error -formats | grep -i pcm | grep 32 | grep little-endian | grep -v unsigned<br><br> DE f32le           PCM 32-bit floating-point little-endian<br> DE s32le           PCM signed 32-bit little-endian<br><br></div><div>However in Ardour when exporting a mov video I only see this pcm audio option in the audio codec drop down: <br><br></div><div>pcm_s16le<br><br></div><div>Any guidance appreciated. <br><br></div><div>This is how my script turned out. At some point I may install Davinci Resolve but it requires CentOS 7 and that's not my distro. This script will be what I use for the next few months as I kind of like the idea of auto editing. Will see how far it gets me. <br><br>#!/bin/bash<br><br># This script generates a single video from parts of videos from 2 Zoom Q8 cameras <br># by using ltc on ch1 of each video. The priority is as little ltc audio drift as possible, <br># script performance and extra transcoding are not an issue. Little audio drift in this case <br># means the start and end times match the source videos closely, with no dropped video frames <br># nor dropped ltc frames. I was able to get within .2 seconds by the end of the video, <br># and while I have no immediate ideas how to do better I will continue to try.<br><br># The ltc comes from 2 Tentacle Sync units, that were 'jammed' to a <br># Zoom F8. The main idea is to sync the video with the BWF 8 track audio generated on <br># on the Zoom F8 via Ardour. This is possible by using the BWF timecode metadata, and<br># ltc on ch1 of the video. ch2 contains a scratch track.  <br><br># A fixed duration such as 20 seconds is set, indicating a camera <br># transision. Videos are mov at 1280x720 with ltc audio at 48KHZ / 16 bits. <br><br># usage:<br># /home/myuser/input> ls<br># output  parseLTC.sh  q81.mov  q82.mov<br># /home/myuser/input> cd output/<br># /home/myuser/input/output> sh ../parseLTC.sh<br><br># clear any files from previous processing<br>rm -f *.txt<br>rm -f *cut*<br>rm -f *.csv<br><br># read LTC from wav files, first camera is q81 and the second camera is q82<br>ffmpeg -y -v error -nostdin -i ../q81.mov -vn -c:a pcm_s16le -ar 48000 -ac 2 q81.wav<br>ffmpeg -y -v error -nostdin -i ../q82.mov -vn -c:a pcm_s16le -ar 48000 -ac 2 q82.wav<br><br>ltcdump -f 29.97 q81.wav 2> /dev/null > q81.ltc.txt<br>ltcdump -f 29.97 q82.wav 2> /dev/null > q82.ltc.txt<br><br># some errors I found while playing option bingo with ffmpeg<br>validate() {<br>    lastTimecodeInSegment=0<br>    lastTimecodeInSegment=`tail -n 1 ltc.txt | awk '{ print $2 }' | sed 's/\(.*\):/\1./'  `<br>    # can sometimes receive unparsable dates<br>    if [[ ${#lastTimecodeInSegment} -ne 11 ]]; then<br>        lastTimecodeInSegment=0<br>        printf "\nError processing file %s\n" "${fileToProcess}"<br>        printf "\ntimecode number of chars is not correct: "<br>        printf " %s" "${#lastTimecodeInSegment}"<br>        return<br>    fi<br>    # can receive invalid time such as: 00000680   00:13:61:10 |       22     1609<br>    if ! date -d "$lastTimecodeInSegment" >/dev/null 2>&1; then<br>        printf "\nError processing file %s\n" "${fileToProcess}"<br>        printf "\ninvalid date format:" printf " %s" "$lastTimecodeInSegment"<br>        return<br>    fi<br>    epoch_secs_ltc_to_process=$(date +%s --date="$timecode_date ${lastTimecodeInSegment}")<br>    ltc_to_process_formatted="$timecode_date ${lastTimecodeInSegment}"<br>    printf "\nltc_to_process_formatted: $ltc_to_process_formatted"<br>    if [[ $epoch_secs_ltc_to_process -ne 0 && $epoch_secs_stop_time -ne 0 && $epoch_secs_ltc_to_process -ge $epoch_secs_stop_time ]]; then<br>        found_stop_time=1<br>        printf "\nskipping file %s\n" "${fileToProcess}"<br>        printf "\ntimecode found:"<br>        printf " %s" "${ltc_to_process_formatted}"<br>        printf "\nis after or equal to stop time: "<br>        printf " %s" "${epoch_secs_stop_time_formatted}"<br>        return<br>    fi<br>    startingSamplePositionInSegment=0<br>    startingSamplePositionInSegment=`tail -n 1 ltc.txt | awk '{ print $4 }' | sed 's/\(.*\):/\1./'  `<br>    endingSamplePositionInSegment=0<br>    endingSamplePositionInSegment=`tail -n 1 ltc.txt | awk '{ print $5 }' | sed 's/\(.*\):/\1./'  `<br>    printf "\nltc seems valid"<br>    isLTCDumpOutputValid=1<br>}<br><br># define timecode start time, just add date<br>timecode_date=2018-05-16<br># skip segments before this timecode<br>epoch_secs_start_time=$(date +%s --date="$timecode_date 00:04:25")<br>start_timecode=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_start_time seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>start_time_formatted="$timecode_date $start_timecode"<br># define timecode stop time<br>epoch_secs_stop_time=$(date +%s --date="$timecode_date 00:07:10")<br>stop_timecode=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_stop_time seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>stop_time_formatted="$timecode_date ${stop_timecode}"<br>timeDivisionInSeconds=20<br>let epoch_secs_timecode_to_find=$((epoch_secs_start_time + timeDivisionInSeconds))<br>find_timecode=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_timecode_to_find seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>find_timecode_formatted="$timecode_date ${find_timecode}"<br><br>let epoch_secs_next_timecode_to_find=$epoch_secs_timecode_to_find+$timeDivisionInSeconds<br>next_timecode_to_find=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_next_timecode_to_find seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>next_timecode_to_find_formatted="$timecode_date ${next_timecode_to_find}"<br><br>q81HasLTCStartTime=0<br>hasRejectBeforeTime=0<br>q81TimeCodeInProgress=0<br>q82TimeCodeInProgress=0<br>q81PositionTimeStart=''<br>q81PositionTimeStop=''<br>q82PositionTimeStart=''<br>q82PositionTimeStop=''<br>fourtyEightKHZ=48000<br><br>while read -r lineq81<br>do<br>    ltc_line=''<br>    ltc_line="$lineq81"<br>    hasLTC=0<br>    hasLTC=`echo $ltc_line | grep -v '#' | grep ':' | wc -w`<br>    if [[ $hasLTC -eq 0 ]]; then<br>        printf "\ncannot parse timecode on line: $ltc_line \n"<br>        continue<br>    fi<br>    rm -f ltc.txt<br>    # find timecode in format 'HH:MM:SS.00' with frames as last 2 digits used for .00 time.<br>    # remove occasional '.' in the form 00:00:00.0 instead of 00:00:00:0 <br>    # remove negative values<br>    # disallow 0000000f   00:12:25:45<br>    echo $ltc_line | grep -v '#' | grep 00000000 | grep -v '\.' | grep -v '-' > ltc.txt<br>    validate<br>    if [[ $found_stop_time -eq 1 ]]; then<br>        printf "\nq81 video is after stop time, executing break after writing last csv entry\n"<br>        if [[ $q81PositionTimeStart != '' && $q81PositionTimeStop != '' ]]; then<br>            printf "\nExecuting: echo  $q81PositionTimeStart","$q81PositionTimeStop >> q81_out.csv"<br>            echo  $q81PositionTimeStart","$q81PositionTimeStop >> q81_out.csv<br>        fi<br>        break<br>    fi<br>    if [[ $q81HasLTCStartTime -eq 0 && $isLTCDumpOutputValid -eq 0 ]]; then<br>        printf "\non q81HasLTCStartTime=0 and isLTCDumpOutputValid=0 ... skipping"<br>        continue<br>    fi<br>    if [[ $q81HasLTCStartTime -eq 0 && $isLTCDumpOutputValid -eq 1 ]]; then<br>        dateDiff=0<br>        dateDiff=`date -d "$ltc_to_process_formatted $(date -d "$start_time_formatted" +%s.%N) seconds ago" +%s.%N`<br>        if awk 'BEGIN{exit ARGV[1]>ARGV[2]}' "0" "$dateDiff"<br>        then<br>            q81HasLTCStartTime=1<br>            printf "\non dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is later than or equal to start_time_formatted $start_time_formatted"<br>            printf "\nproceeding ...\n"<br>            samplePositionOffsetQ81=0<br>            samplePositionOffsetQ81=$(awk "BEGIN {printf \"%.6f\",${startingSamplePositionInSegment}/${fourtyEightKHZ}}")<br>            q81PositionTimeStart=$samplePositionOffsetQ81<br>            printf "\ncalculated first start position on q81: $q81PositionTimeStart\n"<br>        else<br>            printf "\non dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is before start_time_formatted $start_time_formatted"<br>            printf "\nskipping ...\n"<br>            continue<br>        fi<br>    fi<br>    if [[ $isLTCDumpOutputValid -eq 0 && $q81TimeCodeInProgress -eq 1 ]]; then<br>        printf "\nq81 video is the default and is in progress, occasional bad timecode values are ok"<br>        continue<br>    fi<br>    if [[ $isLTCDumpOutputValid -eq 0 && $q81TimeCodeInProgress -eq 0 ]]; then<br>        printf "\nskipping , ltc is invalid and q81TimeCodeInProgress is false: "<br>        continue<br>    fi<br>    if [[ $hasRejectBeforeTime -eq 1 ]]; then<br>        dateDiff=0<br>        dateDiff=`date -d "$ltc_to_process_formatted $(date -d "$rejectBeforeTime_formatted" +%s.%N) seconds ago" +%s.%N`<br>        <br>        if awk 'BEGIN{exit ARGV[1]>ARGV[2]}' "$dateDiff" "0"<br>        then<br>            printf "\nexecuting continue , dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is before or equal to rejectBeforeTime_formatted $rejectBeforeTime_formatted \n"<br>            continue<br>        else<br>            printf "\nproceeding , dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is after $rejectBeforeTime_formatted \n"<br>        fi<br>    fi<br>  <br>    dateDiff=0<br>    dateDiff=`date -d "$ltc_to_process_formatted $(date -d "$find_timecode_formatted" +%s.%N) seconds ago" +%s.%N`<br>    <br>    if awk 'BEGIN{exit ARGV[1]>ARGV[2]}' "0" "$dateDiff" <br>    then<br>        printf "\non dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is later than or equal to find_timecode_formatted $find_timecode_formatted \n"<br>    else<br>        printf "\non dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is less than find_timecode_formatted $find_timecode_formatted \n"<br>        printf "\nproceeding ..."<br><br>        if [[ $q81TimeCodeInProgress -eq 0 ]]; then<br>            samplePositionOffsetQ81=0<br>            samplePositionOffsetQ81=$(awk "BEGIN {printf \"%.6f\",${startingSamplePositionInSegment}/${fourtyEightKHZ}}")<br>            q81PositionTimeStart=$samplePositionOffsetQ81<br>            printf "\ncalculated samplePositionOffsetQ81: $samplePositionOffsetQ81 , from $startingSamplePositionInSegment / $fourtyEightKHZ"<br>        else<br>            # will reset on each loop<br>            q81PositionTimeStop=0<br>            q81PositionTimeStop=$(awk "BEGIN {printf \"%.6f\",${endingSamplePositionInSegment}/${fourtyEightKHZ}}")<br>            printf "\nfound q81PositionTimeStop $q81PositionTimeStop"<br>        fi<br>        q81TimeCodeInProgress=1<br>        continue<br>    fi<br><br>    printf "\nfound find_timecode: "<br>    printf " %s" "${find_timecode}"<br>    printf "\nwill now process the q82 files looking for timecode later than or equal to: "<br>    printf " %s" "${find_timecode_formatted}"<br>    printf "\nand timecode before or equal to: "<br>    printf " %s" "${next_timecode_to_find_formatted}"<br><br>    if [[ $q81PositionTimeStart != '' && $q81PositionTimeStop != '' ]]; then<br>        printf "\nExecuting: echo  $q81PositionTimeStart","$q81PositionTimeStop >> q81_out.csv"<br>        echo  $q81PositionTimeStart","$q81PositionTimeStop >> q81_out.csv<br>    else<br>        printf "\nloop completed without valid timecode, executing break"<br>        break<br>    fi<br>    q81PositionTimeStop=0<br>    q81TimeCodeInProgress=0<br>    samplePositionOffsetQ82=0<br>    q81PositionTimeStart=''<br>    q81PositionTimeStop=''<br>    while read -r lineq82<br>    do<br>        ltc_line=''<br>        ltc_line="$lineq82"<br>        hasLTC=0<br>        hasLTC=`echo $ltc_line | grep -v '#' | grep ':' | wc -w`<br>        if [[ $hasLTC -eq 0 ]]; then<br>            printf "\ncannot parse timecode on line: $ltc_line \n"<br>            continue<br>        fi<br>        rm -f ltc.txt<br>        # find timecode in format 'HH:MM:SS.00' with frames as last 2 digits used for .00 time.<br>        # remove occasional '.' in the form 00:00:00.0 instead of 00:00:00:0 <br>        # remove negative values<br>        # disallow 0000000f   00:12:25:45<br>        echo $ltc_line | grep -v '#' | grep 00000000 | grep -v '\.' | grep -v '-' > ltc.txt<br>        validate<br>        if [[ $found_stop_time -eq 1 ]]; then<br>            printf "\nq82 video is after stop time, executing break after writing last csv entry\n"<br>            break<br>        fi<br>        if [[ $isLTCDumpOutputValid -eq 0 && $q82TimeCodeInProgress -eq 1 ]]; then<br>            printf "\nfound LTC error while q82TimeCodeInProgress=1, skipping"<br>            continue<br>        fi<br>        if [[ $isLTCDumpOutputValid -eq 0 ]]; then<br>            printf "\nFound ltc error outside time range while processing q82 , skipping"<br>            continue<br>        fi<br>        dateDiff=0<br>        dateDiff=`date -d "$ltc_to_process_formatted $(date -d "$find_timecode_formatted" +%s.%N) seconds ago" +%s.%N`<br>        if awk 'BEGIN{exit ARGV[1]>ARGV[2]}' "0" "$dateDiff" <br>        then<br>            printf "\nproceeding , dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is later or equal to find_timecode_formatted $find_timecode_formatted"<br>        else<br>            printf "\nskipping q82 timecode on dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is before find_timecode_formatted $find_timecode_formatted"<br>            continue<br>        fi<br><br>        dateDiff=0<br>        dateDiff=`date -d "$ltc_to_process_formatted $(date -d "$next_timecode_to_find_formatted" +%s.%N) seconds ago" +%s.%N`<br><br>        if awk 'BEGIN{exit ARGV[1]>ARGV[2]}' "$dateDiff" "0"<br>        then<br>            printf "\nproceeding on dateDiff $dateDiff , $ltc_to_process_formatted is before or equal to $next_timecode_to_find_formatted"<br>        else<br>            printf "\nexecuting break  , dateDiff $dateDiff , ltc_to_process_formatted $ltc_to_process_formatted is greater than next_timecode_to_find $next_timecode_to_find"<br>            break<br>        fi<br><br>        if [[ $q82TimeCodeInProgress -eq 0 ]]; then<br>            samplePositionOffsetQ82=0<br>            samplePositionOffsetQ82=$(awk "BEGIN {printf \"%.6f\",${startingSamplePositionInSegment}/${fourtyEightKHZ}}")<br>            q82PositionTimeStart=$samplePositionOffsetQ82<br>            printf "\ncalculated q82PositionTimeStart: $q82PositionTimeStart , from $startingSamplePositionInSegment / $fourtyEightKHZ"<br>        else<br>            # will reset on each loop<br>            samplePositionOffsetQ82=0<br>            samplePositionOffsetQ82=$(awk "BEGIN {printf \"%.6f\",${endingSamplePositionInSegment}/${fourtyEightKHZ}}")<br>            q82PositionTimeStop=$samplePositionOffsetQ82<br>            printf "\ncalculated q82PositionStopTime: $q82PositionTimeStop , from $endingSamplePositionInSegment / $fourtyEightKHZ"<br>        fi<br>        q82TimeCodeInProgress=1<br>        printf "\nfound ltc in range. loop ended"<br><br>  done < q82.ltc.txt<br>  if [[ $q82PositionTimeStart != '' && $q82PositionTimeStop != '' ]]; then<br>      printf "\nExecuting: echo  $q82PositionTimeStart","$q82PositionTimeStop >> q82_out.csv"<br>      echo  $q82PositionTimeStart","$q82PositionTimeStop >> q82_out.csv<br>   else<br>      printf "\nloop completed without valid timecode, executing break"<br>      break<br>  fi<br>  q82TimeCodeInProgress=0<br>  q82PositionTimeStart=''<br>  q82PositionTimeStop=''<br>  # reset everything for next loop<br>  let epoch_secs_rejectBeforeTime=$epoch_secs_next_timecode_to_find<br>  reject_timecode=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_rejectBeforeTime seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>  rejectBeforeTime_formatted="$timecode_date ${reject_timecode}"<br>  hasRejectBeforeTime=1<br>  increment=$(( $timeDivisionInSeconds * 2 ))<br>  let epoch_secs_timecode_to_find=$epoch_secs_timecode_to_find+$increment<br>  find_timecode=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_timecode_to_find seconds" | cut -b1-11 | sed 's/\(.*\):/\1./' ` <br>  find_timecode_formatted="$timecode_date ${find_timecode}"<br>  let epoch_secs_next_timecode_to_find=$epoch_secs_next_timecode_to_find+$increment<br>  next_timecode_to_find=`date +%H:%M:%S:%N --date="Jan 1, 1970 00:00:00 +0000 $epoch_secs_next_timecode_to_find seconds" | cut -b1-11  | sed 's/\(.*\):/\1./' ` <br>  next_timecode_to_find_formatted="$timecode_date ${next_timecode_to_find}"<br>  printf "\nloop completed, timecode_to_find has been reset: "<br>  printf " %s" "${find_timecode_formatted}"<br>  printf "\nnext_timecode_to_find_formatted has been reset: "<br>  printf " %s" "${next_timecode_to_find_formatted}"<br>  printf "\nrejectBeforeTime_formatted has been reset: "<br>  printf " %s" "${rejectBeforeTime_formatted}"<br>done < q81.ltc.txt<br><br>xx=0<br>while IFS=, read -r col1 col2<br>do<br>    printf "\nExecuting: ffmpeg -y -v error -nostdin -i ../q81.mov -ss $col1 -to $col2 -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 q81_cut_"$xx".mov"<br>    ffmpeg -y -v error -nostdin -i ../q81.mov -ss $col1 -to $col2 -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 q81_cut_"$xx".mov<br>    # debug<br>    printf "\nExecuting: ffmpeg -y -v error -nostdin -i q81_cut_"$xx".mov -vn -acodec pcm_s16le -ar 48000 -ac 2 "q81_cut_"$xx".mov.wav" "<br>    ffmpeg -y -v error -nostdin -i q81_cut_"$xx".mov -vn -acodec pcm_s16le -ar 48000 -ac 2 "q81_cut_"$xx".mov.wav"<br>    xx=$((xx + 1))<br>done < q81_out.csv<br><br>yy=0<br>while IFS=, read -r col1 col2<br>do<br>    printf "\nExecuting: ffmpeg -y -v error -nostdin -i ../q82.mov -ss $col1 -to $col2 -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 q82_cut_"$yy".mov"<br>    ffmpeg -y -v error -nostdin -i ../q82.mov -ss $col1 -to $col2 -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 q82_cut_"$yy".mov<br><br>    printf "\nExecuting: ffmpeg -y -v error -nostdin -i q82_cut_"$yy".mov -vn -acodec pcm_s16le -ar 48000 -ac 2 "q82_cut_"$yy".mov.wav" "<br>    # debug<br>    ffmpeg -y -v error -nostdin -i q82_cut_"$yy".mov -vn -acodec pcm_s16le -ar 48000 -ac 2 "q82_cut_"$yy".mov.wav"<br>    yy=$((yy + 1))<br>done < q82_out.csv<br><br>zz=0<br>if [[ $xx -eq $yy ]]; then<br>    zz=$xx<br>elif [[ $xx -gt $yy ]]; then<br>    zz=$xx<br>else<br>    zz=$yy<br>fi <br><br>for (( c=0; c<$zz; c++ ))<br>do  <br>   printf "\nExecuting: ls *cut_"$c"*.mov | sort | sed 's/^/file /' >> cuts.txt"<br>   ls *cut_"$c"*.mov | sort | sed 's/^/file /' >> cuts.txt<br>done<br><br>printf "\nExecuting: ffmpeg -y -v error -nostdin -f concat -fflags +genpts -safe 0 -i cuts.txt -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 cuts.mov"<br><br>ffmpeg -y -v error -nostdin -f concat -fflags +genpts -safe 0 -i cuts.txt -c:a pcm_s16le -c:v libx264 -refs 1 -x264opts b-pyramid=0 -r 30000/1001 -threads 0 -s 1280x720 -b:v: 1024k -bufsize 1216k -maxrate 1280k -b:a 192k -sample_fmt s16 -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.000100:first_pts=0" -crf 0 cuts.mov<br><br># debug<br>ffmpeg -y -v error -nostdin -i cuts.mov -vn -c:a pcm_s16le -ar 48000 -ac 2 cuts.wav<br><br>exit<br><br><br><br></div><div><br><br><br><br></div></div></div></div></div>