Difference between revisions of "VK2CRJ Multiviewer"

From BATC Wiki
Jump to navigation Jump to search
(Created page with "VK2CRJ's script for a Multiviewer published in CQ-TV 277 does not work if copied and pasted from the CQ-TV pdf as some of the characters were inadvertently changed in the maga...")
 
Line 1: Line 1:
 
VK2CRJ's script for a Multiviewer published in CQ-TV 277 does not work if copied and pasted from the CQ-TV pdf as some of the characters were inadvertently changed in the magazine composition process.  Here is the original script.
 
VK2CRJ's script for a Multiviewer published in CQ-TV 277 does not work if copied and pasted from the CQ-TV pdf as some of the characters were inadvertently changed in the magazine composition process.  Here is the original script.
 +
 +
:: This script requires ffplay to be installed and it's path set
 +
@ECHO off
 +
ECHO Windows multiview player using ffplay by Gary VK2CRJ, 01/09/22
 +
SETLOCAL EnableDelayedExpansion
 +
 +
::::::::::: User settings :::::::::::::::::::::::::
 +
SET "server=rtmp://rtmp.batc.org.uk/live/"
 +
SET /A screenx = 1920 &:: Screen width
 +
SET /A screeny = 1080 &:: Screen height
 +
SET /A y0 =  0        &:: Top margin
 +
SET /A x0 =  0        &:: Left and right margins
 +
SET /A numx = 4      &:: Number of windows per row
 +
:::::::::::::::::::::::::::::::::::::::::::::::::::
 +
 +
SET /A xw = (screenx - 2 * x0) / numx &:: Player video window width
 +
SET /A yw = xw * 9 / 16              &:: Player video window height
 +
SET /A yb = 30                        &:: Player banner height
 +
SET "flags=-volume 0 -loglevel error" &:: Volume 9 down, 0 up, m toggle mute
 +
 +
:: List of stream callsigns. The ^ is the line continuation character and just for convenience.
 +
:: These will display in raster scan order
 +
SET list=vk3ce vk3rtv1 vk3rtv2 vk2rts^
 +
          w6cxatv w6sva w3bab w6atn^
 +
          gb3tz gb3ut gb3zz gb3vl
 +
 +
WHERE /Q "ffplay" &:: Check ffplay exists
 +
IF %ERRORLEVEL% NEQ 0 (
 +
    ECHO Error: ffplay not found, please check the path
 +
    PAUSE
 +
    EXIT /B
 +
)
 +
 +
ECHO Please wait a few seconds for the streams to start decoding
 +
SET /A i = 0
 +
FOR %%a IN (%list%) DO (
 +
    SET /A xdiv = i / numx
 +
    SET /A xmod = i %% numx
 +
    SET /A xpos = xmod * xw + x0
 +
    SET /A ypos = xdiv * yw + yb * "(xdiv + 1)" + y0
 +
    SET /A bot  = ypos + yw
 +
    SET url=%server%%%a
 +
    IF !bot! LEQ screeny (
 +
        START /B ffplay -top !ypos! -left !xpos! -y %yw% -x %xw% %flags% -window_title %%a !url!
 +
    )
 +
 +
    SET /A i += 1
 +
)
 +
 +
PAUSE

Revision as of 13:14, 11 October 2022

VK2CRJ's script for a Multiviewer published in CQ-TV 277 does not work if copied and pasted from the CQ-TV pdf as some of the characters were inadvertently changed in the magazine composition process. Here is the original script.

:: This script requires ffplay to be installed and it's path set
@ECHO off
ECHO Windows multiview player using ffplay by Gary VK2CRJ, 01/09/22
SETLOCAL EnableDelayedExpansion

::::::::::: User settings :::::::::::::::::::::::::
SET "server=rtmp://rtmp.batc.org.uk/live/"
SET /A screenx = 1920 &:: Screen width
SET /A screeny = 1080 &:: Screen height
SET /A y0 =  0        &:: Top margin
SET /A x0 =  0        &:: Left and right margins
SET /A numx = 4       &:: Number of windows per row
:::::::::::::::::::::::::::::::::::::::::::::::::::

SET /A xw = (screenx - 2 * x0) / numx &:: Player video window width
SET /A yw = xw * 9 / 16               &:: Player video window height
SET /A yb = 30                        &:: Player banner height
SET "flags=-volume 0 -loglevel error" &:: Volume 9 down, 0 up, m toggle mute

:: List of stream callsigns. The ^ is the line continuation character and just for convenience. 
:: These will display in raster scan order
SET list=vk3ce vk3rtv1 vk3rtv2 vk2rts^
         w6cxatv w6sva w3bab w6atn^
         gb3tz gb3ut gb3zz gb3vl
WHERE /Q "ffplay" &:: Check ffplay exists
IF %ERRORLEVEL% NEQ 0 (
    ECHO Error: ffplay not found, please check the path
    PAUSE
    EXIT /B
)
ECHO Please wait a few seconds for the streams to start decoding
SET /A i = 0
FOR %%a IN (%list%) DO (
    SET /A xdiv = i / numx
    SET /A xmod = i %% numx
    SET /A xpos = xmod * xw + x0
    SET /A ypos = xdiv * yw + yb * "(xdiv + 1)" + y0
    SET /A bot  = ypos + yw
    SET url=%server%%%a
    IF !bot! LEQ screeny (
        START /B ffplay -top !ypos! -left !xpos! -y %yw% -x %xw% %flags% -window_title %%a !url!
    )

    SET /A i += 1
)

PAUSE