5

I want to use the following to convert some M4A files to MP3. It works fine, but it displays the VLC GUI for each file and shows 'quit' as a second file to be converted. Is there a 'silent' mode, where it does the conversion with not graphics interface? Or is there something wrong with my syntax?

@echo off
for /f "delims=|" %%f in ('dir /b *.m4a') do (
  CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "%%f" --sout=#transcode{acodec=mp3,ab=128,vcodec=dummy}:std{access="file",mux=raw,dst="converted/%%"} vlc://quit
)

UPDATE: I edited per Answer #1

@echo off
for /f "delims=|" %%f in ('dir /b *.m4a') do (
  CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "%%f" --intf dummy --sout=#transcode{acodec=mp3,ab=128,vcodec=dummy}:std{access="file",mux=raw,dst=converted/"%%f"} vlc://quit
  move "%%f" trash/"%%f"
)

What it does is open a DOS command window as each file is processed. What I want is a totally silent mode (if possible). I have another batch file which does something similar (rips CD files to MP3) and it seems to work like that:

FOR /R D:\ %%G IN (*.cda) DO (
    "C:\Program Files (x86)\VideoLAN\VLC\vlc" -I http cdda:///D:/ --cdda-track=!y! :sout=#transcode{vcodec=none,acodec=%e%,ab=320,channels=2,samplerate=44100}:std{access="file",mux=raw,dst="%t%!PADDED!.%e%"} vlc://quit
)

What am I missing?

4

What you are looking for is the dummy interface. This will give you no GUI.

Example:

% vlc --intf dummy vcd://

Edit: While the dummy interface will give you no GUI, it will open a console. This is not what the question asked for so I am updating the answer.

This may be Linux only, I'm not sure yet. You can replace vlc with cvlc to get no interface at all.

  • Thanks. I tried adding that to my bat file and it didn't work as expected (I updated my question to show the results.) What went wrong? – jchwebdev Jul 29 '15 at 23:18
  • Oh I see. Does replacing vlc with cvlc work? I'm not sure if that's just a Linux thing. – MC10 Jul 29 '15 at 23:23
  • No cvlc in Windows version. The thing is: my other example (ripping CD) works -exactly- as I want. Can't understand the difference. – jchwebdev Jul 30 '15 at 0:19
3

You can use this:

vlc -I dummy --dummy-quiet {path_to_file}

As per @MC10's answer, the -intf dummy or -I dummy (they do the same thing) hides the GUI but still opens a second command line window. Use the additional --dummy-quiet option to hide this window too.

So, for your scenario:

@echo off
for /f "delims=|" %%f in ('dir /b *.m4a') do (
    CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "%%f" --I dummy --dummy-quiet --sout=#transcode{acodec=mp3,ab=128,vcodec=dummy}:std{access="file",mux=raw,dst=converted/"%%f"} vlc://quit
    move "%%f" trash/"%%f"
)
  • this works but on Windows 10 at least you can't close the video. The close button doesn't do anything, I had to kill the process – Matthew Mar 23 '18 at 1:26
  • Unfortunately, "C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy --dummy-quiet --version vlc://quit still pops up a batch window, and it doesn't look like the VLC people think that's a problem: trac.videolan.org/vlc/ticket/6866 – mrm Feb 14 at 0:09
-1

You're missing to call VLC as a server. Not sure, but it seems "-I http" parameters are what you need. Hope this help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.