Skip to content

Instantly share code, notes, and snippets.

@mateuszdw
Last active December 31, 2022 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mateuszdw/49ce79419a1fe0332f12d254c13e4dbb to your computer and use it in GitHub Desktop.
Save mateuszdw/49ce79419a1fe0332f12d254c13e4dbb to your computer and use it in GitHub Desktop.
OSX stream camera to nginx rtmp server
# nginx /etc/nginx/nginx.conf
rtmp {
server {
listen 1935;
chunk_size 4096;
allow publish <your public ip>;
deny publish all;
application live {
live on;
record off;
}
}
}
# to stream from OSX mac webcam to rtmp server
ffmpeg -f avfoundation -r 30 -s "640x480" -i "0" -vcodec libx264 -preset ultrafast -acodec aac -ar 44100 -ac "0" -f flv rtmp://server-domain/live/stream
# to play video without buffers
ffplay -fflags nobuffer rtmp://server-domain/live/stream -loglevel verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment