项目
在 GitHub 查看
jkuri/opencv-ffmpeg-rtmp-stream
关于
OpenCV FFMpeg Live Video Stream over RTMP protocol.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文OpenCV FFMpeg RTMP Stream
Example of live video streaming over RTMP protocol using OpenCV and FFMpeg.
For streaming without using OpenCV check ffmpeg-webcam-rtmp-stream repository.
Installation Guide
Install FFMpeg
On MacOS.
brew install ffmpeg
On Ubuntu Linux.
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev libavdevice-dev -y
Install OpenCV
For installing OpenCV there's a script inside scripts/ folder:
./scripts/install-opencv.sh
Run RTMP Server Docker image
docker run -it -p 1935:1935 -p 8080:8080 --name rtmp-server jkuri/urtmp
Then open your browser at http://localhost:8080 where you can watch your published streams.
Compile & run
To compile source code just run:
mkdir -p build && cd build
cmake .. && make
Run the program to start streaming:
./build/rtmp-stream
To set up different options for stream, here is ./rtmp-stream -h output
SYNOPSIS
./rtmp-stream [-c <camera>] [-o <output>] [-f <fps>] [-w <width>] [-h <height>] [-b <bitrate>] [-p <profile>] [-l <log>]
OPTIONS
-c, --camera <camera>
camera ID (default: 0)
-o, --output <output>
output RTMP server (default: rtmp://localhost/live/stream)
-f, --fps <fps>
frames-per-second (default: 30)
-w, --width <width>
video width (default: 800)
-h, --height <height>
video height (default: 640)
-b, --bitrate <bitrate>
stream bitrate in kb/s (default: 300000)
-p, --profile <profile>
H264 codec profile (baseline | high | high10 | high422 | high444 | main) (default: high444)
-l, --log <log>
print debug output (default: false)
Use VLC or ffplay to connect to live video stream:
ffplay -sync ext rtmp://localhost/live/stream
LICENCE
MIT
探索相关项目
加载中…