Nvv4l2h264enc output is different from x264enc

I’m starting a pipeline that uses h264 encoding that streams to a kinesis stream like:

gst-launch-1.0 v4l2src do-timestamp=TRUE device=/dev/video0 ! video/x-raw ! queue ! videoconvert ! video/x-raw ! x264enc bframes=0 key-int-max=10 bitrate=500 ! video/x-h264,stream-format=avc,alignment=au,profile=baseline ! queue ! kvssink name=kinesissinkusb-046d_0825_1A0D6A40-video-index0 storage-size=512 iot-certificate="iot-certificate,endpoint=xxxxxxxx.credentials.iot.ap-southeast-2.amazonaws.com,cert-path=/greengrass/v2/thingCert.crt,key-path=/greengrass/v2/privKey.key,ca-path=/greengrass/v2/rootCA.pem,role-aliases=KvsCameraIoTRoleAlias,iot-thing-name=smartdvr-1423019132001" aws-region="ap-southeast-2" log-config="/etc/mtdata/kvssink-log.config" stream-name=smartdvr-1423019132001-live

pipeline graph

this works well. I now want to use the GPU acceleration to free up some CPU so i changed it to:

gst-launch-1.0 v4l2src do-timestamp=TRUE device=/dev/video0 ! video/x-raw ! queue ! nvvidconv ! nvv4l2h264enc insert-sps-pps=1 insert-vui=1 ! h264parse config-interval=1 ! video/x-h264,stream-format=avc,alignment=au,profile=baseline ! kvssink name=kinesissinkusb-046d_0825_1A0D6A40-video-index0 storage-size=512 iot-certificate="iot-certificate,endpoint=xxxxxxxxx.credentials.iot.ap-southeast-2.amazonaws.com,cert-path=/greengrass/v2/thingCert.crt,key-path=/greengrass/v2/privKey.key,ca-path=/greengrass/v2/rootCA.pem,role-aliases=KvsCameraIoTRoleAlias,iot-thing-name=smartdvr-1423019132001" aws-region="ap-southeast-2" log-config="/etc/mtdata/kvssink-log.config" stream-name=smartdvr-1423019132001-live

pipeline graph

even though the pipeline works, it is in a different format than the non-gpu accelerated and the kinesis backend won’t show it on the webpage.

The video stream that it generates is a valid one, just the webbrowser doesn’t know how to play it. Seeing that the settings from x264enc are accepted, this is a question how to make the output of nvvvl2h264enc to be exactly the same as x264enc.

Hi,
Please try to set this property:

  disable-cabac       : Set Entropy Coding Type CAVLC(TRUE) or CABAC(FALSE)
                        flags: readable, writable
                        Boolean. Default: false

It probably is CAVLC by default in x264enc. Please set to CAVLC in nvv4l2h264enc for a try.

Besides, may try small idr interval by setting

  idrinterval         : Encoding IDR Frame occurance frequency
                        flags: readable, writable, changeable only in NULL or RE
ADY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 256
1 Like

@DaneLLL thank you !! that was it !
nvv4l2h264enc maxperf-enable=1 disable-cabac=true idrinterval=60

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.