So, I ended up finding a workaround for my issue. I can do color correction, or some other edits using DaVinci Resolve, export the individual clips and use FFMPEG to copy the metadata information (including the timecode) from the original source files to the color corrected exported files. This method requires the framerate and video file length to be the same as the original files. Don't trim or edit the length of the files or the timecode will be off.
Replace the following sections:
You of course need ffmpeg in the path you're executing this from
<Video file exported from DaVinci Resolve> Path to the video file exported from DaVinci Resolve
<Original file with the correct timecode and metadata> Path to the original file with the correct Timecode
<Output Filename>.mov Exported filename (must be .mov, but, you can change it to .mp4 later for imported in some other programs)
- Code: Select all
ffmpeg" -i "<Video file exported from DaVinci Resolve>" -i "<Original file with the correct timecode and metadata>" -c copy -map_metadata 1 -map 0:0 -map 0:1 -map 1:2 -map 1:3 -map 1:4 "<Output Filename>.mov"
The batch file below allows you to process all of the .mp4 files in a folder and correct the timecode. Save the code as a batch file and make sure to have FFMPEG in a "/bin" directory.
You'll need:
Have this batch file and FFMPEG in a "/bin" directory.
Directory with the source files in .mp4 format.
A directory inside the source file directory named "DaVinci Export" with the DaVinci Resolve exported .mp4 files.
All of the files in this directory must be named <Source Filename>_DR.mp4
Drag a source file onto the batch script and it will process all of the files and export them to a "\MetadataFix" directory and append "_MDF" to the end of the file.
The process doesn't re-encode the video so it's runs fairly quickly. Runs faster on an SSD because it has to read both source files and write the exported file at the same time. Just drag and drop any of the source files onto the script and it will run.
- Code: Select all
@echo off
SETLOCAL EnableDelayedExpansion
:: Edit this to tell the script anything that has been postpended to the filename of the DaVinci Resolve exported files.
set postpend=_DR
:: Edit this to tell the script anything that has been prepended to the filename of the DaVinci Resolve exported files.
set prepend=
:: This is the name of the nested directory under the source file directory that contains the DaVinci Resolve files
set DaVinciExportPath=DaVinci Export
:: Shouldn't need to edit below this line.
Set SourceScriptDirectory=%~dp0
echo %~dp1
cd %~dp1
mkdir "%~dp1\MetadataFix"
Set OutputDir=%~dp1MetadataFix
for %%f in (*.MP4) do (
if exist "%OutputDir%\%%~nf_MDF.mp4" (
ECHO.
ECHO *************************************************
ECHO ********** Output File already exists! **********
ECHO *************************************************
) else (
cls
ECHO.
ECHO *** Processing file: ***
ECHO *** "%~dp1%%~f" ***
ECHO.
START "" /WAIT "%SourceScriptDirectory%bin\ffmpeg" -i "%~dp1%DaVinciExportPath%\%prepend%%%~nf%postpend%.mp4" -i "%~dp1%%~f" -c copy -map_metadata 1 -map 0:0 -map 0:1 -map 1:2 -map 1:3 -map 1:4 "%OutputDir%\%%~nf_MDF.mov"
@echo on
Move "%OutputDir%\%%~nf_MDF.mov" "%OutputDir%\%%~nf_MDF.mp4"
)
)