获取USB摄像头推流操作:

  1. ffmpeg -f v4l2 -discard noref -i /dev/video0 -r 15 -s 640*480 -b:v 1000k -vcodec h264 -f rtsp -coder vlc -rtsp_transport tcp -preset ultrafast rtsp://127.0.0.1:8554/stream
  1. # 视频直翻转:
  2. -vf "vflip"
  3. # 视频水平翻转:
  4. -vf "hflip"
  5. # 添加时间水印:
  6. -vf "drawtext=fontsize=60:fontcolor=white:text='%{localtime}'"
  7. # 多个属性间使用英文逗号隔开:
  8. -vf "vflip, drawtext=fontsize=60:fontcolor=white:text='%{localtime}'"

USB摄像头同时转 rtsp 和 rtmp

  1. // 保存视频和声音 -c copy 等于 -vcodec copy -acodec copy
  2. ffmpeg -re -y -stimeout 10000 -rtsp_transport tcp -i rtsp:xxxx -t 60 -c copy -reset_timestamps true -break_non_keyframes true -f tee -map 0:v -map 0:a "[f=mov]hello5.mov|[f=flv]rtmp://192.168.0.46:1935/aibox/hello5"