I would like to stream a 24/7 video to twitch however I'm unsure on how to do this because most of the guides are using a webcam and FFMpeg. I simply want a looped video to be streamed on a twitch page on my pi. I do have some python knowledge so if there is any solution that involves that I can definitely give that a try.

  • Comments are not for extended discussion; this conversation has been moved to chat.
    – goldilocks
    Apr 9, 2021 at 11:48

1 Answer 1


try adding "-re" option, to read the file "real time" (i.e. at files frame rate) rather than as fast as possible

ffmpeg -stream_loop -1 -re -i {file} -c:v h264 -c:a copy -b:v 4000k -s 1280x720 -threads 2 -f flv rtmp://live-lhr.twitch.tv/app/{streamkey}

If that doesn't reduce the problem enough (it will use far less CPU), then try using some hardware acceleration - assuming the input file is h264 - in this case, -threads makes no difference in my (limited) testing

ffmpeg -stream_loop -1 -re -c:v h264_mmal -i {file} -c:v h264_omx -c:a copy -b:v 4000k -s 1280x720 -f flv rtmp://live-lhr.twitch.tv/app/{streamkey}

Not the answer you're looking for? Browse other questions tagged or ask your own question.