Ffmpeg best setting for x264 or x265 for easier decoding

Hello guys.
I want to capture a 8bit RGB video (like a screen capture), and turn it into a x264 or 265 lossless file that is the easiest to decode/scrub on the timeline of shotcut.

Here what I think I will use :

  • CRF0 (lossless)
  • pix_fmt RGB24 (lossless)
  • x264 (easier to decode than x265 ?)
  • preset ultrafast (for fast encode, useful for screen capture)
  • tune fastdecode
  • tune zerolatency
  • all-I (easier to decode than P frames and B frames)

I understand that zerolatency disable b-frames, which also make the file easier to decode.
Can someone make me an FFmpeg script for the best decoding speed for x264 and x265 ?

Should I go ALL-I or keep P-frames ? are P frames tolerable for a fast scrub ?

I want to get the lowest CPU usage while decoding.
Thank you very much.

I’ll assume you want to stream copy audio

ffmpeg -i input.ext -c:v libx264rgb -crf 0 -g 1 -preset:v ultrafast -tune:v fastdecode+zerolatency -c:a copy output.mkv

Intra will be faster for decoding and seeks, x264 will be faster than x265

A lot of it depends on your hardware, and personal tolerance for speed

If it’s still too “slow” for you - you can try the proxy edit feature

1 Like

I recommend that you use Proxy and Preview Scaling if your goal is “easiest to decode/scrub on the timeline” as that is its sole purpose. It does not generate lossless, but you do not need lossless for proxy.

1 Like

Thank you very much guys. I will try your methods.
I will get back if I have something new.

I knew about proxy I wanted to try if I could create a “one size fits all” file, storage/editing/lowsize. Hence a Lossless with compression but relatively easy to decode. Prior I used cineform at half resolution as editing proxy files are still big if lossless.

Have a good day.

Proxy files don’t need to be lossless or high quality. The are just there to make editing easier. You swap back the originals for final quality export . (You might need a higher quality and resolution proxy if you were doing delicate work, and needed to zoom in for accurate placements, those sorts of reason)

But lossless compression won’t produce something “lowsize”, and certainly not with intra encoding . The settings you specified are making it “less” compressed, easier to decode. Basically the largest filesize possible and yet still be losslessly compressed by x264

If you think cineform at half resolution was large in filesize, these files will be much (!) larger than cineform even at full resolution. Probably 5-10x larger. Cineform is a “visually” lossy codec, and usually only the subsampled variant is used (10bit422) .

Short GOP’s on average will cut the size in ~1/2 . But the decoding latency and scrub times suffer. You decide which tradeoffs you want to make. Do you really need something lossless ?

1 Like

OK I understand, if they are bigger than cineform I am not even going that path.
I thought the compression of x264 would give me better compression than cineform.
I will do what you said. Thank you very much.

This topic was automatically closed after 90 days. New replies are no longer allowed.