How I make the most of local trail shot video

#!/bin/bash

declare -a STARTS
declare -a LENGTH

OUTN="15m-commute"
OUTE="mov"

FILE+=("FILE0001.MOV");	START+=("00:00:39");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:01:06");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:01:57");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:02:05");	LENGTH+=("00:00:03");
FILE+=("FILE0001.MOV");	START+=("00:02:34");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:02:53");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:03:43");	LENGTH+=("00:00:02");
FILE+=("FILE0001.MOV");	START+=("00:04:04");	LENGTH+=("00:00:06");
FILE+=("FILE0001.MOV");	START+=("00:05:17");	LENGTH+=("00:00:03");
FILE+=("FILE0001.MOV");	START+=("00:05:37");	LENGTH+=("00:00:03");
FILE+=("FILE0001.MOV");	START+=("00:06:07");	LENGTH+=("00:00:04");
FILE+=("FILE0001.MOV");	START+=("00:06:21");	LENGTH+=("00:00:04");
FILE+=("FILE0001.MOV");	START+=("00:07:05");	LENGTH+=("00:00:02");
FILE+=("FILE0001.MOV");	START+=("00:07:24");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:07:36");	LENGTH+=("00:00:01");
FILE+=("FILE0001.MOV");	START+=("00:07:46");	LENGTH+=("00:00:10");
FILE+=("FILE0001.MOV");	START+=("00:08:23");	LENGTH+=("00:00:05");
FILE+=("FILE0001.MOV");	START+=("00:08:51");	LENGTH+=("00:00:05");
FILE+=("FILE0001.MOV");	START+=("00:09:06");	LENGTH+=("00:00:10");
FILE+=("FILE0002.MOV");	START+=("00:00:09");	LENGTH+=("00:00:12");
FILE+=("FILE0002.MOV");	START+=("00:00:42");	LENGTH+=("00:00:04");
FILE+=("FILE0002.MOV");	START+=("00:00:58");	LENGTH+=("00:00:10");
FILE+=("FILE0002.MOV");	START+=("00:01:58");	LENGTH+=("00:00:15");
FILE+=("FILE0002.MOV");	START+=("00:02:41");	LENGTH+=("00:00:04");
FILE+=("FILE0002.MOV");	START+=("00:02:49");	LENGTH+=("00:00:08");
FILE+=("FILE0002.MOV");	START+=("00:03:21");	LENGTH+=("00:00:01");
FILE+=("FILE0003.MOV");	START+=("00:00:23");	LENGTH+=("00:00:15");
FILE+=("FILE0003.MOV");	START+=("00:00:55");	LENGTH+=("00:00:05");
FILE+=("FILE0003.MOV");	START+=("00:01:05");	LENGTH+=("00:00:25");
FILE+=("FILE0003.MOV");	START+=("00:01:32");	LENGTH+=("00:00:05");
FILE+=("FILE0003.MOV");	START+=("00:01:43");	LENGTH+=("00:00:03");
FILE+=("FILE0003.MOV");	START+=("00:02:09");	LENGTH+=("00:00:06");
FILE+=("FILE0003.MOV");	START+=("00:02:33");	LENGTH+=("00:00:06");
FILE+=("FILE0003.MOV");	START+=("00:02:47");	LENGTH+=("00:00:04");
FILE+=("FILE0003.MOV");	START+=("00:03:26");	LENGTH+=("00:00:35");
FILE+=("FILE0004.MOV");	START+=("00:00:04");	LENGTH+=("00:00:03");
FILE+=("FILE0004.MOV");	START+=("00:00:44");	LENGTH+=("00:00:15");
FILE+=("FILE0004.MOV");	START+=("00:01:20");	LENGTH+=("00:00:05");
FILE+=("FILE0004.MOV");	START+=("00:01:57");	LENGTH+=("00:00:20");
FILE+=("FILE0004.MOV");	START+=("00:02:26");	LENGTH+=("00:00:01");
FILE+=("FILE0005.MOV");	START+=("00:00:43");	LENGTH+=("00:00:05");
FILE+=("FILE0005.MOV");	START+=("00:01:53");	LENGTH+=("00:00:30");
FILE+=("FILE0005.MOV");	START+=("00:03:12");	LENGTH+=("00:00:06");
FILE+=("FILE0005.MOV");	START+=("00:03:25.25");	LENGTH+=("00:00:06");
FILE+=("FILE0005.MOV");	START+=("00:03:39");	LENGTH+=("00:00:06");
FILE+=("FILE0005.MOV");	START+=("00:04:15.35");	LENGTH+=("00:00:07");
FILE+=("FILE0005.MOV");	START+=("00:04:50");	LENGTH+=("00:00:09");
FILE+=("FILE0006.MOV");	START+=("00:00:00");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:00:10");	LENGTH+=("00:00:03");
FILE+=("FILE0006.MOV");	START+=("00:00:22");	LENGTH+=("00:00:04");
FILE+=("FILE0006.MOV");	START+=("00:00:59");	LENGTH+=("00:00:04");
FILE+=("FILE0006.MOV");	START+=("00:01:23");	LENGTH+=("00:00:04");
FILE+=("FILE0006.MOV");	START+=("00:01:33");	LENGTH+=("00:00:04");
FILE+=("FILE0006.MOV");	START+=("00:02:21");	LENGTH+=("00:00:04");
FILE+=("FILE0006.MOV");	START+=("00:03:16");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:03:24");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:03:30");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:04:58");	LENGTH+=("00:00:03");
FILE+=("FILE0006.MOV");	START+=("00:05:36");	LENGTH+=("00:00:10");
FILE+=("FILE0006.MOV");	START+=("00:06:25");	LENGTH+=("00:00:05");
FILE+=("FILE0006.MOV");	START+=("00:06:39");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:07:41");	LENGTH+=("00:00:02");
FILE+=("FILE0006.MOV");	START+=("00:08:08");	LENGTH+=("00:00:10");
FILE+=("FILE0006.MOV");	START+=("00:09:01");	LENGTH+=("00:00:05");
FILE+=("FILE0007.MOV");	START+=("00:00:02");	LENGTH+=("00:00:16");
FILE+=("FILE0009.MOV");	START+=("00:00:02");	LENGTH+=("00:00:04");
FILE+=("FILE0009.MOV");	START+=("00:00:26");	LENGTH+=("00:00:04");
FILE+=("FILE0009.MOV");	START+=("00:00:36");	LENGTH+=("00:00:04");
FILE+=("FILE0009.MOV");	START+=("00:02:40");	LENGTH+=("00:00:06");
FILE+=("FILE0010.MOV");	START+=("00:01:01");	LENGTH+=("00:00:02");
FILE+=("FILE0010.MOV");	START+=("00:01:26");	LENGTH+=("00:00:02");
FILE+=("FILE0010.MOV");	START+=("00:03:01");	LENGTH+=("00:00:05");

N=0

for F in "${FILE[@]}"
do
  OUT=$(printf "${OUTN}%02d.${OUTE}" $N)
  if [[ ${START[$N]} ]]
  then
    echo  "Clip $N: start ${START[$N]}  length ${LENGTH[$N]}... "
    ffmpeg -y -ss "${START[$N]}" -i ${FILE[$N]} -t "${LENGTH[$N]}" \ 
           -vcodec copy -acodec copy $OUT
    FILES+=("$OUT")
  fi
  N=$((N+1))
done

ffmpeg -y -f concat -i <(printf "file '$PWD/%s'n" "${FILES[@]}") \
       -c copy "$OUTN.$OUTE"

ffmpeg -i 15m-commute.mov -i hardfloor_robot_hardfloor_remix.mp3 \
       -vf 'fade=t=in:st=0:d=1, fade=t=out:st=467:d=10' \
       -filter_complex amix=inputs=2:duration=shortest \
       -t 00:07:57 -vcodec libx264 -acodec mp3 15m-commute-robot.mp4


Information

"How I make the most of local trail shot video"

BASH script for video editing

Journal entry - 20:45 Wednesday 25 November 2015

DISCLAIMER: The opinions and attitudes of James W. Morris as expressed here in the past may or may not accurately reflect the opinions and attitudes of James W. Morris at present, moreover, they may never have.

Comments

this page last updated:25th November 2015 jwm-art.net (C) 2003 - 2017 James W. Morris

script time:0.0472