I’m trying to encode video stream from appsrc in python opencv-gstreamer (Jetpack 4.4.1). Using pipeline appsrc | videoconvert ! omxh264enc ! qtmux ! filesink location=test.mp4
I occassionally run into this issue,
NvMMLiteVideoEncDoWork: Surface resolution (1 x 393216) smaller than encode resolution (640 x 360)
VENC: NvMMLiteVideoEncDoWork: 4283: BlockSide error 0x4
Event_BlockError from 105BlockAvcEnc : Error code - 4
Sending error event from 105BlockAvcEnc[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer
cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module omxh264enc-omxh264enc105 reported: GStreamer encountered a general supporting library error.
Having read in other posts that omx plugins are deprecated since r32.2, I tried to use nvv4l2h264enc with pipeline appsrc | videoconvert ! nvvidconv ! nvv4l2h264enc ! h264parse ! qtmux ! test.mp4
. It works, but blocks other threads/ops in my app, which doesn’t happen with the omxh264enc pipeline.
Even when using cmd line, gst-launch-1.0 videotestsrc ! 'video/x-raw,width=(int)640,height=(int)480,format=(string)I420' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvv4l2h264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=test.mp4 -e
, it says “Opening in BLOCKING MODE”, where as the equivalent pipeline with omx plugin doesn’t open in blocking mode.
My question is, if there is a way to open the stream/pipeline in non-blocking mode?