Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Hardware decoder on linux for firefly-rk3288(source opened)

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821

Hardware decoder on linux for firefly-rk3288(source opened)

Posted at 12/30/2015 10:37:25      View:55032 | Replies:38        Print     [Copy Link] 1#
Last edited by isle In 12/30/2015 10:40 Editor

This is how to add hardware decoder to ffmpeg on linux for firefly-rk3288.

First, choose the vpu driver librarys.
We use the hybris library made by mac_l1,also you can choose rockchip's vpu driver library ,which they has put it on a websites.
For convenience ,I put a mac_l1's hybris lib's copy to "baidu pan". here is the link:
http://pan.baidu.com/s/1pKdqUQR


Install the driver library:
  1. sudo dpkg  -i machybris-0.1.0_armhf.deb
Copy the code
if you get a mistake. please run this:
  1. sudo apt-get -f install
Copy the code

and try again.

After install done ,reboot your board .

Install dependencies library :
  1. sudo apt-get install libsdl-dev
Copy the code

this source code need compiled on the development board. if you want to compiled on PC ,you need modify the source code.

Install compile environment:
  1. sudo apt-get install build-essential
Copy the code
Get the source code:
  1. git clone https://github.com/isle0118/firefly-vpu-linux.git
Copy the code
Compile and Install:
  1. ./configure  --enable-shared --prefix=/usr --disable-ffmpeg --disable-ffprobe --disable-ffserver  --disable-static
Copy the code
  1. make && sudo make install
Copy the code

Now, you can test the hardware decoder with ffplay .

the source file is here :
  1. libavcodec/rkdec_decoder.c
Copy the code

if you want use other driver library or compiled on PC ,just need to modify this file.


Have fun !



Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 12/31/2015 09:43:03      2#
your machybris is Amazing。we can do many things on it.

we really appreciate all your work!
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 1/6/2016 09:34:41      3#
the vpu can decode 4K video smoothly. But the display was terrible.
so we didn't add 4k support here.
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 1/7/2016 09:49:26      4#
Last edited by isle In 1/7/2016 09:51 Editor

Hi fd101283.
the 4k video  hasn't be  forbbidened on this sourcecode.  
but when playing 4k video ,the ffplay sometimes get rong video width&height .like "avctx->width=0 & avctx->height=0";in the initializtion function "rkdec_prepare".
so you need give them the width&height  value before "rkdec_ctx->ctx->init".
after init is done ,the decoder works. Now your can get the real width&height "pframe->DisplayWidth" by "rkdec_ctx->vpu_mem_link(&pframe->vpumem);".
this is what I get. when i playing 4k videos.

If someone can make the display woking well on 4k.that must be excellent.
But if you just need deocode with 4k , display with HD or FHD. you can use rga to do downscale.thay is a way to get 4k woks.
haha!



Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 1/8/2016 09:25:44      5#
Oh,
"[hevc_rkvpu @ 0xb39044a0] PPS id out of range: 0"
This is very strange.
have you try another 4k video ?and get the some mistake?  
Reply

Use props Report

1821

Credits

10

Prestige

17

Contribution

super moderator

Rank: 8Rank: 8

Credits
1821
Posted at 4/22/2016 17:42:39      6#
newold Posted at 3/16/2016 19:04
Hi isle.
can this source be used on fireprime board(RK3128 chip)?

yes ,I think it can be used on fireprime .what you need to do is just get mac's hybris lib for rk3128.
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list