brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
260 stars 25 forks source link

Video decoding preformance #15

Closed lukors closed 3 years ago

lukors commented 3 years ago

I've noticed videos played in vimix take up more CPU than those played in for instance VLC. Just as an example, one of my videos in vimix takes ~80% cpu, the same video in VLC takes ~30% cpu. In Totem video player the same video also takes ~80% CPU, so I'm thinking it might be down to which decoding library is being used or something like that?

Would it be possible to have the same performance as VLC in vimix?

I'm on Linux.

brunoherbelin commented 3 years ago

Indeed, the video decoding is by default only on CPU under linux.

This is mostly a problem of compilation and packaging of the gstreamer nvdec : it is complex to deal with users different hardware and availability of GPU.

Would an option for compiling vimix with/without NVIDIA support be of any help? This could be simpler to implement...

MoorPoor commented 3 years ago

Hei! Nvidia support option would be a very good start

lukors commented 3 years ago

Being able to play more videos at the same time opens up many possibilities, so I think nvdec option would be great!

In my particular case I don't think it would help however because I don't have a discrete gpu. I have an 11th gen intel cpu.

brunoherbelin commented 3 years ago

So, I could manage to use the nvidia decoding plugins, and it seems to work fine :)

However, this requires gstreamer version >= 1.18, which is not provided in the snap package (v1.14); so to be able to benefit from this performance improvement, you have to compile vimix from source in a system with a recent version of gstreamer (e.g. Ubuntu 20.10).

Regarding the difference in performance for CPU decoding, such large difference is a bit surprising: gstreamer is using libav decoders, which are the same as in VLC. Maybe trying with a more recent version could help? (i.e. compile, see above).

lukors commented 3 years ago

My CPU apparently has hardware video decoding which VLC was using.

After compiling vimix from source I've been able to verify that it is also using hardware video decoding. :)

Thanks for the help!