switchable aspect-ratio with .bat file for vlc player?

Discussion in 'Scripting' started by hasomaso, Oct 6, 2013.

  1. hasomaso

    hasomaso MDL Novice

    Aug 3, 2012
    28
    3
    0
    #1 hasomaso, Oct 6, 2013
    Last edited by a moderator: Apr 20, 2017
    hello,

    how can i change the following aspect ratio with a .bat file for vlc stream?

    Code:
    2:1
    3:2
    4:3
    5:4
    16:9
    16:10
    21:9
    21:10
    

    i want to have a switchable Option under .bat

    this is a example with one stream and one aspect-ratio
    i would like for a stream multiple aspect ratio that i can Switch with .bat file

    Code:
    wget -O- "stream url" | c:\progra~1\videolan\vlc\vlc - --aspect-ratio 16:9

    who can post for me the correct parameters here?

    I thank you in advance and waiting for your positive News





    thanks
    hasomaso
     
  2. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    #2 KNARZ, Oct 7, 2013
    Last edited by a moderator: Apr 20, 2017
    This should do the job pretty good.

    Code:
    @echo off & cls
    :: KNARZ
    :: Description
    :: Run the Batch with URL as Parameter
    ::Exsample: THISBATCH.cmd http://www.anything.com/stream.m3u
    ::Fixed Stream: replace "stream=%~1" with your URL "stream=http://..."
    ::Batch closes after executing VLC.
    
    set program=c:\progra~1\videolan\vlc\vlc.exe
    set stream=%~1
    set ratio=0
    
    call :usage
    choice /m "Select Ratio" /C 123456789
    set select=%errorlevel%
    
    if %select% equ 9 exit
    if %select% equ 1 set ratio=2:1
    if %select% equ 2 set ratio=3:2
    if %select% equ 3 set ratio=4:3
    if %select% equ 4 set ratio=5:4
    if %select% equ 5 set ratio=16:9
    if %select% equ 6 set ratio=16:10
    if %select% equ 7 set ratio=21:9
    if %select% equ 8 set ratio=21:10
    
    start /b "VLC" "%program%" --aspect-ratio %ratio% "%stream%"
    exit
    
    
    :usage
    echo ###################
    echo #
    echo # Start stream:
    echo # %stream%
    echo # with Ratio:
    echo #
    echo #1) 2:1
    echo #2) 3:2
    echo #3) 4:3
    echo #4) 5:4
    echo #5) 16:9
    echo #6) 16:10
    echo #7) 21:9
    echo #8) 21:10
    echo #9) Exit
    echo #
    echo ###################
    goto :eof
    
    If you will use this for commercial purpose you may think about a donation.
     
  3. hasomaso

    hasomaso MDL Novice

    Aug 3, 2012
    28
    3
    0
    @KNARZ

    first i would like to thank respect, that works very well.
    i would like a few changes


    is that possible...

    1. later i will have 20 streams and when the stream is running change aspect ratio?
    2. i work with wget.exe and hxxp:// protocols should look like the .bat file?





    thanks
    hasomaso
     
  4. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    #4 KNARZ, Oct 7, 2013
    Last edited by a moderator: Apr 20, 2017
    1) Changing interactive can only be done within the programm itself. So you may should look for some kind of hotkeys or settings/preferences in vlc.
    2) I didn't understand why you used wget but than you only have to replace the vlc line.

    Code:
    start /b "VLC" "%program%" --aspect-ratio %ratio% "%stream%"
    to
    Code:
    start /b "VLC" wget.exe -O- "%stream%" | "%program%" --aspect-ratio %ratio% 
    as i remember there is an option for automatically ratio adjustment. I guess you try to stream something like tv which changes ratios from 'tv-show' (or whatever) to commercials and so on.
     
  5. andreycobra

    andreycobra MDL Novice

    Dec 4, 2013
    19
    0
    0
    U can set the aspect ratio using C (key C):unsure: