Lossless ffmpeg conversion/encoding
24,308
You can use x264 in lossless manner I think. As in here and here use these flags for ffmpeg:
ffmpeg -i input.avi -c:v libx264 -qp 0 output.mkv
In case you couldn't load libx264, remove ffmpeg and install from source with x264 enabled. Here is how to.
Author by
Marc Brown
Mechatronics Engineering Inventor, Innovator, Programmer, Designer, Entrepreneur.
Updated on August 05, 2022Comments
-
Marc Brown almost 2 years
I'm looking for the best in quality when converting videos.
I only want to use lossless audio and video encoders and a good container.
How do I enable lossless x264 vcodec for ffmpeg?
I currently use
ffmpeg -i "inputvideo" -s 1280x720 -ar 48000 -threads 4 -vcodec libx264 -acodec copy -dsur_mode 2 -ac 6 "outputvideo720p.mkv"
I plan on using flac for the acodec by am unsure because I don't want to use quality if it switches to 16-bit instead of 24-bit
-
Marc Brown about 11 yearsI'm currently using ffmpeg's FFV1 loss-less codec. Even though it has a 40mbit bit-rate, it's the closest I can get to true loss-less conversions without presets.
-
MoDJ over 9 yearsBest answer is here: stackoverflow.com/questions/6701805/h264-lossless-coding/…
-
Hamed Tabatabaei over 9 yearsI see what he adds is pixel_format:444. Although it will be theoretically more lossless to have it, but in 99.9% of cases the input itself is already chroma-subsampled to 4:2:0. So practically no advantage in that. All a person needs is "-qp 0".
-
Валерий Заподовников over 2 yearsHamed, that is not tur for 10 bit, because only high444 supports lossless, high 10 is not lossless.