Slideshow Background on FFmpeg for Streaming












0















I currently have a GIF looping in the background. But I want to add an image slideshow that features 10 images on loop. How can I achieve this?



My current code example that uses a GIF is below:



FFMPEG=ffmpeg
GIF= /home/randomgif.gif
STREAM_KEY=
TEXT=current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"
INRES=1366x768 # input resolution
OUTRES=1366x768 # output resolution
FPS=15 # target FPS
GOP=30 # i-frame interval, should be double of FPS,
GOPMIN=15 # min i-frame interval, should be equal to fps,
THREADS=4 # max 6
CBR=1100k # constant bitrate (should be between 1000k - 3000k)
QUALITY=veryfast # one of the many FFMPEG preset
AUDIO_RATE=44100
KEYINT=$(expr $FPS * 3)

$FFMPEG -thread_queue_size 1024 -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/slant.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5:fontsize=38"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p
-s $OUTRES -preset $QUALITY -acodec aac -threads $THREADS -fflags nobuffer
-bufsize $CBR -f flv "rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"

2> log_stream.txt









share|improve this question

























  • What happens when you run this code?

    – Twisty Impersonator
    Jan 26 at 1:09











  • It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

    – Orophix
    Jan 26 at 1:30











  • What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

    – Twisty Impersonator
    Jan 26 at 1:48
















0















I currently have a GIF looping in the background. But I want to add an image slideshow that features 10 images on loop. How can I achieve this?



My current code example that uses a GIF is below:



FFMPEG=ffmpeg
GIF= /home/randomgif.gif
STREAM_KEY=
TEXT=current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"
INRES=1366x768 # input resolution
OUTRES=1366x768 # output resolution
FPS=15 # target FPS
GOP=30 # i-frame interval, should be double of FPS,
GOPMIN=15 # min i-frame interval, should be equal to fps,
THREADS=4 # max 6
CBR=1100k # constant bitrate (should be between 1000k - 3000k)
QUALITY=veryfast # one of the many FFMPEG preset
AUDIO_RATE=44100
KEYINT=$(expr $FPS * 3)

$FFMPEG -thread_queue_size 1024 -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/slant.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5:fontsize=38"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p
-s $OUTRES -preset $QUALITY -acodec aac -threads $THREADS -fflags nobuffer
-bufsize $CBR -f flv "rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"

2> log_stream.txt









share|improve this question

























  • What happens when you run this code?

    – Twisty Impersonator
    Jan 26 at 1:09











  • It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

    – Orophix
    Jan 26 at 1:30











  • What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

    – Twisty Impersonator
    Jan 26 at 1:48














0












0








0








I currently have a GIF looping in the background. But I want to add an image slideshow that features 10 images on loop. How can I achieve this?



My current code example that uses a GIF is below:



FFMPEG=ffmpeg
GIF= /home/randomgif.gif
STREAM_KEY=
TEXT=current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"
INRES=1366x768 # input resolution
OUTRES=1366x768 # output resolution
FPS=15 # target FPS
GOP=30 # i-frame interval, should be double of FPS,
GOPMIN=15 # min i-frame interval, should be equal to fps,
THREADS=4 # max 6
CBR=1100k # constant bitrate (should be between 1000k - 3000k)
QUALITY=veryfast # one of the many FFMPEG preset
AUDIO_RATE=44100
KEYINT=$(expr $FPS * 3)

$FFMPEG -thread_queue_size 1024 -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/slant.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5:fontsize=38"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p
-s $OUTRES -preset $QUALITY -acodec aac -threads $THREADS -fflags nobuffer
-bufsize $CBR -f flv "rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"

2> log_stream.txt









share|improve this question
















I currently have a GIF looping in the background. But I want to add an image slideshow that features 10 images on loop. How can I achieve this?



My current code example that uses a GIF is below:



FFMPEG=ffmpeg
GIF= /home/randomgif.gif
STREAM_KEY=
TEXT=current_song.txt
COLOR="0xFFFFFF"
BCOLOR="0x000000"
INRES=1366x768 # input resolution
OUTRES=1366x768 # output resolution
FPS=15 # target FPS
GOP=30 # i-frame interval, should be double of FPS,
GOPMIN=15 # min i-frame interval, should be equal to fps,
THREADS=4 # max 6
CBR=1100k # constant bitrate (should be between 1000k - 3000k)
QUALITY=veryfast # one of the many FFMPEG preset
AUDIO_RATE=44100
KEYINT=$(expr $FPS * 3)

$FFMPEG -thread_queue_size 1024 -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/slant.ttf:bordercolor=$BCOLOR: borderw=1: fontcolor=$COLOR:textfile=$TEXT:reload=1:y=10:x=5:fontsize=38"
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p
-s $OUTRES -preset $QUALITY -acodec aac -threads $THREADS -fflags nobuffer
-bufsize $CBR -f flv "rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"

2> log_stream.txt






ubuntu ffmpeg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 26 at 1:16









JakeGould

32.1k1098141




32.1k1098141










asked Jan 26 at 1:05









OrophixOrophix

105




105













  • What happens when you run this code?

    – Twisty Impersonator
    Jan 26 at 1:09











  • It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

    – Orophix
    Jan 26 at 1:30











  • What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

    – Twisty Impersonator
    Jan 26 at 1:48



















  • What happens when you run this code?

    – Twisty Impersonator
    Jan 26 at 1:09











  • It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

    – Orophix
    Jan 26 at 1:30











  • What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

    – Twisty Impersonator
    Jan 26 at 1:48

















What happens when you run this code?

– Twisty Impersonator
Jan 26 at 1:09





What happens when you run this code?

– Twisty Impersonator
Jan 26 at 1:09













It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

– Orophix
Jan 26 at 1:30





It streams to YouTube and plays the GIF in a loop. I want to move from using a GIF to a slideshow of images that loop.

– Orophix
Jan 26 at 1:30













What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

– Twisty Impersonator
Jan 26 at 1:48





What have you tried? Please do not only respond in the comments. Instead, edit the post with this information.

– Twisty Impersonator
Jan 26 at 1:48










1 Answer
1






active

oldest

votes


















0














Replace -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF with -framerate $FPS -loop 1 -i img%d.jpg where the images are image1.jpg, image2.jpg ... image10.jpg. The images should be the same resolution.






share|improve this answer
























  • I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

    – Orophix
    Feb 7 at 5:37











  • Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

    – Gyan
    Feb 7 at 5:42











  • Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

    – Orophix
    Feb 7 at 6:12











  • Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

    – Gyan
    Feb 7 at 6:37











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',
autoActivateHeartbeat: false,
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%2f1398619%2fslideshow-background-on-ffmpeg-for-streaming%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Replace -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF with -framerate $FPS -loop 1 -i img%d.jpg where the images are image1.jpg, image2.jpg ... image10.jpg. The images should be the same resolution.






share|improve this answer
























  • I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

    – Orophix
    Feb 7 at 5:37











  • Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

    – Gyan
    Feb 7 at 5:42











  • Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

    – Orophix
    Feb 7 at 6:12











  • Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

    – Gyan
    Feb 7 at 6:37
















0














Replace -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF with -framerate $FPS -loop 1 -i img%d.jpg where the images are image1.jpg, image2.jpg ... image10.jpg. The images should be the same resolution.






share|improve this answer
























  • I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

    – Orophix
    Feb 7 at 5:37











  • Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

    – Gyan
    Feb 7 at 5:42











  • Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

    – Orophix
    Feb 7 at 6:12











  • Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

    – Gyan
    Feb 7 at 6:37














0












0








0







Replace -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF with -framerate $FPS -loop 1 -i img%d.jpg where the images are image1.jpg, image2.jpg ... image10.jpg. The images should be the same resolution.






share|improve this answer













Replace -fflags +genpts -ignore_loop 0 -r $FPS -i $GIF with -framerate $FPS -loop 1 -i img%d.jpg where the images are image1.jpg, image2.jpg ... image10.jpg. The images should be the same resolution.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 26 at 5:27









GyanGyan

15.6k21846




15.6k21846













  • I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

    – Orophix
    Feb 7 at 5:37











  • Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

    – Gyan
    Feb 7 at 5:42











  • Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

    – Orophix
    Feb 7 at 6:12











  • Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

    – Gyan
    Feb 7 at 6:37



















  • I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

    – Orophix
    Feb 7 at 5:37











  • Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

    – Gyan
    Feb 7 at 5:42











  • Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

    – Orophix
    Feb 7 at 6:12











  • Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

    – Gyan
    Feb 7 at 6:37

















I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

– Orophix
Feb 7 at 5:37





I end up with: [image2 @ 0x55c9a7520800] Could find no file with path 'img%d.jpg' and index in the range 0-4 img%d.jpg: No such file or directory

– Orophix
Feb 7 at 5:37













Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

– Gyan
Feb 7 at 5:42





Sorry, for img%d.jpg, files should be img1.jpg, img2.jpg ...

– Gyan
Feb 7 at 5:42













Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

– Orophix
Feb 7 at 6:12





Awesome, very close to what I need. The pictures are scrolling through at the moment is there a way to make the picture display for a certain period of time before moving to the next?

– Orophix
Feb 7 at 6:12













Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

– Gyan
Feb 7 at 6:37





Set framerate value to reciprocal of frame duration i.e. for 5 seconds per frame, 1/5 Then add fps=15 before the drawtext.

– Gyan
Feb 7 at 6:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398619%2fslideshow-background-on-ffmpeg-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

Сан-Квентин

8-я гвардейская общевойсковая армия

Алькесар