I am attempting to run a command line pipeline while deepstream-app is running. My pipeline with the deepstream app uses file source, inference element, osd, hardware encoder, and file sink.
The second pipeline and output is included below.
This command is being run as another process while the main deepstream process is also running.
gst-launch-1.0 multifilesrc location=/mnt/media/images/tmp/%08d.jpg caps=image/jpeg ! nvjpegdec ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420,framerate=(fraction)20/1,width=720,height=480' ! nvv4l2h264enc ! h264parse ! mp4mux ! filesink location=/mnt/media/videos/timelapse/2021-04-22T10:56:45.mp4
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is PREROLLING ...
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Caught SIGSEGV
#0 0x0000007fb36dae28 in __GI___poll (fds=0x55b1e8dce0, nfds=548472259128, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:41
#1 0x0000007fb37e7e08 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#2 0x00000055b1d35ac0 in ()
Spinning. Please run 'gdb gst-launch-1.0 14957' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
Any suggestion on how to debug this would be greatly appreciated.
The following is printed to syslog when the second command is run:
Apr 22 11:13:22 jetson1 kernel: [79542.386486] nvmap_alloc_handle: PID 17754: gst-launch-1.0: WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant.
Here I try the command without the hardware encoder on the second pipeline:
gst-launch-1.0 multifilesrc location=/mnt/media/images/tmp/%08d.jpg caps=image/jpeg ! nvjpegdec ! x264enc ! h264parse ! mp4mux ! filesink location=/mnt/media/videos/timelapse/2021-04-22T11:21:46.mp4
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
Caught SIGSEGV
#0 0x0000007f85e4de28 in __GI___poll (fds=0x55b27ec220, nfds=547708318264, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:41
#1 0x0000007f85f5ae08 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#2 0x00000055b26a7ac0 in ()
Spinning. Please run 'gdb gst-launch-1.0 19204' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) • DeepStream Version • JetPack Version (valid for Jetson only) • TensorRT Version • NVIDIA GPU Driver Version (valid for GPU only)
Deepstream application is expected to run with DS components, you can use nvvideoconvert which is recommended DS component as supporting NvBufSurface output in nvvidconv is not planned.
nvvidconv has no support to output NvBufSurface which is expected by nvv4l2h264enc when its run in deepstream application where DS_NEW_BUFAPI flags gets set. So this results into segfault.
So if you replace the pipeline in application with
system("gst-launch-1.0 videotestsrc ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=I420,framerate=1/1,width=720,height=480’ ! identity silent=0 ! nvv4l2h264enc ! fakesink -v ");
where there is no nvjpegdec, this will also result into a segfault as nvv4l2h264enc is expecting NvBufSurface from nvvidconv
segfault can also be seen with gst-launch pipeline when DS_NEW_BUFAPI=1 is set.
export DS_NEW_BUFAPI=1
gst-launch-1.0 videotestsrc ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=I420,framerate=1/1,width=720,height=480’ ! identity silent=0 ! nvv4l2h264enc ! fakesink -v
so that’s why suggested as comment 20
@Amycao Thank you for your response. I am still not understanding. Is there a problem with my pipeline? It works fine outside as a gst-launch command correct? Is there a way to run the same pipeline in parallel within deepstream-app ?