Convert consumer video formats to DNxHD

06/06/2019 - 15:15
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)  
1920x1080p 185Mbps yuv422p10 25  
1920x1080p 365Mbps yuv422p10 50  
1920x1080p 440Mbps yuv422p10 60 (60000/1001)  
1920x1080p 115Mbps yuv422p 24 (24000/1001)  
1920x1080p 120Mbps yuv422p 25  
1920x1080p 145Mbps yuv422p 30 (30000/1001)  
1920x1080p 240Mbps yuv422p 50  
1920x1080p 290Mbps yuv422p 60 (60000/1001)  
1920x1080p 175Mbps yuv422p 24 (24000/1001)  
1920x1080p 185Mbps yuv422p 25  
1920x1080p 220Mbps yuv422p 30 (30000/1001)  
1920x1080p 365Mbps yuv422p 50  
1920x1080p 440Mbps yuv422p 60 (60000/1001)  
1920x1080p 36Mbps yuv422p 24 (24000/1001)  
1920x1080p 36Mbps yuv422p 25  
1920x1080p 45Mbps yuv422p 30 (30000/1001)  
1920x1080p 75Mbps yuv422p 50  
1920x1080p 90Mbps yuv422p 60 (60000/1001)  
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)  

The output format (Resolution, FPS) must match the source, so make sure you choose and suitable format from the table. For example if you input video is Full HD 1920x1080, 25 FPS then you choices of bitrate are 120, 185 and 46 Mbps.

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