[FFmpeg-user] Directly converting DNGs to MP4

Michael Koch astroelectronic at t-online.de
Sun Nov 22 12:28:00 EET 2020


Am 08.11.2020 um 18:12 schrieb ZEITFELD:
>   
>
> Hello nice girls ans guys!
>
> I have a highspeed camera that records raw data to DNG files. Now I try
> to have the fastest possible preview video of what is recorded. I
> succeeded using the GPU via FFMPEG, which is absolutely the fastest way
> I found until now.
>
> This is the command line I use:
>
> FFMPEG -R 25 -F IMAGE2 -I FRAME_%06D.DNG -VCODEC LIBX264 -CRF 25
> -PIX_FMT YUV420P PREVIEW.MP4
>
> This gives me a MP4, but the colors are broken, the image is too dark
> and green and the quality is very bad, with a lot of banding and
> artifacts.
>
> Does anyone know how to make ffmpeg apply reasonably balanced settings
> when reading the DNGs?

did you (or anybody else) find a solution for this problem?

Paul did already give a few hints:
-- swscale is old and ignores color_trc metadata that is required for 
correct display
-- use zscale for converting pixel formats
-- set output trc
-- make sure to set right pixel format prior to calling zscale as it 
does not support bayer formats

Open questions:
-- How can zscale be used for converting the pixel format, if it doesn't 
support the "bayer_rggb16le" format that the input images have? zscale 
doesn't have any options for pixel formats.
-- Is "output trc" a synonym for "transfer characteristic"? Is that the 
"transfer" option in zscale? To which value must it be set?
-- How can the pixel format be set prior to calling zscale? With 
"-pix_fmt" before the input? Or after the input? Or with 
"-pixel_format"? Or with "format=" at the beginning of the filter chain?
-- The input color space is "sRGB". How can this be set?

I did already spend about 20 hours of try-and-error on this problem 
before I gave up.
Part of the problem is the missing documentation for the zscale filter. 
That's only a list of options and possible values. No explanations what 
the options mean, and no examples.

Michael



More information about the ffmpeg-user mailing list