Encoding the real time streaming from usb camera to h.264 and directing the stream towards other computer and Decode

The video format of the USB camera on my jetson nano development board is YUY2. I need to encode the video stream into H.264 and transfer it to another computer (via host and port). Then decode the video stream and save the video. I probably know how to encode Transmission, but I do n’t know how to decode it correctly. As a result, I do n’t know if the transmitted video stream is normal. Can anyone help me solve this problem?
The instructions on the jetson nano development board are probably as follows (I don’t know if it is wrong, you can tell me the instruction you think is correct):
gst-launch-1.0 -v v4l2src device = / dev / video0! 'video / x-raw, format = (string) YUY2, width = (int) 640, height = (int) 480, framerate = (fraction) 30 / 1 '! Videoflip method = upper-right-diagonal! Videoconvert! X264enc bitrate = 2000 byte-stream = false key-int-max = 60 bframes = 0 aud = true tune = zerolatency! H264parse! Rtph264pay config-interval = 1! Udpsink host = port = 5000 sync = false async = false

What instructions should be input on the receiving computer to decode the video stream and display or save it?

You may try something like:

gst-launch-1.0 -ev udpsrc port=5000 ! application/x-rtp, media=video, encoding-name=H264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

Note it may take 10s to start running.

If it works, you may change the pipeline to this for saving to file:

gst-launch-1.0 -ev udpsrc port=5000 ! application/x-rtp, media=video, encoding-name=H264 ! rtph264depay ! h264parse ! qtmux ! filesink location=test.mov

Thank you very much. It works for me. But there is still a problem: I transfer video stream from Jetson nano to my computer, only in the same LAN can I succeed. How to transfer it to PC through the Internet?

At the same time, I want to know the details of these elements, how to combine them to encode, decode, transmit video, etc. do you have the recommended materials?like (‘videoconvert’、‘qtmux’) I want to know their specific meanings, the decoding instructions corresponding to the encoding, etc., so that I can combine them in various ways to meet the specific requirements.

You may need to configure network setting to have a public IP on the PC.
If your PC has public IP, you should be able to set up a public RTSP server.

We also work in local LAN and don’t have experience of this network setting. Need other users to share experience.