我们用的是apollo5.5系统,camera是我们车上安装大的,现在摄像头数据已经发送出来了,我们要用video模块来接收,经过各种参数调整后还是不行,camera用rtp和udp发用数据包,但是apollo一直接受错误。个人感觉问题在rtp和udp,apollo是否有rtp和udp这些协议?我把出现的状况列一下,问问各位大神,请大神们指点迷津。
一、我们用的apollo的video_front_6mm.pb文件,摄像头分辨率做了一些小修改720*240,内容如下:
#udp_port: 2004
udp_port: 50000
frame_id: "video_front_6mm"
#pixel_format: "yuyv"
pixel_format: "uyvy"
trigger_param: "f2ff"
metric_error_code: 18
record:0
#width: 1920
#height: 1080
#width: 1280
#height: 800
width: 720
height: 240
frame_rate: 20
#frame_rate: 30
monochrome: false
brightness: -1
contrast: -1
saturation: -1
sharpness: -1
gain: -1
auto_focus: false
focus: -1
auto_exposure: true
exposure: 100
auto_white_balance: true
white_balance: 4000
bytes_per_pixel: 3
fpga_dev_number: 0
camera_seq_number: 3
compress_conf {
output_channel: "/apollo/sensor/camera/front_6mm/video/compressed"
image_pool_size: 100
}
二、摄像头video_send.sh文件,内容如下:
#!/bin/sh
if [ $# != 3 ] ; then
echo "Usage: $0 <node> <ip> <port>"
echo " e.g.: $0 0 192.168.0.10 5000"
exit 1;
fi
ip=$2
port=$3
echo "Send video $1 to $2:$3"
case $1 in
0)
video_node=/dev/video0
left=0
right=1280
top=0
bottom=800
;;
1)
video_node=/dev/video0
left=1280
right=2560
top=0
bottom=800
;;
2)
video_node=/dev/video1
left=0
right=1280
top=0
bottom=800
;;
3)
video_node=/dev/video1
left=1280
right=2560
top=0
bottom=800
;;
4)
video_node=/dev/video2
left=0
right=1280
top=0
bottom=800
;;
5)
video_node=/dev/video2
left=1280
right=2560
top=0
bottom=800
;;
esac
gst-launch-1.0 v4l2src device=$video_node ! \
'video/x-raw, format=UYVY, framerate=30/1' ! \
nvvidconv flip-method=2 left=$left right=$right top=$top bottom=$bottom ! \
'video/x-raw(memory:NVMM),format=I420,width=720,height=240, framerate=30/1' ! \
omxh265enc bitrate=8000000 ! 'video/x-h265, stream-format=(string)byte-stream' ! \
rtph265pay ! udpsink host=$ip port=$port sync=false async=true
三、 cyber_launch start modules/drivers/video/launch/video.launch
user@in_dev_docker:/apollo$ cyber_launch start modules/drivers/video/launch/video.launch
[cyber_launch_19074] INFO Launch file [/apollo/modules/drivers/video/launch/video.launch]
[cyber_launch_19074] INFO ========================================================================================================================
[cyber_launch_19074] INFO Load module [video] library: [h265_video] [CYBER_DEFAULT] conf: [/apollo/modules/drivers/video/dag/video.dag] exception_handler: []
[cyber_launch_19074] INFO Start process [h265_video] successfully. pid: 19075
[cyber_launch_19074] INFO ------------------------------------------------------------------------------------------------------------------------
[h265_video] WARNING: Logging before InitGoogleLogging() is written to STDERR
[h265_video] I0628 18:19:16.444039 19075 module_argument.cc:81] []command: mainboard -d /apollo/modules/drivers/video/dag/video.dag -p h265_video -s CYBER_DEFAULT
[h265_video] I0628 18:19:16.444283 19075 global_data.cc:155] []host ip: 192.168.0.131
[h265_video] I0628 18:19:16.444659 19075 module_argument.cc:57] []binary_name_ is mainboard, process_group_ is h265_video, has 1 dag conf
[h265_video] I0628 18:19:16.444667 19075 module_argument.cc:60] []dag_conf: /apollo/modules/drivers/video/dag/video.dag
[h265_video] E0628 18:19:16.522064 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522239 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522251 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522399 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522449 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522584 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522750 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0
[h265_video] E0628 18:19:16.522765 19103 socket_input.cc:198] [mainboard]Error! frame info is wrong. frame length: 0