Multi-resolution jpeg with gstreamer

Hello

I want to get Jpeg files of different resolutions from one source.
I can create a JPEG 1920x1080 file with the following command.

gst-launch-1.0 -v v4l2src device=/dev/video0 \
  ! "video/x-raw, format=(string)UYVY, width=(int)3840, height=(int)2160, framerate=30/1" \
  ! nvvidconv \
  ! tee name=a a. \
  ! queue \
  ! "video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1" \
  ! nvjpegenc \
  ! multifilesink location=/tmp/a_%d.jpg max-files=5 -e a. \
  ! queue \

Is it possible to create two types of JPEG here: 1920x1080 JPEG, 640x480 JPEG?
I tried using TEE with the following command, but without success.

gst-launch-1.0 -v v4l2src device=/dev/video0 \
  ! "video/x-raw, format=(string)UYVY, width=(int)3840, height=(int)2160, framerate=30/1" \
  ! nvvidconv \
  ! tee name=a a. \
  ! queue \
  ! "video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1" \
  ! nvjpegenc \
  ! multifilesink location=/tmp/a_%d.jpg max-files=5 -e a. \
  ! queue \
  ! tee name=b b. \
  ! queue \
  ! "video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1" \
  ! nvjpegenc \
  ! multifilesink location=/tmp/b_%d.jpg max-files=5 -e b. \
  ! queue

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.341: gst_mini_object_copy: assertion 'mini_object != NULL' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.341: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.341: gst_structure_copy: assertion 'structure != NULL' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.341: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.342: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.342: gst_structure_copy: assertion 'structure != NULL' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.342: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.342: gst_mini_object_unref: assertion 'mini_object != NULL' failed

(gst-launch-1.0:2013): GStreamer-CRITICAL **: 04:25:37.342: gst_mini_object_ref: assertion 'mini_object != NULL' failed
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)UYVY, framerate=(fraction)120/1, width=(int)3840, height=(int)2160, colorimetry=(string)2:4:5:1, interlace-mode=(string)progressive
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...

Is it not possible to output various resolutions using TEE?

Hi,
Please refer to this command:

gst-launch-1.0 videotestsrc num-buffers=10 ! video/x-raw,width=3840,height=2160 ! nvvidconv ! 'video/x-raw(memory:NVMM), width=3840, height=2160' ! tee name=t ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920,height=1080' ! nvjpegenc ! multifilesink location=1920_%03d.jpg t. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=640,height=480' ! nvjpegenc ! multifilesink location=640_%03d.jpg 
1 Like

Very nice! Wonderful!
Thank you very much.

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