Convert consumer video formats to DNxHD

07/08/2019 - 10:57
Average: 4 (1 vote)

DaVinci Resolve is a professional video editing application by BlackMagic Design. The "Basic" version is available for Linux, Mac and Windows environment for free. It supports various professional video codecs, but unlike consumer editors it does lack in support for consumer video formats, for example h264 formated videos will not be imported with video under Linux (As of version 15, in 16 it should work!).

The solution to this problem is quite easy, converting the video files to a DNxHD with FFmpeg. DNxHD is a more editor friendly format as every frame is compressed separately instead of relying on previous frames and therefore the editing software can easily seek frame accurately in the video without need to decompress any intermediate frames. It is still a lossy format so take that into account when choosing the bitrate, larger is obviously better, downside is the space requirement. This way obviously leads to much larger files, meaning you need quite a lot of disk space for the converted videos.

DNxHD support Full HD (1920x1080) and HD (1280x720) frame sizes only.

DNxHD is very picky about video frame size, pixel format and framerate. The ffmpeg output format must match precisely one of the DNxHD profiles below:

Valid DNxHD profiles for Full HD, 1920x1080

DNxHD profiles
Frame size Bitrate Pixel Format FPS GB/Minute
1920x1080p 175Mbps yuv422p10 24 (24000/1001) 1.26 GB
1920x1080p 185Mbps yuv422p10 25 1.38 GB
1920x1080p 365Mbps yuv422p10 50 2.7 GB
1920x1080p 440Mbps yuv422p10 60 (60000/1001) 3.3 GB
1920x1080p 115Mbps yuv422p 24 (24000/1001) 0.84 GB
1920x1080p 120Mbps yuv422p 25 0.9 GB
1920x1080p 145Mbps yuv422p 30 (30000/1001) 1 GB
1920x1080p 240Mbps yuv422p 50 1.8 GB
1920x1080p 290Mbps yuv422p 60 (60000/1001) 2.1 GB
1920x1080p 175Mbps yuv422p 24 (24000/1001) 1.2 GB
1920x1080p 185Mbps yuv422p 25 1.38 GB
1920x1080p 220Mbps yuv422p 30 (30000/1001) 1.62 GB
1920x1080p 365Mbps yuv422p 50 2.7 GB
1920x1080p 440Mbps yuv422p 60 (60000/1001) 3.3 GB
1920x1080p 36Mbps yuv422p 24 (24000/1001) 0.24 GB
1920x1080p 36Mbps yuv422p 25 0.24 GB
1920x1080p 45Mbps yuv422p 30 (30000/1001) 0.3 GB
1920x1080p 75Mbps yuv422p 50 0.54 GB
1920x1080p 90Mbps yuv422p 60 (60000/1001) 0.66 GB
1920x1080p 350Mbps yuv422p10 24 (24000/1001)  
1920x1080p 390Mbps yuv422p10 25  
1920x1080p 440Mbps yuv422p10 30 (30000/1001)  
1920x1080p 730Mbps yuv422p10 50  
1920x1080p 880Mbps yuv422p10 60 (60000/1001)  

Valid DNxHD profiles for HD, 1280x720

DNxHD profiles
Frame size Bitrate Pixel Format FPS GB/Minute
1280x720p 90Mbps yuv422p10 24 (24000/1001)  
1280x720p 90Mbps yuv422p10 25  
1280x720p 180Mbps yuv422p10 50  
1280x720p 220Mbps yuv422p10 60 (60000/1001)  
1280x720p 90Mbps yuv422p 24 (24000/1001)  
1280x720p 90Mbps yuv422p 25  
1280x720p 110Mbps yuv422p 30 (30000/1001)  
1280x720p 180Mbps yuv422p 50  
1280x720p 220Mbps yuv422p 60 (60000/1001)  
1280x720p 60Mbps yuv422p 24 (24000/1001)  
1280x720p 60Mbps yuv422p 25  
1280x720p 75Mbps yuv422p 30 (30000/1001)  
1280x720p 120Mbps yuv422p 50  
1280x720p 145Mbps yuv422p 60 (60000/1001)  

How to pick the output format ?

The output DNxHD frame format (Resolution and FPS) must match the video format of the source, so make sure you choose a suitable format from the above table.

For example if your input video is a Full HD 1920x1080, 25 FPS then you can choose output bitrates of 120, 185 or 46 Mbps. Choose the bitrate depending on how good quality you need for whatever you need to do with the DNxHD video, the bigger bitrate the more space the output video will take.

Example commands for converting to DNxHD with FFmpeg

Examples
Description FFmpeg command line
Input: MP4, Full HD, 50fps

Output: DNxHD 1920x1080p, yuv422p, 75Mbps, 50fps, Uncompressed PCM audio


ffmpeg -i input-video.mp4 -c:v dnxhd -vf "fps=50/1,format=yuv422p" -b:v 75M -c:a pcm_s16le output-video.mov

 
Hardware accelerated decoding of h264

Input: MP4, Full HD, 50fps

Output: DNxHD 1920x1080p, yuv422p, 75Mbps, 50fps, Uncompressed PCM audio
ffmpeg -c:v h264_cuvid -i input-video.mp4 -c:v dnxhd -vf "fps=50/1,format=yuv422p" -b:v 75M -c:a pcm_s16le output-video.mov

 

 

 

Changelog: 
22/02/2019 - 13:44
Keywords: 
FFmpeg, DNxHD, Transcoding, Codes, FullHD, 4K, 2K, DNxHR