How to encode UHD 4K video from camera for DaVinci Resolve input using ffmpeg

I use this command to convert the video from my phone (in UHD / 4K) for use as input Media in DaVinci Resolve using the DNxHR codec.

ffmpeg -i input.mp4 -vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p -r 30000/1001 -profile:v dnxhr_hq

Note that the DNxHR files are huuuuuuge, around 10GB per minute even for some rather uncomplicated video! However, encoding is pretty fast (around 0.5x real-time on my computer) and you won’t really lose any significant amount of quality in this video type.

This shell script will batch-encode all .mp4 files in the current folder to DNxHR

for i in *.mp4 ; do ffmpeg -i $i -vcodec dnxhd -acodec pcm_s16le -pix_fmt yuv422p -r 30000/1001 -profile:v dnxhr_hq ${i}.mov ; done