Gst-launch how to push rtsp camera stream to cloud

I have jetson nano and a hikcamera(rtsp camera) . I want to use nano to push the hikcamera’s stream to cloud so I can see the live in my cloud. I use this command.

gst-launch-1.0 rtspsrc location=rtsp://admin:admin1234@ latency=0 ! rtph264depay ! h264parse ! queue ! flvmux ! rtmpsink location=rtmp://xxxxxxxxxxxxxxxxxxxx sync=false

And can get live stream, but I have a question. How can I change the video size. I just want the rtmp stream size(1280*720). What should I set? Thanks!

The video size(resolution) is decided by the encoded video data inside the stream. If you want to scaling the resolution, you need to decode the video and scale the video with scaling plugin and then encode(compress) the video into H264 or H264 stream again.

If you want to use Nvidia hardware acceleration for video decoding, encoding and scaling, you can try the following pipeline:

 gst-launch-1.0 filesrc location=/opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4 ! qtdemux name=demux demux.video_0 ! h264parse ! nvv4l2decoder num-extra-surfaces=5 ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=I420, width=720, height=480' ! nvv4l2h264enc bitrate=4000000 ! h264parse ! flvmux ! fakesink