TheOpponent / mr-otcs

Automated video looping, streaming, and schedule generation
MIT License
74 stars 9 forks source link

No Twitch Stream - No output errors #24

Closed MrJay84 closed 4 months ago

MrJay84 commented 4 months ago

I'm installing OTCS on a RPI 4B using the 64bit OS Bookworm

I've installed OTCS as per the instructions for the 64 bit OS and all the dependancies. Stream key has been checked and rechecked as well as settings in the playlist.txt

I can successfully start main.py with a successful output in the terminal windows, including both FFMPG processes running yet there's no stream to Twitch. Is there a way to check the stream locally?

Can you shed any light on this behaviour? Is there an error log i'm missing? Is there a way to check the stream locally?

`[Info] Checking connection on 2024-06-10 00:41:22.059005+00:00. [Info] RTMP process started on 2024-06-10 01:41:22.525837. [Play] 4. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC.mp4 - Length: 0:24:11. [Notice] Starting from 0:14:00. [Info] 47:48:47 left before restart. [Info] Writing play history file to /home/admin/Documents/mr-otcs/GamesMaster/play_history.txt. [Notice] Not writing schedule for Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC: Name matches SCHEDULE_EXCLUDE_FILE_PATTERN. [Info] Encoding started on 2024-06-10 01:41 Screenshot 2024-06-10 at 01 48 00 :22.538725.

TheOpponent commented 4 months ago

Check your play history file in /home/admin/Documents/mr-otcs/GamesMaster/play_history.txt. Exceptions from the RTMP process are written there.

MrJay84 commented 4 months ago

This is the content of play_history.txt 2024-06-09 23:42:22.962369 - 2. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E02 - Gary Mason SDTV x264 AAC.mp4 2024-06-09 23:44:31.269358 - 3. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E03 - Annabel Croft SDTV x264 AAC.mp4 2024-06-10 00:06:44.149166 - 3. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E03 - Annabel Croft SDTV x264 AAC.mp4 2024-06-10 00:21:58.597322 - 3. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E03 - Annabel Croft SDTV x264 AAC.mp4 2024-06-10 00:26:55.161348 - 3. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E03 - Annabel Croft SDTV x264 AAC.mp4 2024-06-10 00:40:28.600369 - 3. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E03 - Annabel Croft SDTV x264 AAC.mp4 2024-06-10 00:43:53.911301 - 4. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC.mp4 2024-06-10 00:54:17.915545 - 4. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC.mp4 2024-06-10 01:08:45.761121 - 4. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC.mp4 2024-06-10 01:41:22.811491 - 4. /home/admin/Documents/mr-otcs/GamesMaster/Season 01/GamesMaster - S01E04 - Eric Bristow SDTV x264 AAC.mp4

TheOpponent commented 4 months ago

If the same video is appearing multiple times, the usual cause is that the RTMP process is failing to start. Check that the nginx service is started and that the rtmp block is in the nginx.conf file.

MrJay84 commented 4 months ago

Gong, it seems i was pushing the stream to Twitch at 60fps, dropping this to 30fps as fixed the issue.

One last question, can I stream to Twitch and YouTube concurrently? Or would this have to done at the NGINX level?

TheOpponent commented 4 months ago

If you're using a Raspberry Pi, its h264 hardware encoder is only capable of up to 1080p30. On other platforms, ffmpeg should be capable of transcoding well above that if you adjust the MEDIA_PLAYER_ARGUMENTS accordingly.

I haven't tried to push to multiple RTMP servers at once as that's out of scope for this project. You may need to create multiple nginx server blocks listening on different ports to each receive the concatenated videos, but I haven't tested this. See this Super User answer for more information on the ffmpeg command: https://superuser.com/a/1224820

MrJay84 commented 4 months ago

I was a mistake on my part. FYI there's a project called restreamer which runs in a container for pushing RMTP to multiple sources.

Thanks for all your help mate!