Page 1 of 1

How to dispose 4 windows (VLC) in mosaic with a scrip .bat

Posted: 25 Jan 2018 14:22
by actia
Hello , i am creating a script .bat to see and save 4 videos from each flux from my camera.
It works with the following command:

@echo on
cd c:\Program Files
start VideoLAN\VLC\vlc.exe -vvv rtsp://169.254.198.169:554/live.sdp --sout="#std{mux=mp4,access=file,dst=d:\recording\1.mp4}" --sout="#duplicate{dst=std{mux=mp4,access=file,dst=d:\recording\1.mp4},dst=display}"
start VideoLAN\VLC\vlc.exe -vvv rtsp://169.254.198.169:554/live2.sdp --sout="#std{mux=mp4,access=file,dst=d:\recording\2.mp4}" --sout="#duplicate{dst=std{mux=mp4,access=file,dst=d:\recording\2.mp4},dst=display}"
start VideoLAN\VLC\vlc.exe -vvv rtsp://169.254.198.169:554/live3.sdp --sout="#std{mux=mp4,access=file,dst=d:\recording\3.mp4}" --sout="#duplicate{dst=std{mux=mp4,access=file,dst=d:\recording\3.mp4},dst=display}"
start VideoLAN\VLC\vlc.exe -vvv rtsp://169.254.198.169:554/live4.sdp --sout="#std{mux=mp4,access=file,dst=d:\recording\4.mp4}" --sout="#duplicate{dst=std{mux=mp4,access=file,dst=d:\recording\4.mp4},dst=display}"
exit

Now i am trying to dispose my 4 streams in mosaic on my screen with an other command! Can you help my pls :D

Re: How to dispose 4 windows (VLC) in mosaic with a scrip .bat

Posted: 25 Jan 2018 18:37
by verbal_666
Take "CMDOW". HERE.

Try this,

[MOSAIC.BAT]
@echo off
:: MOSAIC FOR WINDOWS IN WINDOW ## VERBAL 2018
setlocal enabledelayedexpansion
set cmdow=D:\Utility\Scripts\cmdow.exe
set window=VLC
set X=0
set Y=0
set Xadd=250
set Yadd=250
set counter=1
for /f "tokens=1" %%w in ('%cmdow% /t ^| findstr "%window%$"') do @(
echo MOVE: %%w TO !X! - !Y!
if !counter! EQU 3 set /a Y=!Y!+%Yadd%%
if !counter! EQU 3 set /a X=0
%cmdow% %%w /MOV !X! !Y!
set /a X=!X!+%Xadd%
set /a counter=!counter!+1
)

You can edit X , Y, Xadd, Yadd variables at your own for your Display Resolution.

Re: How to dispose 4 windows (VLC) in mosaic with a scrip .bat

Posted: 27 Jan 2018 09:14
by verbal_666
Replace /t switch with /f, for full Information. Lines, otherwise, are truncated...

@echo off
:: MOSAIC FOR WINDOWS IN WINDOW ## VERBAL 2018
setlocal enabledelayedexpansion
set cmdow=D:\Utility\Scripts\cmdow.exe
set window=VLC
set X=0
set Y=0
set Xadd=250
set Yadd=250
set counter=1
for /f "tokens=1" %%w in ('%cmdow% /f ^| findstr "%window%$"') do @(
if !counter! EQU 3 set /a Y=!Y!+%Yadd%%
if !counter! EQU 3 set /a X=0
if !counter! EQU 3 set counter=1
echo MOVE: %%w TO !X! - !Y!
%cmdow% %%w /MOV !X! !Y!
set /a X=!X!+%Xadd%
set /a counter=!counter!+1
)