本帖最后由 yangjinbiao 于 2016-12-19 18:17 编辑
相关地址:
https://www.freedesktop.org/wiki/Software/vaapi/
下载的是
libva-1.7.0.tar.bz2
一、拷贝到开发板。
二、运行
./configure
make
三、系统生成
DIR/test/encode/.libs/h264encode 可执行文件
四、运行没有反应 使用 gdb 调试输出如下信息
Starting program: /home/firefly/libva-1.7.0/test/encode/.libs/h264encode
Cannot parse expression `.L966 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface
解码失败 ?
请问提供的libva有什么特别吗?在x86架构下操作成功.
另外:
利用生成的vaininfo 可以获取信息
firefly@localhost:~/libva-1.7.0/test$ ./vainfo/.libs/vainfo
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'rockchip'
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/rockchip_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Rockchip Driver 1.3
vainfo: Supported profile and entrypoints
VAProfileH264Baseline : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
isle
4
你下载的是arm的还是x86的。X86的库肯定不能在arm上跑啊
isle 发表于 2016-12-21 09:24
你下载的是arm的还是x86的。X86的库肯定不能在arm上跑啊
谢谢大神回复。
我的理解是这样:我下载的是libva的源代码,在rk3288-firefly上面进行编译。
解压完成之后是没有.libs这个目录的,那个运行的可执行文件是编译生成的。并且可以gdb调试,file文件显示是arm架构。
是不是有专门针对rk3288的libva的源代码?地址能给一个吗?谢谢,十分感谢!
isle 发表于 2016-12-21 09:24
你下载的是arm的还是x86的。X86的库肯定不能在arm上跑啊
针对arm的下载地址能贴出来吗?谢谢!!!!!!!
isle 发表于 2016-12-21 09:24
你下载的是arm的还是x86的。X86的库肯定不能在arm上跑啊
在板子上使用
apt source libva1 获取源代码
./configure
make
生成了可执行文件
test/encode/.libs/h264encode
运行后提示是一样的。
使用file命令
h264encode: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=12d6077385991aeabf0f70be44d1396596bdee5e, not stripped
接楼上:
一共生成了四个文件
另外三个是可以运行的
avcenc jpegenc mpeg2vaenc
第二种编译方法:
单独编译h264encode.c
拷贝出来到源代码的上级目录
使用命令
gcc h264encode.c code/libva-1.7.0/test/common/va_display.c -I/usr/include/libdrm -I./code/libva-1.7.0/ -I./code/libva-1.7.0/test/common/ -I./code/libva-1.7.0/va -L/usr/lib/arm-linux-gnueabihf/dri -L/usr/lib/arm-linux-gnueabihf/ -ldrm -lva -lva-drm -lva-x11 -lpthread -lm
编译完成之后报错是一样的。
isle
10
下载到板子上编译是可以的,你这个编译linva的没有问题的。但是你们没有libva的driver。所以libva加载不了编解码驱动,导致编解码失败。
你要么整个软编软解的。或者安装rk的libva的driver。
isle 发表于 2016-12-22 10:50
下载到板子上编译是可以的,你这个编译linva的没有问题的。但是你们没有libva的driver。所以libva加载不了 …
十分感谢,因为我安装的是ubuntu16.04的系统, 使用bbs上发布的系统版本:ubuntu_1604_2016_10181213,上面已经有你的测试的例子test_dec.sh 和test_enc.sh.,我想着上面已经有针对rk的libva的driver了,是不是已经有了啊?gstreamer进行测试的时候,可以进行硬件解码的。
并且增加了环境变量export LIBVA_DRIVER_NAME=rockchip
之后运行仍然不行!
如果需要安装rk的libva的driver有网址或者参考资料可以提供一下吗?谢谢
isle
12
如果是官方的固件,libva和driver都已经有了的啊。
rockchip的libva的driver在这里 https://github.com/rockchip-linux/rockchip-va-driver
编译:https://github.com/rockchip-linux/rockchip-va-driver
rockchip_driver.h:147:2: error: unknown type name ‘VABufferInfo’
有人遇到这个问题吗?
isle 版主,https://github.com/rockchip-linux/rockchip-va-driver 下载后在rk3288里cmake少了libva库
CMake Error at CMakeLists.txt:15 (message):
failed to find libva (VA-API Library)
isle 版主,在ubuntu 16.04固件,在/usr/local/bin/test_dec.sh 用 gsteamer 解码播放1080p ok,硬件调用 /usr/lib/arm-linux-gnueabihf/dri/rockchip_drv_video.so ;
用https://github.com/01org/libva-utils 的vainfo demo查看,test demo测试,va_getDriverName() 返回-1,调用/usr/lib/arm-linux-gnueabihf/dri/rockchip_drv_video.so,但硬解码失败;
这是什么原因了?
root@localhost:/usr/local/bin# ./test_dec.sh
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: User requested driver ‘rockchip’
libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/rockchip_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED …
Pipeline is PREROLLING …
Got context from element ‘pipeline0’: gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)NULL;
Redistribute latency…
init done status 0 dpb_size 20
h264d ctx created
~~ AllocateAsicBuffers, support:3
Width 1920 Height 1088
videoRange 0, matrixCoefficients 2
(ret == H264DEC_HDRS_RDY) decInput.dataLen 720903
Redistribute latency…
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Got EOS from element “pipeline0”.
Execution ended after 0:00:09.999815165
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
************* freeDpbMem buffer index 17
************* freeDpbMem buffer index 18
************* freeDpbMem buffer index 19
deinit DONE
这是当时的截图;test_dec.sh硬解ok;libva-utils 测试失败;