3000 explained code solutions for 75 technologies

ffmpegLossless conversion using H.264 codec

ffmpeg -i in.mp4 -c:v libx264 -preset veryslow -qp 0 out.mkvctrl + c

name of the package to install

-i in.mp4

input video file

-c:v libx264

use H.264 codec


specify preset (mode) to use for conversion, where ultrafast is fastest but primitive and veryslow is slowest but most efficient

-qp 0

sets quality level to lossless


resulting video file

Usage example

ffmpeg -hide_banner -f lavfi -i nullsrc -c:v libx264 -preset help -f mp4 - 2>&1 | grep Possible
[libx264 @ 0x561c3c9d3ec0] Possible presets: ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
[libx264 @ 0x561c3c9d3ec0] Possible tunes: film animation grain stillimage psnr ssim fastdecode zerolatency