Skip to content

Instantly share code, notes, and snippets.

@XDuskAshes
Last active January 13, 2025 05:49
Show Gist options
  • Select an option

  • Save XDuskAshes/1eba9bfbe7e96d71c96f37b617b33041 to your computer and use it in GitHub Desktop.

Select an option

Save XDuskAshes/1eba9bfbe7e96d71c96f37b617b33041 to your computer and use it in GitHub Desktop.
Convert MP4 files to something DaVinci Resolve will like.

DaVinci Resolve hates MP4s

(Or, at least the free version of Resolve does.)

When I edit videos, I typically either use an MP4 or just drop the recorded MKV into Kdenlive without even bothering to remux it in OBS. Although, I have noticed that DaVinci Resolve basically has an aneurysm if given an MP4. "Oh, did you try importing an MP4? Well screw you, I don't know what to do with that so I will give you a blank clip with a blank audio track :D"

Why does it do this instead of just an error message? I don't know. Best guess? Law of conservation of mass or whatever. Anyways, after scouring Resolve's forums, I found this post with my exact issue. The basic fix is simple. Have your input MP4, in this case input.mp4, and run this monstrosity:

ffmpeg -i input.mp4 -c:v dnxhd -profile:v dnxhr_sq -c:a pcm_s16le output.mov

I thought this was ugly so I made a BASH script wrapper for it.

#!/bin/bash

# Convert MP4 to MOV for DaVinci Resolve in BASH
# Made by Dusk - https://github.com/XDuskAshes/
# License: The Unlicense

INPUT_FILE=$1
OUTPUT_FILE_NAME=$2

if [ -z "$INPUT_FILE" ]; then
    echo "No input file."
    echo "Syntax: ./convert_for_davinci.sh <input_file> <output_file_name>"
    exit 1
fi

if [ -z "$OUTPUT_FILE_NAME" ]; then
    echo "No output file name."
    echo "Syntax: ./convert_for_davinci.sh <input_file> <output_file_name>"
    exit 1
fi

ffmpeg -i $INPUT_FILE -c:v dnxhd -profile:v dnxhr_sq -c:a pcm_s16le $OUTPUT_FILE_NAME.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment