0

I have a multi-camera capture setup with 2 canon cameras. Each of these cameras have a tentacle sync e timecode generator connected to them.

After a video capture with these 2 cameras, the generated timecode (SMPTE format) is stored in the video files metadata.

It looks like this 00:00:53;30

How can I use ffmpeg to trim and align the frames of two video files using the SMPTE timecode metadata in each video file, and outputs two video files with only the matching frames?

So far, I am only able to extract the timecode using the script below

#!/bin/bash

file1="A001C002_220101EB_CANON.MXF"
file2="A001C002_220101US_CANON.MXF"

# Extract the SMPTE timecode from each video file
timecode1=$(ffmpeg -i "$file1" -hide_banner -f ffmetadata - 2>/dev/null | awk -F'=' '/timecode/{print $2}')
timecode2=$(ffmpeg -i "$file2" -hide_banner -f ffmetadata - 2>/dev/null | awk -F'=' '/timecode/{print $2}')
3
  • 1
    Why not use an actual video editor to do this. Multi-cam setup can always be code-synced [or even synced by any soundtrack [no matter how rough] from each camera's audio track. I often wonder why people struggle with command-line video solutions when one of the world's finest video editing suites is available free for personal use. DaVinci Resolve - Mac, Win & Nix.
    – Tetsujin
    Commented Feb 9, 2023 at 10:41
  • Yes, that is a good solution. But automating the process is crucial for the application. Commented Feb 9, 2023 at 10:47
  • I never use time-code [I'm just an enthusiastic amateur at this even though I do work in the film industry… not on video, though] but lining up multi-cam to audio is an automatic process. I can't imagine lining up to SMPTE being any harder to achieve.
    – Tetsujin
    Commented Feb 9, 2023 at 10:50

0

You must log in to answer this question.

Browse other questions tagged .