Skip to content

Webcam capture streaming via RTMP or saving into video file. Cross-platform. Sound device support added. Aimed mainly for Linux servers with no gpu.

License

Notifications You must be signed in to change notification settings

vaverix/webcam-rtmp-stream

Repository files navigation

webcam-rtmp-stream

Webcam capture streaming via RTMP or saving into video file. Cross-platform. Sound device support added. Aimed mainly for Linux servers with no gpu.

Inspirations

jkuri/ffmpeg-webcam-rtmp-stream

freeeyes/ffmpeg4_camera_to_rtmp

Build (dynamic)

Prerequisites (Ubuntu)

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

Prerequisites (MacOS)

brew install ffmpeg

Prerequisites (Windows, not tested) vcpkg

vcpkg install ffmpeg ffmpeg:x64-windows

Installation

After you installed everything for your host OS, run:

make

Build artifacts will be stored inside build/ directory.

Usage

Parameters

./build/stream [video_device] [audio_device] [output_path] [output_format] [width] [height] [fps]

Linux example

./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

License

MIT

About

Webcam capture streaming via RTMP or saving into video file. Cross-platform. Sound device support added. Aimed mainly for Linux servers with no gpu.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published