PINE64
Hardware video codec - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: General Discussion on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=112)
+--- Thread: Hardware video codec (/showthread.php?tid=9045)

Pages: 1 2 3


Hardware video codec - jiyong - 02-06-2020

The RK3399 has hardware for h264 encoding and decoding.
But it looks like the default Debian image doesn't have it activated in the kernel?

I read the wiki: https://wiki.pine64.org/index.php?title=Pinebook_Pro&redirect=no#Kernel_options
When I use this command:
$ zgrep HANTRO /proc/config.gz

Nothing comes up.

Is it easy to compile a new kernel?
Will the future default Debian image come with hardware video acceleration activated?


RE: Hardware video codec - maxjrh - 02-07-2020

The default debian kernel uses the rk-vcodec kernel driver. I think you can check it with

Code:
lsmod|grep rk-vcodec

Alternatively, check if the file /dev/vpu_service exists.

ffmpeg makes use of this driver with the rkmpp decoder. You can test that with
Code:
ffmpeg -benchmark -c:v h264_rkmpp -i file.mp4 -f null -
The videoplayer on the debian image, rkmpv uses this decoder if possible.


RE: Hardware video codec - Arwen - 02-07-2020

I've re-vampled the Wiki page for this information. Hopefully it's better and more accurate;

Wiki - Pinebook Pro - Kernel options

As usual, feel free to correct, improve or comment, (good or politely bad).


RE: Hardware video codec - jiyong - 02-07-2020

Thanks for the help.
Looks like we were just verifying the Wiki. ;-)

This worked for me:

zgrep RK_VCODEC /proc/config.gz
CONFIG_RK_VCODEC=y

Benchmarking Big Buck Bunny full HD 60 Hz reports around 3 times speed.
CPU running at 408 MHz.

So that looks good.

Now the challenge to make programs like VLC and Kazam (screen recorder) to make use of it.
When I play Big Buck Bunny with VLC, the CPU jumps to 2 GHz.
Kazam doesn't record video with h264.


RE: Hardware video codec - vfr400racer - 02-07-2020

Just installed mrfixit2001's image 2.0  and tried to find out if video playback is hardware accelerated.
It turned out, that I can't play videos.

$ zgrep RK_VCODEC /proc/config.gz
CONFIG_RK_VCODEC=y


$ file file.mp4
file.mp4: ISO Media, MP4 v2 [ISO 14496-14]


$ ffmpeg -benchmark -c:v h264_rkmpp -i file.mp4 -f null -
results in
Unknown decoder 'h264_rkmpp'


video player mpv fails with
$ mpv file.mp4
mpv: error while loading shared libraries: libavcodec.so.58: cannot open shared object file: No such file or directory

but


$ find /usr/lib |grep libavcodec
/usr/lib/arm-linux-gnueabihf/libavcodec.so.57
/usr/lib/arm-linux-gnueabihf/libavcodec.so.57.64.101

Any ideas what is wrong with my video playback?

[EDIT 1]
Solved the video playback issue: Although aptitude reported mpv as installed, and the executable was there, I was able to  install it with 'apt-get install mpv'. So I guess there is something broken with my repository. After the installation process (which included some dependent packages) video playback worked with mpv as well as with smplayer.


RE: Hardware video codec - jiyong - 02-08-2020

@vfr400racer When you play a h264 file with mpv, what is the clock speed of your CPU?

When I do this:
ffmpeg -benchmark -c:v h264_rkmpp -i file.mp4 -f null -
CPU clock speed stays at 408 MHz.

When I do this (omit -c:v h264_rkmpp):
ffmpeg -benchmark -i file.mp4 -f null -
CPU clock speed jumps to 2 GHz.

And it looks like VLC will play like the last one.
Do we need a custom compile of FFMPEG, VLC, or both?


RE: Hardware video codec - vfr400racer - 02-08-2020

(02-08-2020, 12:04 PM)jiyong Wrote: @vfr400racer When you play a h264 file with mpv, what is the clock speed of your CPU?

When I do this:
ffmpeg -benchmark -c:v h264_rkmpp -i file.mp4 -f null -
CPU clock speed stays at 408 MHz.

When I do this (omit -c:v h264_rkmpp):
ffmpeg -benchmark -i file.mp4 -f null -
CPU clock speed jumps to 2 GHz.

And it looks like VLC will play like the last one.
Do we need a custom compile of FFMPEG, VLC, or both?

The video doesn't play with the h264_rkmpp codec specified. ffmpeg stops with

Code:
Unknown decoder 'h264_rkmpp'


When I play the video fullscreen with mpv, clock speed jumps between 600MHz and 1.2 GHz

Did you build your ffmpeg on your own or did you use the one which comes with the Default Debian Mate  image?


RE: Hardware video codec - jiyong - 02-08-2020

My FFMPEG is default Debian.


RE: Hardware video codec - vfr400racer - 02-10-2020

(02-08-2020, 05:59 PM)jiyong Wrote: My FFMPEG is default Debian.

Are you on mrfixit2001's Version 2.0.  I am, and furthermore I get this:


$ mpv --vo=gpu --gpu-context=drm --hwdec=rkmpp h264codec.mp4
.
.
.
Invalid value for option hwdec: rkmpp
Valid values are:
    no
    auto
    yes
    auto-copy
    vdpau
    vdpau-copy
    videotoolbox
    videotoolbox-copy
    vaapi
    vaapi-copy
    dxva2
    dxva2-copy
    d3d11va
    d3d11va-copy
    rpi
    rpi-copy
    mediacodec
    cuda
    cuda-copy
    crystalhd

In the list of available codecs there is no *rkmpp* codec.


RE: Hardware video codec - Eight Bit - 02-10-2020

(02-10-2020, 03:38 AM)vfr400racer Wrote:
(02-08-2020, 05:59 PM)jiyong Wrote: My FFMPEG is default Debian.

Are you on mrfixit2001's Version 2.0.  I am, and furthermore I get this:


$ mpv --vo=gpu --gpu-context=drm --hwdec=rkmpp h264codec.mp4
.
.
.
Invalid value for option hwdec: rkmpp
Valid values are:
    no
    auto
    yes
    auto-copy
    vdpau
    vdpau-copy
    videotoolbox
    videotoolbox-copy
    vaapi
    vaapi-copy
    dxva2
    dxva2-copy
    d3d11va
    d3d11va-copy
    rpi
    rpi-copy
    mediacodec
    cuda
    cuda-copy
    crystalhd

In the list of available codecs there is no *rkmpp* codec.

Maybe slightly off-topic, maybe not... Since MrFixit's 2.0 patch Netflix doesn't work anymore for me. I get a netflix help page about silverlight when I try to start a video. Does anyone experience te same?