Last active
July 29, 2023 19:32
-
-
Save jeasonstudio/914981b346746309828ae31ecda9264c to your computer and use it in GitHub Desktop.
Use FFmpeg rtmp streaming in macOS
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
#! /bin/bash | |
# | |
# Diffusion bilibili live avec ffmpeg | |
# Make sure you have FFmpeg installed in your mac | |
# list avfoundation devices | |
ffmpeg -f avfoundation -list_devices true -i "" | |
# change the param after `-i` and `-f flv` | |
# use 140m mermory | |
ffmpeg \ | |
-f avfoundation \ | |
-re -i "2" \ | |
-vcodec libx264 \ | |
-preset ultrafast \ | |
-acodec aac \ | |
-ar 44100 \ | |
-ac 1 \ | |
-f flv "rtmp://example.com/path?key=xx" | |
# 560m mermory 90% cpu | |
ffmpeg \ | |
-f avfoundation \ | |
-video_size 1920x1080 \ | |
-framerate 30 \ | |
-i "2:0" -ac 2 \ | |
-vcodec libx264 -maxrate 2000k \ | |
-bufsize 2000k -acodec libmp3lame -ar 44100 -b:a 128k \ | |
-f flv "rtmp://example.com/path?key=xx" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
不行,直播间一直转圈圈,黑屏。
frame= 384 fps=5.6 q=8.0 size= 22174kB time=00:01:05.60 bitrate=2769.0kbits/s speed=0.962x
frame= 931 fps= 27 q=29.0 size= 4681kB time=00:00:35.16 bitrate=1090.4kbits/s speed=1.01x