where (I’m not sure but probably it is true) appsrc is fidded with jpeg images from camera (probably camera provides raw data, but then they converted to jpeg via OpenCV).
Are there any ways to tune provided pipeline to get better video quality? Maybe add some properties to some elements or add/remove gst elements? Mybe key-int-max=5 to get more I-frames?
Generally, you’d want to reduce the frequency of i-frames to improve the quality, so you can increase key-int-max. You can also increase the bitrate of the encoder. Those are pretty much the two things you can do.
Thank you very much for reply. But shouldn’t I increase fequency of I-frames (keyframes), so that there would be more of them? So, put it simple – decrease key-int-max (say to 5), decrease distance between keyframes?
Keyframes don’t increase the quality, they affect where you can start decoding again when you seek or after data loss (in case of network transmission or aerial broadcast; not applicable if you write to an mp4 file).
Keyframes take up a lot of bytes, so if you have keyframes very frequently that means that you spend a lot of bytes on keyframes that could otherwise have been spent on encoding more details in non-keyframes (everything else equal).
It’s probably fine to have a keyframe only every couple of seconds or so (depends on your content of course and if you have other requirements like splicing the video later).
This moment is not clear to me – do we have some budget in terms of bytes and we should decide on which we should spend it? I mean, obviously, given live stream this seems to be the case, but given some buffer of jpegs where we need to get video of best quality with minimum size, should we pay attention to budget?
Last but not least, what you’ve metioned above is called bitrate?
Yes, assumption was that your rate control mechanism is bitrate based, in which case there is a finite budget.
If you do rate control by target quality/quantizer, it’s still true that keyframes don’t improve quality, but they also don’t make anything worse (as there’s no finite budget), they just make your file/stream larger than it would be otherwise.