Change the resolution during execution,CSI IMX219 camera

I use CSI IMX219 camera
I want to use “GST_ARGUS: 3264 x 1848 FR = 28.000001 fps” mode, because the FOV is larger.
I use C++ opencv, if i use

nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)3264, height=(int)1848, format=(string)NV12, framerate=(fraction)28/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)3264, height=(int)1848, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink drop=1

Get image and cv::resize to (480, 270)
cv::imshow , FPS: 5~8

if use

nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)3264, height=(int)1848, format=(string)NV12, framerate=(fraction)28/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)480, height=(int)270, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink drop=1

cv::imshow , FPS: 28

I want to show image(480, 270) with 28 FPS, but save image(3264, 1848), (cv::imwrite)

Is it possible to switch the resolution without turning off the camera?

(Because in “GST_ARGUS: 3264 x 1848 FR = 28.000001 fps” mode , an error occurs when turning off the camera( cam.release() ),
Error message: Segmentation fault (core dumped), and the camera cannot be turned on)

hello s25796pg,

you’re able to add tee to extend your pipeline to have different operations.
for your reference, here’s pipeline to enable camera preview stream and also video recording as h265 for 300-frames.
for example,
$ gst-launch-1.0 -e nvarguscamerasrc num-buffers=300 ! 'video/x-raw(memory:NVMM), width=2952, height=1944, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=video0.mp4 streams. ! queue ! nvoverlaysink -e