NVV4L2H265ENC working for multiple pipelines

I am interested in building an application that can take multiple nvarguscamerasrc sources (from sensor-id 0 to 5), and then individually encodes each of them. Would that be possible in any way? From my testing, it has always stopped both pipelines when I started recording and trying to use the encoder on the second one.

I am currently using a TX2, running JetPack 4.5.1. If possible, I can try to implement both of them in the same pipeline, but I would need a bit of guidance in having it possible to be scaled up to 6 nvarguscamerasrc.

I don’t have more than one camera on my AGX xavier, but this seems ok duplicating the same camera into 6 parallel encoded feeds:

# Saving each stream to a separate file:
gst-launch-1.0 -ev \
nvarguscamerasrc ! tee name=t \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test0.mp4  \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test1.mp4  \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test2.mp4  \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test3.mp4  \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test4.mp4  \
t. ! queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test5.mp4

# Putting all the 6 video streams into one mp4 (QT) container file :
gst-launch-1.0 -ev \
nvarguscamerasrc ! tee name=t \
qtmux name=mux ! filesink location=test_6xH265.mp4 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_0 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_1 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_2 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_3 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_4 \
t. ! queue ! nvv4l2h265enc ! h265parse ! mux.video_5

1 Like

Do you think you could do that with multiple “different” videotestsrc? I am just unsure of how to replace tee in the pipeline.

Nevermind, got it working from there.

gst-launch-1.0 -ev \
nvarguscamerasrc sensor-id=0 sensor-mode=0 ! \
'video/x-raw(memory:NVMM),width=2048,height=2048,framerate=1/1' ! \
queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test0.mp4 \
nvarguscamerasrc sensor-id=1 sensor-mode=0 ! \
'video/x-raw(memory:NVMM),width=2048,height=2048,framerate=1/1' ! \
queue ! nvv4l2h265enc ! h265parse ! qtmux ! filesink location=test1.mp4