nvh264enc rc-mode=constqp and h264parse
Hey,
it seems there is a bug when using nvh264enc element with rc-mode=constqp and h264parse element.
The following pipeline works with gst version 1.22.8:
gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! nvh264enc preset=lossless rc-mode=constqp qp-const=0 ! h264parse ! filesink location=test.mp4
After updating to 1.22.9 i get the following error:
GST_DEBUG=3 gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! nvh264enc preset=lossless rc-mode=constqp qp-const=0 ! h264parse ! filesink location=test.mp4 Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Got context from element 'nvh264enc0': gst.cuda.context=context, gst.cuda.context=(GstCudaContext)"\(GstCudaContext\)\ cudacontext1", cuda-device-id=(uint)0; Got context from element 'nvh264enc0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0"; Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock 0:00:00.392395152 6817 0x7679ec000da0 WARN nvenc gstnvbaseenc.c:1849:gst_nv_base_enc_set_format:<nvh264enc0> error: Failed to init encoder: 8- Incorrect Profile for qpPrimeYZeroTransformBypassFlag and const QP RC mode. ERROR: from element /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Could not configure supporting library. Additional debug info: ../gstreamer/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c(1849): gst_nv_base_enc_set_format (): /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Failed to init encoder: 8- Incorrect Profile for qpPrimeYZeroTransformBypassFlag and const QP RC mode. 0:00:00.392463781 6817 0x7679ec000da0 WARN videoencoder gstvideoencoder.c:771:gst_video_encoder_setcaps:<nvh264enc0> rejected caps video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 Execution ended after 0:00:00.014729142 Setting pipeline to NULL ... 0:00:00.396954437 6817 0x7679ec000da0 WARN nvenc gstnvbaseenc.c:1849:gst_nv_base_enc_set_format:<nvh264enc0> error: Failed to init encoder: 8- Incorrect Profile for qpPrimeYZeroTransformBypassFlag and const QP RC mode. ERROR: from element /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Could not configure supporting library. Additional debug info: ../gstreamer/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c(1849): gst_nv_base_enc_set_format (): /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Failed to init encoder: 8- Incorrect Profile for qpPrimeYZeroTransformBypassFlag and const QP RC mode. 0:00:00.396989032 6817 0x7679ec000da0 WARN videoencoder gstvideoencoder.c:771:gst_video_encoder_setcaps:<nvh264enc0> rejected caps video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, colorimetry=(string)2:4:7:1 0:00:00.396998771 6817 0x7679ec000da0 WARN GST_PADS gstpad.c:4384:gst_pad_peer_query:<videoconvert0:src> could not send sticky events 0:00:00.397073160 6817 0x7679ec000da0 WARN GST_PADS gstpad.c:4384:gst_pad_peer_query:<v4l2src0:src> could not send sticky events 0:00:00.397086155 6817 0x7679ec000da0 WARN v4l2 gstv4l2object.c:4453:gst_v4l2_object_set_crop:<v4l2src0:src> VIDIOC_S_CROP failed 0:00:00.415931600 6817 0x7679ec000da0 WARN v4l2 gstv4l2object.c:3278:gst_v4l2_object_reset_compose_region:<v4l2src0:src> Failed to get default compose rectangle with VIDIOC_G_SELECTION: Invalid argument 0:00:00.416382056 6817 0x7679ec000da0 WARN v4l2bufferpool gstv4l2bufferpool.c:850:gst_v4l2_buffer_pool_start:<v4l2src0:pool0:src> Uncertain or not enough buffers, enabling copy threshold Freeing pipeline ...
When using the following pipeline i get no error:
gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! nvh264enc preset=lossless rc-mode=constqp qp-const=0 ! filesink location=test.mp4
Also using this pipeline does not result in an error:
gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! nvh264enc preset=lossless rc-mode=cbr qp-const=0 qp-max=0 qp-min=0 ! h264parse ! filesink location=test.mp4
So it seems it has to do with the rc-mode. I am not a pro when it comes to encodings and stuff, i need a pipeline to save video data as lossless as possible while preserving a file extension which i can use without any special software and be able to save the data in somewhat real time.
If you need more informations, let me know.
kind regards