DeepStream does not get results for dual output processing of USB

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU) Jetson
**• DeepStream Version 6.0

I want to use the python support of deepstream to write a usb dual output result, read a usb camera, output all the way to the screen display, and store it all the way locally. I can do it using the usb demo in deepstream-app -c, but I myself Simulate with gstreamer, can’t display the picture, or can’t save the file to the local

The gstreamer code is as follows:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1 ! videoconvert ! nvvideoconvert ! ‘video/x-raw(memory:NVMM)’ ! m.sink_1 nvstreammux name=m width=1280 height=720 batch-size=1 batched-push-timeout=40000 ! queue ! nvinfer config-file-path=dstest1_pgie_config.txt batch-size=1 ! queue ! nvstreamdemux name=d d.src_1 ! queue ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=out.mp4 d.src_2 ! queue ! nvvideoconvert ! nvdsosd ! nveglglessink

You need to use “tee” to split the data on display and record branch, below is an example on videotestsrc, you can adapt it to your USB camera:

gst-launch-1.0 -vvv videotestsrc! tee name=t t. ! queue ! x264enc ! mp4mux ! filesink location=test.mp4 -e t. ! queue leaky=1 ! autovideosink sync=false

Thank you, but my usage scenario needs to split the video stored locally, and I can’t write them all into one file, so I tested such a pipeline, but it still doesn’t work

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=640,height=480, framerate=30/1 !
tee name=t ! t.src_1 ! queue ! xvimagesink t.src_2 ! videoconvert ! queue ! timeoverlay ! x264enc key-int-max=10 ! h264parse ! splitmuxsink location=video%02d.mov max-size-time=10000000000 max-size-bytes=1000000

image
I got this error with the demo you gave

What’s your camera detailed model? Are there two video sources on /dev/video0? If you play on /dev/video0 (gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink), how many camera can be displayed?
nvstreammux and nvstreamdemux is used to mux/demux different video sources, I think there is only one camera (source) in your /dev/video0.

This is my camera format, and one workable pipeline, saving output to local file and render to display.

nvidia@ubuntu:/opt/nvidia/deepstream/deepstream$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'MJPG' (Motion-JPEG, compressed)
	Size: Discrete 640x480
		Interval: Discrete 0.040s (25.000 fps)
	Size: Discrete 1280x720
		Interval: Discrete 0.040s (25.000 fps)
	Size: Discrete 1920x1080
		Interval: Discrete 0.040s (25.000 fps)
[1]: 'YUYV' (YUYV 4:2:2)
	Size: Discrete 640x480
		Interval: Discrete 0.040s (25.000 fps)
	Size: Discrete 1280x720
		Interval: Discrete 0.100s (10.000 fps)
	Size: Discrete 1920x1080
		Interval: Discrete 0.200s (5.000 fps)

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=25/1 ! videoconvert ! video/x-raw,format=NV12,width=640,height=480,framerate=25/1 ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12,width=640,height=480,framerate=25/1’ ! m.sink_0 nvstreammux name=m width=640 height=480 batch-size=1 batched-push-timeout=40000 ! queue ! nvinfer config-file-path=sources/apps/sample_apps/deepstream-test1/dstest1_pgie_config.txt ! tee name=t t. ! queue ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink t. ! queue ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=~/script.mp4


image
He can’t display the picture, and can’t store the video file

I adjusted the inference file address to play the video, but the screen freezes and an error is reported


Thank you, I made a simple adjustment and it works, thank you

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 !
videoconvert ! video/x-raw,format=NV12,width=640,height=480,framerate=30/1 !
nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12,width=640,height=480,framerate=30/1’ ! m.sink_0
nvstreammux name=m width=640 height=480 batch-size=1 batched-push-timeout=40000 !
queue ! nvinfer config-file-path=dstest1_pgie_config.txt !
tee name=t
t. ! queue ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink sync=0
t. ! queue ! nvvideoconvert ! nvv4l2h264enc ! h264parse !
splitmuxsink location=video%02d.mkv max-size-time=10000000000 muxer-factory=matroskamux muxer-properties=“properties,streamable=true”

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