herpaderppp
New Member
Hey everyone, I started messing around with ffmpeg recently and was wondering if anyone could help me out with a conceptual question.
My use case is simply recording a desktop screen (on Windows). Apart from basic quality baselines (30 fps, relatively good resolution, etc), I'm willing to sacrifice anything to minimize CPU usage as much as possible.
I would have expected OBS and ffmpeg to be relatively comparable (with OBS of course being more optimized) since both are native solutions. However, after trying a ton of configurations/codecs on ffmpeg, it seems I'm misunderstanding a piece of this problem conceptually. On my PC, OBS runs at 2-3% CPU with high quality and fps. Ffmpeg, on the other hand, averages around 20% and even with hardware acceleration, only reaches 11%.
Am I missing something here that accounts for the large difference?
For reference, I'm running commands along the lines of ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv.
Intuitively, an idea that crossed my mind is that in the limit, you can get minimal CPU if you just save the recording in a raw video format and do all the encoding afterward. However, that's not feasible since even though I don't care too much about memory, the memory consumption of using, say, a .yuv file is ridiculous. Maybe there's a middle ground?
My use case is simply recording a desktop screen (on Windows). Apart from basic quality baselines (30 fps, relatively good resolution, etc), I'm willing to sacrifice anything to minimize CPU usage as much as possible.
I would have expected OBS and ffmpeg to be relatively comparable (with OBS of course being more optimized) since both are native solutions. However, after trying a ton of configurations/codecs on ffmpeg, it seems I'm misunderstanding a piece of this problem conceptually. On my PC, OBS runs at 2-3% CPU with high quality and fps. Ffmpeg, on the other hand, averages around 20% and even with hardware acceleration, only reaches 11%.
Am I missing something here that accounts for the large difference?
For reference, I'm running commands along the lines of ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv.
Intuitively, an idea that crossed my mind is that in the limit, you can get minimal CPU if you just save the recording in a raw video format and do all the encoding afterward. However, that's not feasible since even though I don't care too much about memory, the memory consumption of using, say, a .yuv file is ridiculous. Maybe there's a middle ground?