GStreamer推流

想将usb摄像头的流推到平板或电脑上,请问有参考的文档或命令吗?

Hello @zhang.xiang,

Sorry I reply in English, I do not speak Chinese, however, I translated your question and it seems like we might be able to help.

Allow me to ask you a few clarifying questions.

  1. Is the USB camera connected to a NVIDIA Jetson board?
  2. How is the Jetson board connected to the tablet or computer?
  3. What NVIDIA Jetson board are you using ?

regards,
Andrew

Yes, the usb camera is connected to the NVIDIA Jetson motherboard.
Connect to a computer or tablet through a usb adapter.
Jetson Xavier NX.

Hi,
Please check the items in FAQ:

Jetson Xavier NX FAQ
Q: I have a USB camera. How can I launch it on Xavier NX?
Q: Is there any example of running RTSP streaming?
Q: Is there any example of running UDP streaming?

Yes, I hope to get answers to these questions.

Hello @zhang.xiang,

Got it, thanks for the extra info.

There is a couple of options that already come to mind.

The first one and the easiest one, would be to use the OTG port on the Jetson, to connect it to the computer.
This will setup a network connection between the two devices and will allow you to interact with the Jetson board from the computer through IP 192.168.55.1
Through this network connection you will be able to ssh, run GStreamer pipelines and even stream your cameras for the PC to interact with.

You could use the following pipelines to RUN RTP streaming.

On Your Jetson Board

CLIENT_IP=<YOUR PC IP ADDRESS>
gst-launch-1.0 videotestsrc ! nvvidconv ! omxh264enc ! video/x-h264, stream-format=byte-stream ! rtph264pay mtu=1400 ! udpsink host=$CLIENT_IP port=5000 sync=false async=false

On Your PC

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_h264 ! xvimagesink sync=false async=false -e

Please note that the piplines might require some changes, and this solution also assumes you have GStreamer on your PC.

The second option is a bit more complex, but you could use UVC to have the Jetson Board emulate a camera when connected to the computer. However, this requires a lot more development to be done.

May we ask, what is the final use case? This could help us define a better path tailored for your project.

Please let us know if that helps.
Also, don’t hesitate to reach out if you have further questions or require more assistance.

regards,
Andrew

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