Toybrick
标题:
关于rtsp硬解码问题
[打印本页]
作者:
yuys
时间:
2019-10-22 14:51
标题:
关于rtsp硬解码问题
板子信息:RK3399Pro fedora28 python3.6.8 rknn-toolkit-v1.2.0
opencv_get_NetCamera.py脚本内容:
import
cv2
print
(cv2.
__version__
)
cap = cv2.VideoCapture(
"rtsp://username:password@192.168.3.25/H.264/ch1/sub/av_stream"
)
#h265
ret, frame = cap.read()
while
ret:
ret, frame = cap.read()
if not
ret:
continue
cv2.imshow(
"frame0"
,frame)
if
cv2.waitKey(
1
) &
0xFF
==
ord
(
'q'
):
break
cv2.destroyAllWindows()打开terminal执行如下:
[toybrick@toybrick Camera]$ python3 opencv_get_NetCamera.py
3.4.1
VIDEOIO ERROR: V4L: device
rtsp://username:password@192.168.3.25/H.264/ch1/sub/av_stream:
Unable to query number of channels
mpi: mpp version: Without VCS info
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
warning: GStreamer: unable to query duration of stream (/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:904)
warning: Cannot query video position: status=1 value=0 duration=-1
(/builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:952)
我另外开了一个terminal 运行
dmesg,显示了很杂乱的信息,如下:
pinstate
[ 3.056467] ov9750.pltfrm_camera_module_get_data WARN: could not get sleep pinstate
[ 3.058617] of_get_named_gpiod_flags: parsed 'rockchip,pd-gpio' property of node '/i2c@ff110000/camera-module@10[0]' - status (0)
[ 3.058624] of_get_named_gpiod_flags: can't parse 'rockchip,pwr-gpio' property of node '/i2c@ff110000/camera-module@10[0]'
[ 3.058630] of_get_named_gpiod_flags: can't parse 'rockchip,pwr-2nd-gpio' property of node '/i2c@ff110000/camera-module@10[0]'
[ 3.058636] of_get_named_gpiod_flags: can't parse 'rockchip,pwr-3rd-gpio' property of node '/i2c@ff110000/camera-module@10[0]'
[ 3.058642] of_get_named_gpiod_flags: can't parse 'rockchip,flash-gpio' property of node '/i2c@ff110000/camera-module@10[0]'
[ 3.058648] of_get_named_gpiod_flags: can't parse 'rockchip,torch-gpio' property of node '/i2c@ff110000/camera-module@10[0]'
[ 3.058661] of_get_named_gpiod_flags: parsed 'rockchip,rst-gpio' property of node '/i2c@ff110000/camera-module@10[0]' - status (0)
[ 3.094171] ov9750.ov_camera_module_write_config(180) ERR: no active sensor configuration
[ 3.094940] ov9750.ov_camera_module_write_config(231) ERR: failed with error -14
[ 3.099309] ov9750.pltfrm_camera_module_read_reg(1040) ERR: i2c read from offset 0x0000300b failed with error -6......详见 New.1022.txt
注意:我的UI界面的视频如下,但是显示是有较明显的延迟的。
请问我的板子是否已经运行了硬解码?
我该如何提高解码速度
作者:
jefferyzhang
时间:
2019-10-22 15:31
echo 0x0100 > /sys/module/rk_vcodec/parameter/debug
来打开硬解码调试信息,看下日志就知道有没有走硬解码
作者:
yuys
时间:
2019-10-22 16:23
打开终端terminal
1. 打开驱动调试打印:
echo 0x0100 > /sys/module/rk_vcodec/parameters/debug
2. 运行python3 opencv_get_NetCamera.py
3.再开启一个终端terminal,输入dmesg
界面如下:
[ 4249.591488] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4249.592909] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4249.604051] RTW: nolinked power save leave
[ 4251.231645] RTW: nolinked power save enter
[ 4312.576237] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4312.577756] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4312.588924] RTW: nolinked power save leave
[ 4314.210268] RTW: nolinked power save enter
[ 4375.602363] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4375.604730] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4375.616426] RTW: nolinked power save leave
[ 4377.183608] RTW: nolinked power save enter
[ 4438.602623] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4438.603995] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4438.621365] RTW: nolinked power save leave
[ 4440.258521] RTW: nolinked power save enter
[ 4501.602736] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4501.604753] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4501.617927] RTW: nolinked power save leave
[ 4503.243650] RTW: nolinked power save enter
[ 4564.546612] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4564.548982] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
[ 4564.560799] RTW: nolinked power save leave
[ 4566.145720] RTW: nolinked power save enter
[ 4627.609237] RTW: wlan0- hw port(0) mac_addr =74:ee:2a:36:e8:2a
[ 4627.611365] RTW: p2p0- hw port(1) mac_addr =76:ee:2a:36:e8:2a
......
......
......
[ 7655.093067] rk_vcodec: rkvdec task: 0 ms
[ 7655.094705] rk_vcodec: rkvdec task: 0 ms
[ 7655.096231] rk_vcodec: rkvdec task: 0 ms
[ 7655.097667] rk_vcodec: rkvdec task: 0 ms
[ 7655.099048] rk_vcodec: rkvdec task: 0 ms
[ 7655.100428] rk_vcodec: rkvdec task: 0 ms
[ 7655.393070] rk_vcodec: rkvdec task: 0 ms
[ 7655.395154] rk_vcodec: rkvdec task: 0 ms
[ 7655.397014] rk_vcodec: rkvdec task: 0 ms
[ 7655.398897] rk_vcodec: rkvdec task: 0 ms
[ 7655.400674] rk_vcodec: rkvdec task: 0 ms
[ 7655.402474] rk_vcodec: rkvdec task: 0 ms
[ 7655.695676] rk_vcodec: rkvdec task: 0 ms
[ 7655.697314] rk_vcodec: rkvdec task: 0 ms
[ 7655.700826] rk_vcodec: rkvdec task: 0 ms
[ 7655.702302] rk_vcodec: rkvdec task: 0 ms
[ 7655.703700] rk_vcodec: rkvdec task: 0 ms
[ 7655.711541] rk_vcodec: rkvdec task: 0 ms
[ 7655.741563] rk_vcodec: rkvdec task: 0 ms
[toybrick@toybrick ~]$
javascript:;
javascript:;
作者:
jefferyzhang
时间:
2019-10-23 09:07
[ 7655.741563] rk_vcodec: rkvdec task: 0 ms
说明走的是硬解码,并且你这码率非常低,我们硬解码1ms都不到就解完一帧了
作者:
yuys
时间:
2019-10-23 10:11
参考以下帖子
RK3399Pro入门教程(7)RTSP库的使用
http://t.rock-chips.com/forum.ph ... p;extra=&page=3
在RK3399Pro Fedora28 板子上读取rtsp视频流很快。
而本帖子使用的opencv读取视频有明显的延时,我怀疑是opencv解码码流主要在CPU上完成,没有将任务分配到VPU上,所以opencv读取rtsp码流展示是延迟的。
欢迎光临 Toybrick (https://t.rock-chips.com/)
Powered by Discuz! X3.3