Тёмный

StreamPi - How to Live Stream on Twitch using a Raspberry Pi 5 

Подписаться
Просмотров 1,2 тыс.
% 56

How to live stream on Twitch using a Raspberry Pi 5. Going over the FFmpeg commands, designing a custom overlay with Canva, including sound and background music, and building a custom display and holder that shows the Raspberry Pi’s current temperature.
Website: ristoinnovates.com
Support me on Patreon: patreon.com/RistoInnovates
Support the channel and my work by getting me a coffee:
buymeacoffee.com/risto.innovates
Github: github.com/ristoinnovates
Written Instructions & Files: ristoinnovates.com/stream-on-twitch-using-raspberry-pi/
Twitch: www.twitch.tv/ristoinnovates
For Brands & Collaboration : beacons.ai/risto.innovates
▬ Commands used:
Just webcam stream:
ffmpeg -f v4l2 -thread_queue_size 1024 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0 \
-f alsa -thread_queue_size 1024 -i hw:2,0 \
-vcodec libx264 -b:v 4500k -maxrate 4500k -bufsize 9000k -preset veryfast -g 60 -keyint_min 60 \
-f flv rtmp://live.twitch.tv/app/Your_Twitch_Key
Webcam + overlay (adjust filter scale according to overlay design):
ffmpeg -f v4l2 -thread_queue_size 1024 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0 \
-i /PATH_TO_OVERLAY.png \
-filter_complex "[0:v]scale=1294:723[cam];[1:v][cam]overlay=90:255" \
-vcodec libx264 -b:v 4500k -maxrate 4500k -bufsize 9000k -preset veryfast -g 60 -keyint_min 60 \
-f flv rtmp://live.twitch.tv/app/Your_Twitch_Key
Webcam + overlay + microphone sound:
ffmpeg -f v4l2 -thread_queue_size 1024 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0 \
-f alsa -thread_queue_size 1024 -i hw:2,0 \
-i /PATH_TO_OVERLAY.png \
-filter_complex "[0:v]scale=1294:723[cam];[2:v][cam]overlay=90:255" \
-vcodec libx264 -b:v 4500k -maxrate 4500k -bufsize 9000k -preset veryfast -g 60 -keyint_min 60 \
-filter:a "volume=0.5" \
-acodec aac -b:a 160k -ar 44100 \
-f flv rtmp://live.twitch.tv/app/Your_Twitch_Key
Webcam + overlay + microphone sound + radio stream:
ffmpeg -f v4l2 -thread_queue_size 1024 -input_format mjpeg -framerate 30 -video_size 1920x1080 -i /dev/video0 \
-f alsa -thread_queue_size 1024 -i hw:2,0 \
-i /PATH_TO_OVERLAY.png \
-i YOUR_STREAM_URL_HERE \
-filter_complex "[0:v]scale=1294:723[cam];[2:v][cam]overlay=90:255[final];[1:a]volume=0.4[a1];[a1][3:a]amix=inputs=2:duration=first:dropout_transition=3[aout]" \
-map "[final]" -map "[aout]" \
-vcodec libx264 -b:v 4500k -maxrate 4500k -bufsize 9000k -preset veryfast -g 60 -keyint_min 60 \
-acodec aac -b:a 160k -ar 44100 \
-f flv rtmp://live.twitch.tv/app/Your_Twitch_Key
Webcam + overlay + microphone sound + radio stream (OPTIMIZED):
ffmpeg -f v4l2 -thread_queue_size 1024 -input_format mjpeg -framerate 24 -video_size 1280x720 -i /dev/video0 \
-f alsa -thread_queue_size 1024 -i hw:2,0 \
-i /PATH_TO_OVERLAY.png \
-i YOUR_STREAM_URL_HERE \
-filter_complex "[0:v]scale=1294:723[cam];[2:v][cam]overlay=90:255[final];[1:a]volume=0.4[a1];[a1][3:a]amix=inputs=2:duration=first:dropout_transition=3[aout]" \
-map "[final]" -map "[aout]" \
-vcodec libx264 -b:v 2500k -maxrate 2500k -bufsize 5000k -preset superfast -g 60 -keyint_min 60 \
-acodec aac -b:a 128k -ar 44100 \
-f flv rtmp://live.twitch.tv/app/Your_Twitch_Key
▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
0:00 - Intro
0:19 - Raspberry Pi + Webcam
0:45 - FFmpeg
1:00 - Initial Live Stream Twitch
1:20 - Canva Overlay
1:38 - Microphone Sound
1:42 - Music Radio Stream
1:55 - Optimization
2:10 - Starting stream in separate session
2:33 - Overheating
2:45 - Custom Temperature Display
3:23 - Outro
Music used in the video:
1. Toti Cisneros - Flow with the Wind
2. AlexGrohl - Dominion
FFmpeg: www.ffmpeg.org/
Radio Stream: www.247londonradio.com/
Linux GNU Screen: linuxize.com/post/how-to-use-linux-screen/
#raspberrypi #electronics #3dprinting #livestream #diy #twitch #obsstudio

Наука

Опубликовано:

 

31 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@ProGaming003
@ProGaming003 2 месяца назад
Its a good idea! Why dont you use docker to run it? That way, even if rasp restarts, you dont need to ssh it. The docker container will start on its own. ;)
@RistoInnovates
@RistoInnovates 2 месяца назад
Thanks for the suggestion, I will try it
@Many_MC
@Many_MC 2 месяца назад
Awesome :D!
@RistoInnovates
@RistoInnovates 2 месяца назад
Glad you like it!
@wonderlee9026
@wonderlee9026 2 месяца назад
Awesome 😮
@martinsuperfind7779
@martinsuperfind7779 2 месяца назад
Pro😎.
Далее