Streaming from OBS freezes and stutters.
Posted: Fri Feb 05, 2021 10:16 pm
Hello,
I am finally beginning to understand and use OBS and have now a hopefully small issue when using Recording to send video/audio using ffmpeg.
I am using the batch file and ini file as per Wiki https://wiki.batc.org.uk/OBS_-_Open_Broadcast_Studio
For testing purposes I have replaced the IP address for Portsdown with the IP address for another computer to view the stream using VLC player. Occasionally I get a number of errors at startup but the steam does send to VLC on the second computer.
However, after a minute or two the steam stops with the error message shown in Red in the image below.
The batch file I am using is as below:-
@echo off
rem FEC 2/3
rem edited By G7JTT May 2019
rem Feb 2019 by Evariste F5OEO - QO-100 Release 0.9 (Completely rewritten)
rem Started from original tool
rem Idea from Portsdown vmix ffmpeg script
rem ================= SETUP ONCE ===========
set callsign=G4NKV
rem Set appropriately
rem set raspi_ip=230.0.0.10
set raspi_ip=192.168.1.27
rem set raspi_ip=10.0.0.1
set ip=%raspi_ip%:10000
rem ================= INTERACTIVE =======================
rem --- SR asked only once ----
rem set SR=250
cls
:promptme
rem ADD THE PROMPT TEXT TO THE LINE BELOW IE ==== Enter 125, 250,333,500,1M ====
echo ==== FEC 2/3 --- Enter SR 125, 250, 333, 500, 1000 ====
echo.
set /p SR="SymbolRate(Ks) (%SR%) "
rem DUPLICATE THE LINE BELOW FOR EXTRA SR/FEC COMBOS
IF "%SR%"=="125" (SET TSBITRATE=165300)
IF "%SR%"=="250" (SET TSBITRATE=330600)
IF "%SR%"=="333" (SET TSBITRATE=440300)
IF "%SR%"=="500" (SET TSBITRATE=661100)
IF "%SR%"=="1000" (SET TSBITRATE=1322300)
IF "%TSBITRATE%"=="" (GOTO :promptme)
echo.
echo SR=%SR%
echo Muxrate=%TSBITRATE%
echo ip=%ip%
echo callsign=%callsign%
echo TSBITRATE=%TSBITRATE%
rem ======================== Launch ffmpeg OBS =========================
echo.
echo launch ffmpeg OBS
echo.
pause
start "OBS to udp/ts" /high ^
C:\ffmpeg\bin\ffmpeg ^
-i udp://230.0.0.11:20000 -c:v copy -max_delay 1000000 -muxrate %TSBITRATE% -c:a copy ^
-f mpegts -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_service_id 1 -mpegts_pmt_start_pid 4096 -streamid 0:256 -streamid 1:257 ^
-metadata service_provider="QO-100" -metadata service_name=%callsign% ^
-flush_packets 0 -f mpegts "udp://%ip%:?overrun_nonfatal=1&fifo_size=2000000&pkt_size=1316&bitrate=%TSBITRATE%"
I have made a few changes. The text "1000" in "udp://%ip%:10000?pkt_size=1316&bitrate=%TSBITRATE%" was removed as it seemed to duplicate the IP address, but this did not cure the issue with the stream freezing (red errors shown in image above).
After some searching on Google I added "overrun_nonfatal=1&fifo_size=2000000&" to the script above. This seems to have stopped the script from freezing, but I don't know enough about ffmpeg to know why this works or if I should have put this in.
While the freezing has stopped I am still getting some stuttering on the VLC player on the other computer. This occurs when there is quick movement on the video and results in the Yellow errors "TS is invalid" in the image above. When the quick movement stops VLC resumes showing the video.
The computer I am running OBS on is an Intel I7 at 4GHz, with 16GByte of memory. Task manager shows there is not much load on the processor and only 4GByte of memory in use. All tests have been done with FEC 2/3 and SR of 250ks.
How can I alter the script to make the stream smooth and remove these error messages ?
Any advice will be much appreciated.
Regards,
Nick -G4NKV
I am finally beginning to understand and use OBS and have now a hopefully small issue when using Recording to send video/audio using ffmpeg.
I am using the batch file and ini file as per Wiki https://wiki.batc.org.uk/OBS_-_Open_Broadcast_Studio
For testing purposes I have replaced the IP address for Portsdown with the IP address for another computer to view the stream using VLC player. Occasionally I get a number of errors at startup but the steam does send to VLC on the second computer.
However, after a minute or two the steam stops with the error message shown in Red in the image below.
The batch file I am using is as below:-
@echo off
rem FEC 2/3
rem edited By G7JTT May 2019
rem Feb 2019 by Evariste F5OEO - QO-100 Release 0.9 (Completely rewritten)
rem Started from original tool
rem Idea from Portsdown vmix ffmpeg script
rem ================= SETUP ONCE ===========
set callsign=G4NKV
rem Set appropriately
rem set raspi_ip=230.0.0.10
set raspi_ip=192.168.1.27
rem set raspi_ip=10.0.0.1
set ip=%raspi_ip%:10000
rem ================= INTERACTIVE =======================
rem --- SR asked only once ----
rem set SR=250
cls
:promptme
rem ADD THE PROMPT TEXT TO THE LINE BELOW IE ==== Enter 125, 250,333,500,1M ====
echo ==== FEC 2/3 --- Enter SR 125, 250, 333, 500, 1000 ====
echo.
set /p SR="SymbolRate(Ks) (%SR%) "
rem DUPLICATE THE LINE BELOW FOR EXTRA SR/FEC COMBOS
IF "%SR%"=="125" (SET TSBITRATE=165300)
IF "%SR%"=="250" (SET TSBITRATE=330600)
IF "%SR%"=="333" (SET TSBITRATE=440300)
IF "%SR%"=="500" (SET TSBITRATE=661100)
IF "%SR%"=="1000" (SET TSBITRATE=1322300)
IF "%TSBITRATE%"=="" (GOTO :promptme)
echo.
echo SR=%SR%
echo Muxrate=%TSBITRATE%
echo ip=%ip%
echo callsign=%callsign%
echo TSBITRATE=%TSBITRATE%
rem ======================== Launch ffmpeg OBS =========================
echo.
echo launch ffmpeg OBS
echo.
pause
start "OBS to udp/ts" /high ^
C:\ffmpeg\bin\ffmpeg ^
-i udp://230.0.0.11:20000 -c:v copy -max_delay 1000000 -muxrate %TSBITRATE% -c:a copy ^
-f mpegts -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_service_id 1 -mpegts_pmt_start_pid 4096 -streamid 0:256 -streamid 1:257 ^
-metadata service_provider="QO-100" -metadata service_name=%callsign% ^
-flush_packets 0 -f mpegts "udp://%ip%:?overrun_nonfatal=1&fifo_size=2000000&pkt_size=1316&bitrate=%TSBITRATE%"
I have made a few changes. The text "1000" in "udp://%ip%:10000?pkt_size=1316&bitrate=%TSBITRATE%" was removed as it seemed to duplicate the IP address, but this did not cure the issue with the stream freezing (red errors shown in image above).
After some searching on Google I added "overrun_nonfatal=1&fifo_size=2000000&" to the script above. This seems to have stopped the script from freezing, but I don't know enough about ffmpeg to know why this works or if I should have put this in.
While the freezing has stopped I am still getting some stuttering on the VLC player on the other computer. This occurs when there is quick movement on the video and results in the Yellow errors "TS is invalid" in the image above. When the quick movement stops VLC resumes showing the video.
The computer I am running OBS on is an Intel I7 at 4GHz, with 16GByte of memory. Task manager shows there is not much load on the processor and only 4GByte of memory in use. All tests have been done with FEC 2/3 and SR of 250ks.
How can I alter the script to make the stream smooth and remove these error messages ?
Any advice will be much appreciated.
Regards,
Nick -G4NKV