Other Parts Discussed in Thread: AM62A7
Tool/software:
Hi Suren Porwar and Jianzhong Xu,
I finally got the ability to test the pipeline on 10.1.0, and it's working mostly as expected.
When I switch one path to 1920x1080 with the multiscaler, I need to switch the encoder element to use dmabuf instead of dmabuf-import, and this still has an impact on the framerate (28.5 instead of 30, probably because of the extra copy). If I use dmabuf-import, my pipeline errors out because the encoder can't get memory. If I set the size for the second path to 3840x2160, this problem doesn't occur.
My current script:
#!/bin/bash DCC_ISP_FILE=/opt/imaging/ar0823/linear/dcc_viss.bin DCC_2A_FILE=/opt/imaging/ar0823/linear/dcc_2a.bin LDC_DCC_FILE=/opt/imaging/ar0823/linear/dcc_ldc.bin MULTICASTADDR1=224.1.1.1 MULTICASTADDR2=224.1.1.2 PORT=5004 if [ x$TEE == x ]; then TEE=tee fi HEVC_PROFILE="main" HEVC_LEVEL="1" VIDEO_BITRATE=6000000 ENC_EXTRA_CONTROLS="enc,prepend_sps_and_pps_to_idr=1,video_gop_size=5,frame_level_rate_control_enable=1,video_bitrate_mode=0,vbv_buffer_size=3000,video_bitrate=${VIDEO_BITRATE}" TEMP=$(getopt -o 'p:l:b:h' --long 'profile:,level:,bitrate:,input:,output:,help,mc:,port:' -n '$0' -- "$@") if [ $? -ne 0 ]; then echo 'Terminating...' >&2 exit 1 fi eval set -- "$TEMP" unset TEMP while true; do case "$1" in '-h'|'--help') echo "$0 - H.265 compress a JPEG file into a one second stream" echo "Parameters:" echo " -p main|main-still-picture|main-10 (HEVC Profile)" echo " -l 1|2|2.1|3|3.1|4|4.1|5|5.1 (HEVC Level)" echo " -b 0..700000000 (Video Bitrate)" echo " --mc <multicast ip address>" echo " --port <port number> (default 5000)" echo " -h This help" exit 0 shift continue ;; '-p'|'--profile') case "$2" in 'main'|'Main'|'0') HEVC_PROFILE="main" ;; 'main-still-picture'|'1') HEVC_PROFILE="main-still-picture" ;; 'main-10'|'2') HEVC_PROFILE="main-10" ;; *) HEVC_PROFILE="main" ;; esac echo "HEVC Profile: '$HEVC_PROFILE'" shift 2 continue ;; '-l'|'--level') case "$2" in '1'|'2'|'2.1'|'3'|'3.1'|'4'|'4.1'|'5'|'5.1') HEVC_LEVEL="$2" ;; *) HEVC_LEVEL="1" ;; esac echo "HEVC Level: '$HEVC_LEVEL'" shift 2 continue ;; '-b'|'--bitrate') echo "Video Bitrate: '$2'" VIDEO_BITRATE=$2 shift 2 continue ;; 'mc') MULTICASTADDR=$2 shift 2 continue ;; 'port') PORT=$2 shift 2 continue ;; '--') shift break ;; *) echo 'Internal error!' >&2 exit 1 ;; esac done #media-ctl -V '"imx219 4-0010":0 [fmt:SRGGB10_1X10/1920x1080 field:none]' #media-ctl -V '"ar0521 1-0036":0 [fmt:SGRBG8_1X8/3840x2160 field:none]' media-ctl -V '"ar0823 1-0010":0 [fmt:SGRBG12_1X12/3840x2160 field:none]' gst-launch-1.0 -v -e v4l2src device=/dev/video3 io-mode=dmabuf-import do-timestamp=true \ ! video/x-bayer, width=3840, height=2160, framerate=30/1, format=grbg12 \ ! tiovxisp sink_0::device=/dev/v4l-subdev2 sensor-name="SENSOR_ONSEMI_AR0823" \ dcc-isp-file=${DCC_ISP_FILE} \ sink_0::dcc-2a-file=${DCC_2A_FILE} format-msb=11 \ ! queue max-size-buffers=1 leaky=0 \ ! tiovxldc sensor-name="SENSOR_ONSEMI_AR0823" dcc-file=${LDC_DCC_FILE} \ ! video/x-raw, format=NV12, width=3840, height=2160, framerate=30/1 \ ! queue max-size-buffers=1 leaky=0 \ ! ${TEE} name=multi \ multi.src_0 \ ! queue max-size-buffers=1 leaky=0 name=qstream1 \ ! v4l2h265enc output-io-mode=dmabuf-import extra-controls=${ENC_EXTRA_CONTROLS} \ ! "video/x-h265, profile=(string)${HEVC_PROFILE}, level=(string)${HEVC_LEVEL}" \ ! rtph265pay config-interval=1 pt=96 mtu=1400 \ ! udpsink host=${MULTICASTADDR1} auto-multicast=true port=${PORT} \ multi.src_1 \ ! queue max-size-buffers=1 leaky=0 name=qstream2 \ ! tiovxmultiscaler target=0 \ sink_0::pool-size=4 src::pool-size=4 \ ! video/x-raw, format=NV12, width=1920, height=1080 \ ! v4l2h265enc output-io-mode=dmabuf extra-controls=${ENC_EXTRA_CONTROLS} \ ! "video/x-h265, profile=(string)${HEVC_PROFILE}, level=(string)${HEVC_LEVEL}" \ ! rtph265pay config-interval=1 pt=96 mtu=1400 \ ! udpsink host=${MULTICASTADDR2} auto-multicast=true port=${PORT}
Any ideas how to improve this?
Regards,
Bas Vermeulen