Webcam capture streaming via RTMP or saving into video file. Cross-platform. Sound device support added. Aimed mainly for Linux servers with no gpu.
jkuri/ffmpeg-webcam-rtmp-stream
freeeyes/ffmpeg4_camera_to_rtmp
sudo apt-get update
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavdevice-dev -y
sudo apt-get install ffmpeg -y
sudo apt-get install build-essential clang -y
brew install ffmpeg
Prerequisites (Windows, not tested) vcpkg
vcpkg install ffmpeg ffmpeg:x64-windows
After you installed everything for your host OS, run:
make
Build artifacts will be stored inside build/
directory.
./build/stream [video_device] [audio_device] [output_path] [output_format] [width] [height] [fps]
./build/stream /dev/video0 default rtmp://localhost/live/stream flv 1920 1080 30
./build/stream /dev/video0 default rtmp://live.twitch.tv/app/streamkey flv 1920 1080 30
./build/stream /dev/video0 default rtmp://a.rtmp.youtube.com/live2/streamkey flv 1920 1080 30
MIT