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
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is a cheat-sheet you can copy-paste.
Every variant keeps the exact pixel values of your PNGs, so the “good” noise stays intact.
Pick whichever codec/container combo best fits your workflow.
1) Quick, portable and 100 % lossless
(FFV1 inside Matroska)
bash
# 30 fps example, change -framerate if you need another speed
ffmpeg -framerate 30 \
-i img%04d.png \
-c:v ffv1 \
-level 3 \
-pix_fmt rgb24 \
noisy_video_ffv1.mkv
Why?
• FFV1 is mathematically lossless.
• Works great in a .mkv container.
• Keeps the original RGB data (no 4:2:0 subsampling).
Playback support: VLC, mpv, etc. Editing support is good in most FOSS tools.
• -crf 0 + -preset veryslow makes x264 output mathematically lossless.
• yuv444p avoids chroma-subsampling.
• Files are usually smaller than FFV1, but decoding needs more CPU.
3) “Store every frame as PNG inside MKV”
(Biggest files, but absolutely identical to the sources.)
Matroska happily accepts a PNG-per-frame video track.
Additional tips
If your sequence doesn’t start at img0000.png, add -start_number N (where N is the first number).
Got transparency? swap rgb24 → rgba (for FFV1) or rgba pix-fmt for x264.
Need audio? Just add -i audio.wav -c:a flac before the output file.
Double-check: ffprobe -v error -select_streams v:0 -show_entries stream=pix_fmt,codec_name
should report ffv1/rgb24, h264/yuv444p, or png/rgba respectively.
That’s it—zero quality loss, full noisy glory. Enjoy! 🎞️
User
60 fps.
Assistant
Roger that—just bump the input frame-rate to 60 fps (and optionally set the output rate too, so the container is flagged as 60 fps).
Here are the same three lossless options updated: