Can you help me optimize my FFMPEG settings for streaming?











up vote
1
down vote

favorite












I want to optimize settings in ffmpeg for streaming. This is what I am currently running however I've basically copied and pasted different things I've found. I probably have some duplicate settings overlapping. Could a more experienced user please confirm if this is good?



sudo modprobe snd-aloop pcm_substreams=1
FFMPEG=ffmpeg
GIF=
STREAM_KEY=
URL=rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY
FPS=30
KEYINT=$(expr $FPS * 3)
TEXT=/tmp/current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"

$FFMPEG -thread_queue_size 512 -f alsa -ac 2 -i hw:Loopback,1,0 -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF
-vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v 5000k
-preset veryfast -s 1920x1080
-c:a libfdk_aac -b:a 128k -ar 44100
-f flv $URL


And here is the log dump



Log File:
https://pastebin.com/sv4utyT0










share|improve this question




















  • 1




    Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
    – slhck
    Nov 7 at 22:13










  • The complete log from your ffmpeg command would be informative for us to provide suggestions.
    – LordNeckbeard
    Nov 7 at 22:45












  • 3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
    – Spiff
    Nov 8 at 0:02










  • Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
    – K7AAY
    Nov 8 at 0:33










  • Updated and attached log :)
    – Orophix
    Nov 14 at 12:18















up vote
1
down vote

favorite












I want to optimize settings in ffmpeg for streaming. This is what I am currently running however I've basically copied and pasted different things I've found. I probably have some duplicate settings overlapping. Could a more experienced user please confirm if this is good?



sudo modprobe snd-aloop pcm_substreams=1
FFMPEG=ffmpeg
GIF=
STREAM_KEY=
URL=rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY
FPS=30
KEYINT=$(expr $FPS * 3)
TEXT=/tmp/current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"

$FFMPEG -thread_queue_size 512 -f alsa -ac 2 -i hw:Loopback,1,0 -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF
-vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v 5000k
-preset veryfast -s 1920x1080
-c:a libfdk_aac -b:a 128k -ar 44100
-f flv $URL


And here is the log dump



Log File:
https://pastebin.com/sv4utyT0










share|improve this question




















  • 1




    Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
    – slhck
    Nov 7 at 22:13










  • The complete log from your ffmpeg command would be informative for us to provide suggestions.
    – LordNeckbeard
    Nov 7 at 22:45












  • 3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
    – Spiff
    Nov 8 at 0:02










  • Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
    – K7AAY
    Nov 8 at 0:33










  • Updated and attached log :)
    – Orophix
    Nov 14 at 12:18













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to optimize settings in ffmpeg for streaming. This is what I am currently running however I've basically copied and pasted different things I've found. I probably have some duplicate settings overlapping. Could a more experienced user please confirm if this is good?



sudo modprobe snd-aloop pcm_substreams=1
FFMPEG=ffmpeg
GIF=
STREAM_KEY=
URL=rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY
FPS=30
KEYINT=$(expr $FPS * 3)
TEXT=/tmp/current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"

$FFMPEG -thread_queue_size 512 -f alsa -ac 2 -i hw:Loopback,1,0 -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF
-vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v 5000k
-preset veryfast -s 1920x1080
-c:a libfdk_aac -b:a 128k -ar 44100
-f flv $URL


And here is the log dump



Log File:
https://pastebin.com/sv4utyT0










share|improve this question















I want to optimize settings in ffmpeg for streaming. This is what I am currently running however I've basically copied and pasted different things I've found. I probably have some duplicate settings overlapping. Could a more experienced user please confirm if this is good?



sudo modprobe snd-aloop pcm_substreams=1
FFMPEG=ffmpeg
GIF=
STREAM_KEY=
URL=rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY
FPS=30
KEYINT=$(expr $FPS * 3)
TEXT=/tmp/current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"

$FFMPEG -thread_queue_size 512 -f alsa -ac 2 -i hw:Loopback,1,0 -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF
-vf drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v 5000k
-preset veryfast -s 1920x1080
-c:a libfdk_aac -b:a 128k -ar 44100
-f flv $URL


And here is the log dump



Log File:
https://pastebin.com/sv4utyT0







linux bash video ffmpeg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 12:18

























asked Nov 7 at 22:03









Orophix

62




62








  • 1




    Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
    – slhck
    Nov 7 at 22:13










  • The complete log from your ffmpeg command would be informative for us to provide suggestions.
    – LordNeckbeard
    Nov 7 at 22:45












  • 3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
    – Spiff
    Nov 8 at 0:02










  • Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
    – K7AAY
    Nov 8 at 0:33










  • Updated and attached log :)
    – Orophix
    Nov 14 at 12:18














  • 1




    Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
    – slhck
    Nov 7 at 22:13










  • The complete log from your ffmpeg command would be informative for us to provide suggestions.
    – LordNeckbeard
    Nov 7 at 22:45












  • 3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
    – Spiff
    Nov 8 at 0:02










  • Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
    – K7AAY
    Nov 8 at 0:33










  • Updated and attached log :)
    – Orophix
    Nov 14 at 12:18








1




1




Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
– slhck
Nov 7 at 22:13




Why the duplication? It's hard to answer your question without knowing the context of what you are trying to do.
– slhck
Nov 7 at 22:13












The complete log from your ffmpeg command would be informative for us to provide suggestions.
– LordNeckbeard
Nov 7 at 22:45






The complete log from your ffmpeg command would be informative for us to provide suggestions.
– LordNeckbeard
Nov 7 at 22:45














3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
– Spiff
Nov 8 at 0:02




3 mbps max bitrate seems a bit low for 1080p. Are you happy with the quality you get at that bitrate? Do you have some kind of slow DSL link you want this to work over, or some other reason for keeping the bitrate that low?
– Spiff
Nov 8 at 0:02












Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
– K7AAY
Nov 8 at 0:33




Please help us help you. Click on edit above and to the left, and add the requested answers into your original post. We need that to find useful information to help you.
– K7AAY
Nov 8 at 0:33












Updated and attached log :)
– Orophix
Nov 14 at 12:18




Updated and attached log :)
– Orophix
Nov 14 at 12:18















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1373601%2fcan-you-help-me-optimize-my-ffmpeg-settings-for-streaming%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1373601%2fcan-you-help-me-optimize-my-ffmpeg-settings-for-streaming%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa