How to fix certain H264 MP4s that cannot be imported into DaVinci Resolve

Recently I came across a set of video recordings that DaVinci Resolve would not import. According to its Media Storage viewer, the folder they were in was empty, except for one of the videos which was suspicious to me. These recordings played fine in multiple media players but most suggestions I could find for resolving the issue via Google either blamed the user, suggested they have to upgrade to DaVinci Resolve Studio, or worst of all – transcode the videos to a compatible format. Transcoding is time intensive and lossy, and Studio costs money, so let’s try to avoid either of those.

There are a couple ways to identify whether this is going to work for your video files.

  • If Windows does not display a thumbnail for them then that’s a good sign (I haven’t verified what MacOS or Linux do in this situation).
  • In VLC, if you view the codec information you will see something like this:
VLC codec information showing "(h264)" in brackets

The (h264) part is the hint that our file is in a format that Resolve doesn’t support. This ID means the file contains NAL units in a certain format that differs from other H264 files that may otherwise be identified by (avc1). We can change this by using ffmpeg and we can do it fast and without any transcoding.

If you don’t have ffmpeg already, take a look at Audacity’s guide for installing it.

On Windows, in a Command Prompt you’ll run the following command to convert the video file:

ffmpeg -hide_banner -loglevel quiet -stats -i in_video.mp4 -c:v copy -c:a copy out_video.mp4

Where in_video.mp4 is the path to our input and out_video.mp4 is the path and name you want for the output video.

The simple act of copying the original streams into a new output container allows ffmpeg to recalculate the NAL units that Resolve is happy with. This should run very quickly and leave you with a video that has a visible thumbnail on Windows, and can be imported by Resolve. If you check the resulting output video in VLC it will show its codec ID to be (avc1).

There is a chance that the resulting video could lose damaged chunks, so check the difference in duration carefully and review the output for lost data.

If you have a lot of videos with this issue that you need to convert, you can create a simple batch file on Windows that will allow you to drag and drop to convert them:

@echo off
if "%~1"=="" echo only drag and drop files&pause&exit
ffmpeg -hide_banner -loglevel quiet -stats -i "%~1" -c:v copy -c:a copy "%~n1 fixed%~x1"

Save as convert.bat for example, and drag your broken videos to it one by one to fix them. Your new output video will maintain the original filename with “fixed” appended to the end.

3 thoughts on “How to fix certain H264 MP4s that cannot be imported into DaVinci Resolve

  1. Jason Arnopp

    Hello there!

    I really appreciate that you took the time to write this article… but as I’m not hugely tech-savvy, I don’t understand what I literally have to do in order to make the MP4 file compatible with Da Vinci Resolve 17… Am I using VLC to convert?

    Reply
    1. brent Post author

      Sorry for glossing over that detail – I’ve made a brief edit to the article that hopefully makes it more clear.

      You’ll be using an app called ffmpeg to do the actual work to fix the video file. If you need to download a copy of ffmpeg you can get it from the official site here. If you’re still a bit unsure, Audacity has an installation guide and they link to a bit more user friendly installer. Hope that helps!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *