Accelerated H.264 and HEVC video decoding with Cedrus
#11
Well now you are missing env variables. Should be in the sunxi wiki. I think I have some mplayer wrapper script somewhere in my build gear as well.
  Reply
#12
Hi

I have a problem.
$vdpauinfo 
display: :0.0   screen: 0
Failed to open VDPAU backend /usr/lib/libvdpau_sunxi.so: undefined symbol: pixman_transform_scale
Error creating VDPAU device: 1

Installed ok, but this error message Sad

OS: Ubuntu xenial
Linux localhost 3.10.65-4-pine64-longsleep

Thanks
  Reply
#13
Hello everyone,

It's my first post on this forum. I got my P64 about 3 days ago and have been playing with it since then. I quickly downloaded last Longsleep's Ubuntu image onto the fresh Class 10 card and one of my main concerns, as for many of us, was a lack of hardware graphics acceleration in this distro. Please, don't get me wrong, I cannot thank Longsleep enough for preparing this image for us all here...
Anyway, I can now finally confirm that I also managed to install libvdpau-sunxi library and I can now watch videos with HW graphics acceleration enabled.
I followed instructions from http://linux-sunxi.org/Cedrus/libvdpau-sunxi, but I believe they are not up-to-date anymore. Besides installing all the mentioned prerequisites I also had to install Pixman (http://www.linuxfromscratch.org/blfs/vie...ixman.html) and libcedrus (https://github.com/linux-sunxi/libcedrus). Anyway, it works! I can play a sample video ( http://samplemedia.linaro.org/H264/big_b..._7200K.MP4) and even though it has little glitches, I believe it's because the file resides on an SD card (I don't have any USB HDD attached yet). Am I correct that the framerate would be much worse hadn't I have HW acceleration enabled?
How do I check whether mplayer really uses HW graphics?

p.s. I'd like to point out that I'm barely a Linux user. I know simple commands and I can run a makefile or download some code from github, but I can't really call myself a Linux guy. Anyway I managed to build all these libraries which shows how simple it is at this stage (i.e. after so many people contributed to reverse-engineering Allwinner's SOCs).
  Reply
#14
(04-14-2016, 10:11 AM)paranoid_android Wrote: How do I check whether mplayer really uses HW graphics?

I have added a platform script to my images a while ago (mplayer wrapper) see https://github.com/longsleep/build-pine6...er-play.sh

To check if mplayer uses the selected decoder compare your output with my examples from the first post of this thread. Especially "Selected video codec: [ffhevcvdpau] vfm: ffmpeg (FFmpeg HEVC / H.265 (VDPAU))".
  Reply
#15
(04-14-2016, 11:05 AM)longsleep Wrote: To check if mplayer uses the selected decoder compare your output with my examples from the first post of this thread. Especially "Selected video codec: [ffhevcvdpau] vfm: ffmpeg (FFmpeg HEVC / H.265 (VDPAU))".

When I run your script without root privileges
Code:
bash <(curl -s https://github.com/longsleep/build-pine64-image)
I get:
Code:
/dev/fd/63: line 5: syntax error near unexpected token `newline'
/dev/fd/63: line 5: `<!DOCTYPE html>'

When I run it as root, I get:
Code:
bash: /dev/fd/63: No such file or directory

What am I doing wrong?
  Reply
#16
(04-14-2016, 11:29 AM)paranoid_android Wrote: When I run your script without root privileges
Code:
bash <(curl -s https://github.com/longsleep/build-pine64-image)

Err why would you run that? You need to be very carefull piping URL content like that into bash. The URL is a web page and thus cannot run in bash. I am not sure what exactly you are trying.
  Reply
#17
whooops Smile. Now I can see how ridiculous that was. I thought you wanted me to run the script you provided link for, but I used a wrong address. Anyway, I checked Mplayer's output and it shows:
Code:
[VDPAU SUNXI] VE version 0x1689 opened
[VDPAU SUNXI] OSD disabled!
so yes, now I'm sure I did it right. Thanks for help!
  Reply
#18
This is great work I now have mplayer decoding x264 & x265 in hardware just need the x11 driver to support it now.
  Reply
#19
For anybody wanted a try, here are quick instructions.

I am using vdpau 1.1.1-3, from Debian Stretch (aka testing) and/or Sid (aka unstable).

Code:
sudo apt-get install libvdpau-dev
git clone https://github.com/linux-sunxi/libcedrus.git
cd libcedrus/
make && sudo make install
git clone https://github.com/linux-sunxi/libvdpau-sunxi.git
cd libvdpau-sunxi
make && sudo make install
sudo ldconfig

Other pieces, like /dev/disp and /dev/cedrus_dev already exist and are set to be in the group "video". (You can check if you are in this group using 'id' command).

If you need pixman, try sudo apt-get install libpixman-1-dev , this will install pixman 0.33.6-1, and retry above script.

Then try

Code:
VDPAU_DRIVER=sunxi mplayer -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau, video_file.mkv

Unfortunetly for me, it crashes after few frames of very smooth playback, and then cendrus leavs nasty video overlay with one of the frames (slightly corrupted), that I have no idea how to get rid of other than rebooting

You can add export VDPAU_DRIVER=sunxi maybe to your ~/.bashrc file, or /etc/profile.d/vdpau-sunxi.sh maybe for easier use.

Output from vdpauinfo (installed via sudo apt-get install vdpauinfo):

Code:
$ export VDPAU_DRIVER=sunxi
$ vdpauinfo
display: :0   screen: 0
[VDPAU SUNXI] VE version 0x1689 opened
[VDPAU SUNXI] OSD disabled!
API version: 1
Information string: sunxi VDPAU Driver

Video surface:

name   width height types
-------------------------------------------
420     8192  8192  NV12 YV12

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                           0 32400  3840  2160
MPEG2_SIMPLE                    3 32400  3840  2160
MPEG2_MAIN                      3 32400  3840  2160
H264_BASELINE                  51 32400  3840  2160
H264_MAIN                      51 32400  3840  2160
H264_HIGH                      51 32400  3840  2160
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                  5 32400  3840  2160
MPEG4_PART2_ASP                 5 32400  3840  2160
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 32400  3840  2160
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          51 32400  3840  2160
H264_HIGH_444_PREDICTIVE       --- not supported ---
HEVC_MAIN                      150 32400  3840  2160
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    -  
R8G8B8A8          8192  8192    -  

Bitmap surface:

name              width height
------------------------------
B8G8R8A8          8192  8192
R8G8B8A8          8192  8192

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             -
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  -
SHARPNESS                        -
LUMA_KEY                         -
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y         0     8192
VIDEO_SURFACE_HEIGHT             y         0     8192
CHROMA_TYPE                      y  
LAYERS                           y         0        0

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 -  
CSC_MATRIX                       -  
NOISE_REDUCTION_LEVEL            -  
SHARPNESS_LEVEL                  -  
LUMA_KEY_MIN_LUMA                -  
LUMA_KEY_MAX_LUMA                -
  Reply
#20
Arch Linux has a package in the AUR: https://aur.archlinux.org/packages/libvdpau-sunxi/ though the ARCH flag will have to be changed.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Video wall? monty1 2 607 04-12-2017, 04:34 PM
Last Post: monty1
  pine64 accelerated jpeg decoding jacklau 1 876 01-12-2017, 01:12 AM
Last Post: Trizna
  Pine64 accelerated H.264 encoding hngjms 7 3,371 10-18-2016, 03:15 AM
Last Post: pfeerick
  The sunxi transform module is very slow, how to do video rotation? jacklau 0 450 09-19-2016, 12:24 AM
Last Post: jacklau
  Video encoding h.265/HEVC tomaThoma 1 2,237 07-02-2016, 11:35 PM
Last Post: tllim
  Question about video acceleration BringItOn 10 2,601 06-23-2016, 10:33 AM
Last Post: ssvb
  Linux accelerated graphics nomadewolf 1 1,087 12-29-2015, 11:26 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)