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}')