USB摄像头rtsp推流:
RTSP 媒体流服务器:项目链接
/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 媒体流服务器: 项目链接
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
# 树莓派4B操作
gst-launch-1.0 v4l2src device=/dev/video0 ! \
'video/x-raw, width=(int)640, height=(int)480,framerate=(fraction)30/1' ! \
v4l2h264enc ! tee name=teemux ! \
queue ! rtspclientsink protocols=tcp location=rtsp://127.0.0.1:8554/stream teemux. ! \
queue ! filesink location=/root/hello.mp4
# jetson nano 操作
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1' ! \
nvv4l2h264enc maxperf-enable=1 bitrate=2000000 ! tee name=teemux ! \
queue ! rtspclientsink protocols=tcp location=rtsp://127.0.0.1:8554/stream teemux. \
! queue ! h264parse ! flvmux name=rtmp_push ! rtmpsink location=rtmp://127.0.0.1:1935/live/stream teemux. \
! queue ! filesink location=/root/hello.mp4