vaapi is not a wrapper, it's a full API just like VDPAU and XvBA are.Dorsai! wrote:vaapi is just a wrapper around different concepts
Ok, so, in mplayer, the driver actually changes the way the video gets decoded and displayed on the screen. So in vdapu, it may happen that the actual video after being decoded by the GPU gets displayed on the screen using Xv or gl/gl2; or maybe we can set options for the driver and customize it.Dorsai! wrote:On Mplayer, most of the video output options just decide the way the video is drawn on the screen. xv should also be accelerated if you have a gl compatible driver active, but is the more compatible solution as gl works only if a capable driver is loaded. But the actual decoding is fully done by the CPU.
vdpau instead does something else. the full video stream, together with the place the final video should end up on the screen is handed to the graphics card which does all the decoding and displaying by itself.
vaapi is just a wrapper around different concepts, as vdpau and its AMD equivalent share different apis.
VLC uses a different approach by only letting the card decode the video and getting back the raw video stream for further processing. It does not work directly with vdpau but uses some sort of shader language based decoding if I am not mistaken (but I might be, I dont use VLC myself).
But what happens if I change the output driver to vdapu? If the output driver handles only displaying the video on screen, then how can vdapu modify the decoding technique?Gusar wrote:vaapi is not a wrapper, it's a full API just like VDPAU and XvBA are.Dorsai! wrote:vaapi is just a wrapper around different concepts
@dE_logics: What VLC does is it sends the bitstream to the graphic card to be decoded and then copies decoded frames back into system memory. MPlayer doesn't do such copying, the graphic card displays the video directly. That's why VLC is less efficient.
Also, decoding is *not* done on the GPU, but on a dedicated ASIC that's part of the graphic card. This dedicated ASIC is single-purpose - it decodes specific formats (mpeg2, h264, VC1), and that's it. The reason this was done is that GPUs suck at video decoding.
The gl and gl2 in mplayer outputs are just that - outputs. They are means to display the picture on the screen. Their primary job is colorspace conversion (the video is YV12 while displays are RGB, so you need to convert the video in order to display it) and scaling (so that you can watch the video in fullscreen).
MPlayer and other players have several such means of displaying the picture. The most common one is Xv. It's an X extension that in the past provided access to a graphic card's hardware overlay. This overlay was a dedicated part of the graphic chip responsible for colorspace conversion and scaling. Modern graphic cards don't have such overlays anymore, the 3D engine is used to perform colorspace conversion and scaling.
That's possible in theory, but MPlayer doesn't support it. If you decode using VDPAU, you need to display using VDPAU. That's simply how MPlayer has been coded. Using other output methods would require copying decoded frames back into system memory, mplayer doesn't support that. But, like I said, VLC does.dE_logics wrote:So in vdapu, it may happen that the actual video after being decoded by the GPU gets displayed on the screen using Xv or gl/gl2; or maybe we can set options for the driver and customize it.
I don't get what you mean here. VDPAU, also VAAPI, have two parts: decoding and presentation (displaying the video). You can use VDPAU presentation regardless of how the video was decoded (you can decode the video in software, then use VDPAU to display it). But if you decode using VDPAU, then it depends how a particular player was coded.dE_logics wrote:But what happens if I change the output driver to vdapu? If the output driver handles only displaying the video on screen, then how can vdapu modify the decoding technique?
good news, good for spreading the knowledge and GENTOO, hahadE_logics wrote:Thanks everyone!
Things are 100% clear now and this post comes up on the first page of Google search result for "how hardware decoding works".
Join the discussion --pd1986 wrote:good news, good for spreading the knowledge and GENTOO, hahadE_logics wrote:Thanks everyone!
Things are 100% clear now and this post comes up on the first page of Google search result for "how hardware decoding works".
In fact, I am interested in this too. as I have ATI card, but I often use mplayer. In mplayer of official version, vaapi isn't included, while it is in vlc. but I really don't find a large difference of cpu use between mplayer and vlc when I play a movie of mkv in 1080p. 15%-20% by vlc vs 20%-25% by mplayer.
One time I heard somewhere, if I choose xv, I could still get the hardware acceleration. can't remember where it is from.
Only in VLC, which copies frames into system memory. Which takes CPU time, so maybe that's why you don't see much difference between hardware and software decoding.pd1986 wrote:One time I heard somewhere, if I choose xv, I could still get the hardware acceleration.
Code: Select all
-vo vdpau -vc ffh264vdpauCode: Select all
-vo vaapi -va vaapi