USB摄像头rtsp推流:

RTSP 媒体流服务器:项目链接

  1. /usr/bin/gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)640, height=(int)480,framerate=(fraction)30/1' ! v4l2h264enc ! rtspclientsink protocols=tcp location=rtsp://127.0.0.1:8554/stream

RTSP 转 RTMP

rtmp 媒体流服务器: 项目链接

  1. gst-launch-1.0 rtspsrc latency=20 user-id= user-pw= location=rtsp://192.168.0.144:8554/root ! rtph264depay ! h264parse ! flvmux ! rtmpsink location=rtmp://192.168.0.30:1935/live/hello

USB摄像头同时转 rtsp 和 rtmp

  1. # 树莓派4B操作
  2. gst-launch-1.0 v4l2src device=/dev/video0 ! \
  3. 'video/x-raw, width=(int)640, height=(int)480,framerate=(fraction)30/1' ! \
  4. v4l2h264enc ! tee name=teemux ! \
  5. queue ! rtspclientsink protocols=tcp location=rtsp://127.0.0.1:8554/stream teemux. ! \
  6. queue ! filesink location=/root/hello.mp4
  7. # jetson nano 操作
  8. gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1' ! \
  9. nvv4l2h264enc maxperf-enable=1 bitrate=2000000 ! tee name=teemux ! \
  10. queue ! rtspclientsink protocols=tcp location=rtsp://127.0.0.1:8554/stream teemux. \
  11. ! queue ! h264parse ! flvmux name=rtmp_push ! rtmpsink location=rtmp://127.0.0.1:1935/live/stream teemux. \
  12. ! queue ! filesink location=/root/hello.mp4