Raptor Computing Systems Community Forums (BETA)

Software => Applications and Porting => Topic started by: MauryG5 on November 08, 2020, 03:12:39 pm

Title: Video Encoding
Post by: MauryG5 on November 08, 2020, 03:12:39 pm
Hi everyone, for some time I have been testing high definition video on my Power system and I realized that I cannot go beyond the 1440P. From what I know, unfortunately on Power the video decoding is not optimized to the best and consequently, the performance is not what you can get on an X86 or ARM system. Whatever application you use or whatever browser you use, in the end you can't get regular and fluid 4K content unfortunately but only in 2K. My question at this point arises spontaneously, will we ever manage to have one day, the optimization we need to finally have a video decoding worthy of the name? It is not known ...
Title: Re: Video Encoding
Post by: pocock on November 08, 2020, 03:50:08 pm

Have you tried the ffmpeg patches?

The work is being sponsored through BountySource but I'm not sure if it is merged into ffmpeg, you can search the ffmpeg trac (https://trac.ffmpeg.org/search?q=bountysource&noquickjump=1&milestone=on&ticket=on&wiki=on) or try to apply the patches manually.

The new Radeon cards have AV1 on the card and many existing Radeon cards can do some existing codecs too.  Have you tried using any software that uses the GPU-based decoders?  I think gstreamer has some plugin support for various cards.
Title: Re: Video Encoding
Post by: MauryG5 on November 09, 2020, 01:05:25 am
Hi, no I haven't tried these solutions.  So is gstreamer an application to install or something else?  Let me understand better ... thanks
Title: Re: Video Encoding
Post by: pocock on November 09, 2020, 03:54:40 am

gstreamer is a framework that can be used to create multimedia applications

It can also be used from scripts to do various things involving real-time streams or modification of media files

For example, you can use one plugin to read an MP4 file and another plugin to display it in a window.

I think that Radeon should work with VA-API
https://gstreamer.freedesktop.org/documentation/vaapi/vaapidecodebin.html

and this is for NVIDIA
https://gstreamer.freedesktop.org/documentation/nvcodec/index.html

The Arch Linux wiki has some comments on the way to access hardware encoding/decoding for different GPUs:
https://wiki.archlinux.org/index.php/Hardware_video_acceleration

Title: Re: Video Encoding
Post by: MauryG5 on November 09, 2020, 07:26:58 am
Ok, but let me understand more specifically, I have to run that command described in the site, the first, the one where it says "example of launch line" and then what should I do?
Title: Re: Video Encoding
Post by: pocock on November 09, 2020, 01:45:26 pm

You need to adapt the example command to make it do what you want to do.

It might be helpful to ask people in the mailing list or IRC channel for gstreamer, they can help you construct a gstreamer command to do just about anything and they may be interested in how you are using it on a new platform
Title: Re: Video Encoding
Post by: MauryG5 on November 09, 2020, 03:10:43 pm
Ok thanks, I'll try to find that channel, which server must you connect to to reach this channel via irc, what about?
Title: Re: Video Encoding
Post by: MauryG5 on November 13, 2020, 04:58:39 pm
Hi Pocock, I tried to use that command you posted to me but I get the syntax wrong, so I didn't quite understand how to use it. Can you write the exact syntax that I need to report on the terminal to make me better understand how to use it? Thank you very much
Title: Re: Video Encoding
Post by: pocock on November 14, 2020, 11:09:52 am

This is the example command in the page:

Code: [Select]
gst-launch-1.0 filesrc location=~/big_buck_bunny.mov ! qtdemux ! h264parse ! vaapidecodebin ! vaapisink

Notice that the qtdemux is only for a Quicktime file (*.mov).  If your input file has another format, such as MP4 or WebM, then you need to replace the qtdemux with another element.

I recommend asking on the mailing list for gstreamer (https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel), this is also a good way to raise awareness about what people are trying to do with OpenPOWER.


Please post the full command line you are trying to use and the full error.
Title: Re: Video Encoding
Post by: MPC7500 on November 14, 2020, 11:22:32 am
Or just use Google search -> enable vaapi fedora and you will get a result like this (https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/).
Title: Re: Video Encoding
Post by: MauryG5 on November 15, 2020, 06:59:18 am
well guys thanks, i will try to see both ways and i will let you know if i get the desired result ... thanks a lot
Title: Re: Video Encoding
Post by: MauryG5 on November 15, 2020, 09:35:26 am
Guys I'm reading now what the good MPC7500 recommended to me and I found what he says. In practice, it should be enough for me to run the command "sudo dnf install chromium-libs-media-freeworld" to enable the video acceleration patch on the GPU on Chromium and thus relieve the CPU of this task since the software for Power is not optimized unfortunately for us . I have the RPM Fusion for some time now as they are used to use other programs such as VLC for example that requires them before installing it and since then I have already installed them. I try to do this simple step and see what I get, it seems simpler and more immediate than the other. Thanks always very much to MPC for his excellent reports!
Title: Re: Video Encoding
Post by: MauryG5 on November 16, 2020, 01:40:53 pm
Hello all friends of Power, I tried a few operations but unfortunately I did not get the desired results. In the meantime I tried to run that command according to a guide I read on Google, but apparently it does not exist for Power as it tells me no match. So I followed another guide where it told me to install some file of which 2 I already had and 1 I didn't, and then to enable this time on Firefox, some options to activate this GPU acceleration but in the end it didn't work anyway. The only doubt I have is that he asks me Wayland as a graphic designer while I have always had and used Xorg. I wonder if that's my problem or there's something else... Do you have any advice about it?
I also tried to do it through VLC but the problem is always the same, it reads in 2K but in 4K it fails, I think because even then it uses the CPU and not the GPU...

Title: Re: Video Encoding
Post by: pocock on November 16, 2020, 01:47:29 pm

Where are you based?  Are you close enough to any other developers who may be able to work through this with you?

Are you able to interact with any of the gstreamer developers on IRC?
Title: Re: Video Encoding
Post by: MauryG5 on November 16, 2020, 03:10:23 pm
hi pocock, I'm in Italy, I don't know if I can interact with that channel that I think is American ... I think I can try in any case but I have to understand how to connect via Irc, I haven't used it for many years so I don't know if I can now use it and then find the right server to connect to ...
Title: Re: Video Encoding
Post by: pocock on November 16, 2020, 03:17:11 pm
I'm very close to Italy and I visit there from time to time, usually in the north of Italy, so we might be able to find a way to look at this together
Title: Re: Video Encoding
Post by: MauryG5 on November 16, 2020, 04:41:36 pm
I would be very happy, I am in the extreme south, Sicily to be exact, I don't know how you get it but in case you will let me know if it is possible. In any case, I still want to see the solution you sent first, let's see if I can understand more about how to do with the command ...
Title: Re: Video Encoding
Post by: MauryG5 on November 19, 2020, 01:19:38 pm
Pocock excuse me, but if I wanted to use the GPU also on programs like VLC or others, then don't use vaapi acceleration only on browsers like Chromium or Firefox but use vaapi or similar to be able to use 4k videos on VLC or similar. Do you think it can be done? If so, how?
Thanks
Title: Re: Video Encoding
Post by: MauryG5 on November 28, 2020, 07:33:59 am
Guys from what I'm understanding, the real problem that I personally have is with the VP9 format of Youtube, with that if I put 4K it jerks or freezes. If I use instead formats like H264 on applications like VLC or QMPlay2, then I can see 4K quite well and without problems. I think the real problem is YouTube VP9... I don't know if you can see 4K as well in a smooth way...