Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lossless ffmpeg conversion/encoding

Tags:

ffmpeg

codec

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

like image 670
Marc Brown Avatar asked Jul 29 '12 23:07

Marc Brown


People also ask

Is FFmpeg lossless?

FFV1 is a video codec developed within FFmpeg. It is lossless, meaning that it compresses video without introducing quantization degradations. Therefore, FFV1 is a good choice for ​archiving and preservation.

Is H 264 lossless?

The are many lossless video codecs, common ones include H. 264 Lossless, H. 265 Lossless, Motion JPEG Lossless, Apple Animation Quicktime RLE, Autodesk Animator Codec, and many more. Lossless, means that when you use this type of compression for your file you do not lose any of the file information.

Is CRF 0 lossless?

The range of the CRF scale is 0–51, where 0 is lossless (for 8 bit only, for 10 bit use -qp 0), 23 is the default, and 51 is worst quality possible.

What codec does FFmpeg use?

For the MP4 extension, if you input a 1080p file, FFmpeg will encode using the H. 264 video codec at about 9 to 10 Mbps, the AAC audio codec at around 130 Kbps, a keyframe interval of 250 frames, the High profile, and the medium x264 preset.


1 Answers

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.

like image 194
Hamed Tabatabaei Avatar answered Oct 08 '22 22:10

Hamed Tabatabaei