Hardware video codec
#1
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=...el_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?
#2
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.
#3
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).
--
Arwen Evenstar
Princess of Rivendale
#4
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.
#5
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.
#6
@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?
#7
(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?
#8
My FFMPEG is default Debian.
#9
(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.
#10
(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?


Possibly Related Threads…
Thread Author Replies Views Last Post
  U-Boot, video console, and visual artifacts dsimic 15 2,362 07-28-2021, 09:37 AM
Last Post: dsimic
  Hardware problems with PineBook Pro James Good 7 2,585 07-09-2021, 12:24 PM
Last Post: moonwalkers
  Video : Review of the PineBook Pro with Armbian NicoD-SBC 1 479 07-06-2021, 10:10 PM
Last Post: tllim
  Pinebook Pro not powering on when eMMC hardware switch is off vgrimaldi 2 446 06-29-2021, 05:19 AM
Last Post: KC9UDX
  HArdware issues while charging user18130814200115 2 726 05-01-2021, 04:13 AM
Last Post: gabeeg
  Video Editing Is Possible On The PineBook Pro! ImmyChan 8 1,408 04-01-2021, 09:27 PM
Last Post: dsimic
  Kdenlive or other video editing software?? SuttonWillow 3 980 03-27-2021, 06:45 AM
Last Post: ImmyChan
  Netflix, Amazon Prime Video, and Chromium. Nobot 13 8,670 03-12-2021, 10:46 AM
Last Post: spikerguy
  Kdenlive or other video editing software? ImmyChan 2 802 01-19-2021, 01:12 AM
Last Post: KC9UDX
  Video Editing jiyong 3 2,148 08-28-2020, 06:39 AM
Last Post: PaulQ

Forum Jump:


Users browsing this thread: 2 Guest(s)