PINE64
Accelerated H.264 and HEVC video decoding with Cedrus - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+--- Thread: Accelerated H.264 and HEVC video decoding with Cedrus (/showthread.php?tid=424)

Pages: 1 2 3 4 5 6 7 8


RE: Accelerated H.264 and HEVC video decoding with Cedrus - longsleep - 04-11-2016

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.


RE: Accelerated H.264 and HEVC video decoding with Cedrus - Aakos - 04-13-2016

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


RE: Accelerated H.264 and HEVC video decoding with Cedrus - paranoid_android - 04-14-2016

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/view/svn/general/pixman.html) and libcedrus (https://github.com/linux-sunxi/libcedrus). Anyway, it works! I can play a sample video ( http://samplemedia.linaro.org/H264/big_buck_bunny_1080p_H264_AAC_25fps_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).


RE: Accelerated H.264 and HEVC video decoding with Cedrus - longsleep - 04-14-2016

(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-pine64-image/blob/master/simpleimage/platform-scripts/mplayer-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))".


RE: Accelerated H.264 and HEVC video decoding with Cedrus - paranoid_android - 04-14-2016

(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?


RE: Accelerated H.264 and HEVC video decoding with Cedrus - longsleep - 04-14-2016

(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.


RE: Accelerated H.264 and HEVC video decoding with Cedrus - paranoid_android - 04-14-2016

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!


RE: Accelerated H.264 and HEVC video decoding with Cedrus - sirhcjw - 04-21-2016

This is great work I now have mplayer decoding x264 & x265 in hardware just need the x11 driver to support it now.


RE: Accelerated H.264 and HEVC video decoding with Cedrus - baryluk - 04-24-2016

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                -



RE: Accelerated H.264 and HEVC video decoding with Cedrus - ryanvade - 04-24-2016

Arch Linux has a package in the AUR: https://aur.archlinux.org/packages/libvdpau-sunxi/ though the ARCH flag will have to be changed.