Igor Vinograd wrote:Mads Johansen wrote: My opention is that ffmpeg and it's frontends are the best way to go, but if you find something else that works better, please report back

Ffmpeg is a good idea, I didn't think of it even though i'm already using it. I have a Sony camera and I use it to unpack the audio to make it play in Resolve. I'm not experienced with ffmpeg at all, I found the command on line and made a batch file out of it.
- Code: Select all
if not exist newfiles md newfiles
for %%A in (*.MTS) do ffmpeg -i "%%A" -vcodec copy -acodec pcm_s16le -ar 48000 -ac 2 "newfiles\%%~nA.mov"
pause
Are you aware what those options specify?
You copy the highly compressed video, yet convert the audio to raw uncompressed wave format. You can convert it to AAC (-c:a aac -ac 2 -b:a 320k (for -codec:audio aac, AudioChannels 2, Bitrate:Audio 320k)) and save some space that way.
Igor Vinograd wrote:Using this command as a template I put together this.
- Code: Select all
ffmpeg -i "input.mp4" -r 59.940 -s 1920x1080 -vcodec libx264 -acodec pcm_s16le -ar 48000 -ac 2 "output.mov"
It seems to encode ok but when I play it in Resolve the audio is ok and video is black.
Am I doing something wrong with the command?
Yes.

Oh you wanted to know what you did wrong? Sorry

You have a few options with regards to converting the video. (I am stealing info from
https://trac.ffmpeg.org/wiki/Encode/H.264 by the way).
1) Use the CRF (Constant Rate Factor) of 10 to 15 for nearly lossless conversion. Technically it should be 0, but then the files will be extremely large. (I just tested, with CRF 0 the file is larger than when converted to DNxHR 444.... And then there's no point).
2) Use a preset: medium, slow, slower, veryslow, placebo. I like placebo, but it takes a long time to convert (in the range of 2 fps with 12 cores maxed out). The problem is that you have no control over the bit rate when using presets. I have found the faster ones to give very poor quality.
3) Another way is to convert to mpeg4 (aka h.263). There you can force the quality to be the same as the input, but the files does not explode in size. It will further more be more responsive to edits (as in the delay when you cut or change something will be lower=> It will feel faster).
I will give the command lines for each option and let you test them out for yourself, see which gives a result you are happy with.
I kept your -AudioRate 48000, but I am not sure it is needed if your audio source is 48000 hz to begin with (ffmpeg will tell you that, but it does not matter
Option 1:
- Code: Select all
if not exist newfiles md newfiles
for %%A in (*.MTS) do ffmpeg -i "%%A" -r 60000/1001 -s 1920x1080 -vcodec libx264 -crf NUMBER_HERE -pix_fmt yuv420p -c:a aac -ac 2 -b:a 320k -ar 48000 "newfiles\%%~nA.mov"
pause
Option 2:
- Code: Select all
if not exist newfiles md newfiles
for %%A in (*.MTS) do ffmpeg -i "%%A" -r 60000/1001 -s 1920x1080 -vcodec libx264 -preset PRESET_NAME -pix_fmt yuv420p -c:a aac -ac 2 -b:a 320k -ar 48000 "newfiles\%%~nA.mov"
pause
Option 3:
- Code: Select all
if not exist newfiles md newfiles
for %%A in (*.MTS) do ffmpeg -i "%%A" -r 60000/1001 -s 1920x1080 -vcodec mpeg4 --q:v 1 -c:a aac -ac 2 -b:a 320k -ar 48000 "newfiles\%%~nA.mov"
pause
Davinci Resolve Studio 20 build 49, Windows 11, Ultra 7 265k, Nvidia 5070 TI, 576.80 Studio