AVCHD Import Into Davinci Resolve
If you use Davinci Resolve to do video editing, you have probably encountered that it has format constraints. Interlacing and AC-3 audio made these files from my Sony HDR-CX210 unusable in it. This is how it got fixed.
ffmpeg -i "<inputfile>" -vf "yadif=0:-1:0" -vcodec dnxhd -b:v 36M -acodec pcm_s16le "<outputfile>"
This is a cheap camera and there are plenty like it on the market. The output is optimized for BlueRay, but that doesn’t translate really well to putting the video on YouTube or whatever other on-line format you have.
We fix this by de-interlacing with the Yadif deinterlacer and dumping to a format that is good for editing. Avid’s DNxHD codec is a good intermediate format for that. We’re taking it as a low bitrate (for an intermediate format) because the source compression is pretty brutal to begin with.
The results are pretty good:
Note that the resulting file was also color graded because why not?
Now that we know how to do it, to do a whole lot of them, you can safely use this script to handle a large number:
set FFMPEG="C:\Program Files\MediaCoder\codecs64\ffmpeg.exe" for %%a in ("*.mts") do %FFMPEG% -i "%%a" -vf "yadif=0:-1:0" -vcodec dnxhd -b:v 36M -acodec pcm_s16le "%%~na.mov"
Save as a .bat file (use your location of where to find ffmpeg), open a command prompt, ‘cd’ to the folder with your MTS files, and enter the full path to the batch file (e.g. “c:\users\Public Users\Documents\MTS_to_Mov.bat”)