0

I'm currently using this FFMPEG script (using "run shell script" in Automator) on QT ProRes files to strip off the first six channels of audio, pass through for audio and video, and trim the first 6.5 seconds off the beginning of the video:

for f in "$@"
do
/usr/local/bin/ffmpeg -ss 6.5 -i "$f" -c:v copy -map 0:0 -c:a copy -map 0:7  "${f%.*}_ST.mov"
done

When I use this script, it successfully trims the file but then moves the original timecode up to the new beginning of the clip. So if 00:59:48:00 was my timecode at the beginning of the original clip, it's now also the starting timecode of the beginning of my trimmed clip.

My question is how can I trim 6.5 seconds off the beginning while also trimming that same amount of time off my timecode as well?

So instead of my trimmed clip (let's say 23.98 fps) starting at 00:59:48:00, it would start at 00:59:54:12 since 6.5 seconds (roughly 156 frames) have been trimmed.

Diogo Rocha
  • 9,759
  • 4
  • 48
  • 52
Alex Noble
  • 25
  • 5

1 Answers1

0

A manual way to do this is via

ffmpeg -ss 6.5 -i "$f" -c:v copy -map 0:0 -timecode 01:23:45:30 -c:a copy -map 0:7  "${f%.*}_ST.mov"

Don't see an automatic way to do this. There is a copyts option but that relates to the video packets, not the ancillary timecode track.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • I thought of doing this same thing, as I think it'll work as a short term solution for some of the files. The only issue in this case being that because a half of a second is 12 frames for 23.98fps and 14 frames for 29.97 fps, I'd need to make two different scripts. I'm still wondering if anyone knows a way to automate this as it would be very useful for working in a variety of video frame rates. – Alex Noble Feb 01 '16 at 20:38