Ubuntu I have ffmpeg and in current dir I have img0000.png through img3000.png. How to…
- User
Ubuntu I have ffmpeg and in current dir I have img0000.png through img3000.png. How to turn it into an mkv with out losing ANY quality? its a very (purposefully) noisy video and i dont wanna lose the noise
Assistant
Here's a high-quality FFmpeg command to create an MKV without losing any image quality:
ffmpeg -framerate 24 -pattern_type glob -i 'img*.png' -c:v libx264 -preset veryslow -crf 0 -pix_fmt yuv444p output.mkvLet me break down the key parameters:
-framerate 24: Sets the frame rate (adjust if needed)-pattern_type glob -i 'img*.png': Captures all PNG images in sequence-c:v libx264: Uses x264 codec-preset veryslow: Highest compression/quality optimization-crf 0: Lossless compression (no quality loss)-pix_fmt yuv444p: Ensures full color preservation
The
veryslowpreset andcrf 0will ensure maximum quality preservation. Theyuv444ppixel format maintains full color information.If the images are from a very high-resolution source and you want to absolutely guarantee no quality loss, you might also consider:
ffmpeg -framerate 24 -pattern_type glob -i 'img*.png' -c:v libx264 -preset veryslow -crf 0 -pix_fmt yuv444p -qp 0 output.mkvThe additional
-qp 0provides an extra layer of lossless encoding.- User
60 fps.
Assistant
Here's the updated command for 60 fps:
ffmpeg -framerate 60 -pattern_type glob -i 'img*.png' -c:v libx264 -preset veryslow -crf 0 -pix_fmt yuv444p output.mkvThe only change is
-framerate 60to match your desired frame rate. This will maintain the full 60 fps while preserving all image quality.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.