Last active
December 31, 2022 17:38
-
-
Save mateuszdw/49ce79419a1fe0332f12d254c13e4dbb to your computer and use it in GitHub Desktop.
OSX stream camera to nginx rtmp server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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