Page 1 of 1

OBS to Portsdown batch file for mpeg2 ?

Posted: Sun Dec 29, 2019 2:06 pm
by G4WIM
Hi,

I seem to have mislaid my windows batch file to use the IPTS input on the Portsdown with an mpeg2 TS from OBS.

H264 is no problem but for our local 24cm repeater it needs mpeg2 for a 2MS signal.

Does anyone have a copy they could send me or point me toward where I might find one ?

Also details of the OBS profile would be useful as well.

73 Tim

Re: OBS to Portsdown batch file for mpeg2 ?

Posted: Mon Dec 30, 2019 3:49 pm
by G4WIM
Ok seems like I never had a batch file to convert OBS to Portsdown for H262 - only had one for vMix which uses NDI output.

So just for fun I installed the NDI plug in for OBS and tried the vMix to OBS batch file. Th batch file seems to be running ok and producing a stream but no sign of video.

However looking at the TS from ffmpeg on VLC I get just colour bars so guess there's an input mismatch somewhere.

Re: OBS to Portsdown batch file for mpeg2 ?

Posted: Mon Dec 30, 2019 7:19 pm
by m1cdq
this is my edited file i am using
OBS_PortsdownExtendedSR+FEC.rar
(1.97 KiB) Downloaded 366 times
setting done for
dvb-s2/QPSK FEC 1/4,1/3,3/5,8/9,9/10
dvbs-s/QPSK FEC 1/2,2/3,3/4,5/6,7/8
SR's 66 , 125 ,250, 333, 500 , 1000 , 2000 , 4000

this is still very much a work in progress. i've just added extra variables to it from the original
this is the bitrate calculator
http://www.satbroadcasts.com/DVB-S_Bitr ... lator.html


hope it helps

Code: Select all

@echo off
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=yourcall
rem Set appropriately
rem set raspi_ip=230.0.0.10
set raspi_ip=192.168.0.37
rem set raspi_ip=10.0.0.1
set ip=%raspi_ip%:10000
rem Print banner
echo obs MPEG-2 Video Encoder for the BATC Portsdown Transmitter
echo ============================================================
echo:
echo Start this script once obs is running, then leave it running
echo:
echo This script was modded by M1CDQ  for DVB-S and DVB-S2  are per portsdown fec list 
echo this is a work in progres  untested 
echo dvb-s2/QPSK  FEC 1/4 1/3 3/5 8/9  9/10
echo dvbs-s/QPSK  FEC  1/2 2/3 3/4 5/6 7/8
echo Look up Video bit rate value for current SR/FEC 
echo use the site http://www.satbroadcasts.com/DVB-S_Bitrate_and_Bandwidth_Calculator.html
echo to work out your own choice of SR/FEC combinations. The Netto TS bitrate is what you need but in Kmps so multiply by 1000000 then enter this as your new TSBITRATE
echo Once OBS is set up you can test it's all working with VLC set to receive an network connection on udp://230.0.0.11:20000 and
echo 
echo Set the SR and FEC, press Enter for default (previous) values
echo:

:requestSR
if X%SR%==X set SR=250
set defSR=%SR%
set /p SR=Enter SR ( 66 , 125 ,250, 333, 500 , 1000 , 2000 , 4000 ) in KS (%SR%):

set _tempvar=0
if %SR%==66  set _tempvar=1
if %SR%==125  set _tempvar=1
if %SR%==250  set _tempvar=1
if %SR%==333  set _tempvar=1
if %SR%==500  set _tempvar=1
if %SR%==1000  set _tempvar=1
if %SR%==2000  set _tempvar=1
if %SR%==4000  set _tempvar=1

if NOT %_tempvar% EQU 1 goto :requestSR

if X%SR%==X set SR=%defSR%

:requestFEC
if X%FEC%==X set FEC=3/4
set defFEC=%FEC%
set /p FEC=Enter FEC in kS (%FEC%):

set _tempvar=0
if %FEC%==1/2 set _tempvar=1
if %FEC%==2/3 set _tempvar=1
if %FEC%==3/4 set _tempvar=1
if %FEC%==5/6 set _tempvar=1
if %FEC%==7/8 set _tempvar=1
if %FEC%==1/4 set _tempvar=1
if %FEC%==1/3 set _tempvar=1
if %FEC%==3/5 set _tempvar=1
if %FEC%==8/9 set _tempvar=1
if %FEC%==9/10 set _tempvar=1
if NOT %_tempvar% EQU 1 goto :requestFEC

if X%FEC%==X set FEC=%defFEC%

rem Save values for next time
rem If these lines cause errors your system may not support SETX
rem If so just comment them out (use rem)

if not %SR%==%defSR% setx SR "%SR%"
if not %FEC%==%defFEC% setx FEC "%FEC%"

rem Look up Video bit rate value for current SR/FEC 
rem use the site http://www.satbroadcasts.com/DVB-S_Bitrate_and_Bandwidth_Calculator.html
rem to work out your own choice of SR/FEC combinations. The Netto TS bitrate is what you need but in Kmps so multiply by 1000000 then enter this as your new TSBITRATE
rem Once OBS is set up you can test it's all working with VLC set to receive an network connection on udp://230.0.0.11:20000 and
rem
rem
rem 

if %SR%==66 (
  if %FEC%==1/2 set TSBITRATE=60800
  if %FEC%==2/3 set TSBITRATE=81100
  if %FEC%==3/4 set TSBITRATE=91200
  if %FEC%==5/6 set TSBITRATE=101400
  if %FEC%==7/8 set TSBITRATE=106400
  if %FEC%==1/4 set TSBITRATE=32400
  if %FEC%==1/3 set TSBITRATE=43400
  if %FEC%==3/5 set TSBITRATE=78500
  if %FEC%==8/9 set TSBITRATE=116500
  if %FEC%==9/10 set TSBITRATE=118000
)
if %SR%==125 (
  if %FEC%==1/2 set TSBITRATE=115200
  if %FEC%==2/3 set TSBITRATE=153600
  if %FEC%==3/4 set TSBITRATE=172800
  if %FEC%==5/6 set TSBITRATE=192000
  if %FEC%==7/8 set TSBITRATE=201600
  if %FEC%==1/4 set TSBITRATE=61400
  if %FEC%==1/3 set TSBITRATE=82200
  if %FEC%==3/5 set TSBITRATE=148700
  if %FEC%==8/9 set TSBITRATE=220700
  if %FEC%==9/10 set TSBITRATE=223500
)
if %SR%==250 (
  if %FEC%==1/2 set TSBITRATE=230400
  if %FEC%==2/3 set TSBITRATE=307200
  if %FEC%==3/4 set TSBITRATE=345600
  if %FEC%==5/6 set TSBITRATE=384000
  if %FEC%==7/8 set TSBITRATE=403200
  if %FEC%==1/4 set TSBITRATE=122800
  if %FEC%==1/3 set TSBITRATE=164400
  if %FEC%==3/5 set TSBITRATE=297300
  if %FEC%==8/9 set TSBITRATE=441400
  if %FEC%==9/10 set TSBITRATE=446900
)
  if %SR%==333 (
  if %FEC%==1/2 set TSBITRATE=306900
  if %FEC%==2/3 set TSBITRATE=409200
  if %FEC%==3/4 set TSBITRATE=460300
  if %FEC%==5/6 set TSBITRATE=511500
  if %FEC%==7/8 set TSBITRATE=537000
  if %FEC%==1/4 set TSBITRATE=163600
  if %FEC%==1/3 set TSBITRATE=218900
  if %FEC%==3/5 set TSBITRATE=396000
  if %FEC%==8/9 set TSBITRATE=587900
  if %FEC%==9/10 set TSBITRATE=595300
)
  if %SR%==500 (
  if %FEC%==1/2 set TSBITRATE=460800
  if %FEC%==2/3 set TSBITRATE=614400
  if %FEC%==3/4 set TSBITRATE=691200
  if %FEC%==5/6 set TSBITRATE=768000
  if %FEC%==7/8 set TSBITRATE=806400
  if %FEC%==1/4 set TSBITRATE=245600
  if %FEC%==1/3 set TSBITRATE=328700
  if %FEC%==3/5 set TSBITRATE=594600
  if %FEC%==8/9 set TSBITRATE=882700
  if %FEC%==9/10 set TSBITRATE=893800
)
if %SR%==1000 (
  if %FEC%==1/2 set TSBITRATE=921600
  if %FEC%==2/3 set TSBITRATE=1228800
  if %FEC%==3/4 set TSBITRATE=1382400
  if %FEC%==5/6 set TSBITRATE=1535900
  if %FEC%==7/8 set TSBITRATE=1612700
  if %FEC%==1/4 set TSBITRATE=491200
  if %FEC%==1/3 set TSBITRATE=657400
  if %FEC%==3/5 set TSBITRATE=1189300
  if %FEC%==8/9 set TSBITRATE=1765500
  if %FEC%==9/10 set TSBITRATE=1787600
)
if %SR%==2000 (
  if %FEC%==1/2 set TSBITRATE=1843100
  if %FEC%==2/3 set TSBITRATE=2457500
  if %FEC%==3/4 set TSBITRATE=2764700
  if %FEC%==5/6 set TSBITRATE=3071900
  if %FEC%==7/8 set TSBITRATE=3225500
  if %FEC%==1/4 set TSBITRATE=982500
  if %FEC%==1/3 set TSBITRATE=1314900
  if %FEC%==3/5 set TSBITRATE=2378600
  if %FEC%==8/9 set TSBITRATE=3530900
  if %FEC%==9/10 set TSBITRATE=3575300
)
if %SR%==40000 (
  if %FEC%==1/2 set TSBITRATE=3686300
  if %FEC%==2/3 set TSBITRATE=4915000
  if %FEC%==3/4 set TSBITRATE=5529400
  if %FEC%==5/6 set TSBITRATE=6143800
  if %FEC%==7/8 set TSBITRATE=6451000
  if %FEC%==1/4 set TSBITRATE=1964900
  if %FEC%==1/3 set TSBITRATE=2629700
  if %FEC%==3/5 set TSBITRATE=4757200
  if %FEC%==8/9 set TSBITRATE=7061900
  if %FEC%==9/10 set TSBITRATE=7150500
)

echo Video bitrate for %SR% kS and FEC %FEC% is: %TSBITRATE%
echo:
echo Press any key to start the TS stream
echo:

pause

echo launch ffmpeg OBS
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="BATC" -metadata service_name=%callsign% ^
-flush_packets 0 -f mpegts "udp://%ip%:10000?pkt_size=1316&bitrate=%TSBITRATE%"

Re: OBS to Portsdown batch file for mpeg2 ?

Posted: Mon Dec 30, 2019 8:46 pm
by G4WIM
Thanks for the batch file - I was just about to post that I'd found what the problem is with NDI on OBS, basically prefixes the ndi stream the name of the PC which causes dshow to choke - so your batch file may get me out of this hole !

However could you provide the settings you use on OBS for the recording output as mine doesn't seem to work.

The batch file finds the OBS stream and runs ok but the MT rx doesn't decode the stream - so I guess its an OBS recording output setting.

Many thanks again, Tim

edit I had my OBS output set to H264, switching it to mpeg2video has resulted in getting the meta data but no video so far - strangely MT rx reports the codec as H264 but VLC reports it as mpgv - clearly I have something wrong in the OBS profile for mpeg2 !

Re: OBS to Portsdown batch file for mpeg2 ?

Posted: Mon Dec 30, 2019 9:19 pm
by m1cdq
https://wiki.batc.org.uk/OBS_-_Open_Broadcast_Studio

this is where i started in setting up profiles in obs

Re: OBS to Portsdown batch file for mpeg2 ?

Posted: Mon Dec 30, 2019 9:25 pm
by G4WIM
yeah - thanks for the link. I had tried that but it is for H264 rather than H262.

Think I'll give up for now and have a fresh look tomorrow as it's clearly an OBS profile problem - maybe a glass of wine will help ;-)

Thanks again Tim