Further Windows Command Line Problems (Batch File)

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
steve333
Blank Cone
Blank Cone
Posts: 64
Joined: 21 Dec 2008 21:24
Location: UK

Further Windows Command Line Problems (Batch File)

Postby steve333 » 21 Dec 2014 05:27

I want to convert a series of MPEG2 files to MP4 (for example), using a windows batch file.
*Edit* I am using Windows 7 64 Bit, running VLC 2.1.5 32 bit (for compatibility with Firefox).

I have successfully used a command line of the form:

Code: Select all

vlc.exe "E:\Input Files\Test.mpg" --sout=#transcode{vcodec=h264,scale=Auto,acodec=mp3,ab=128,channels=2,samplerate=44100}:file{dst="F:\Output Files\Test.mp4",no-overwrite} vlc://quit
(NB it's really all one line but I can't work out how to stop the auto text-wrapping when I cut and paste)

There are two problems with this:

1) The command line immediately proceeds to the next command prompt (while vlc is still running).
It doesn't wait for vlc to exit.
(In unix-speak I would say that the vlc process is running in a new shell or in the background).
No other windows commands do this (I haven't set anything to make this happen).
So it seems that if I put this syntax in a FOR ... DO loop it will iterate all the loops without waiting.
So I'll get all the input files opened at the same time and converted in parallel, which will kill Windows.

2) When I try to add the "Video Scaling" filter (croppadd), vlc opens and gives me a message that the H264 codec doesn't exist, and that this is "not vlc's problem"!
As soon as I remove the "vfilter=croppadd" syntax, vlc works correctly again.
ie: this fails

Code: Select all

vlc.exe "E:\Input Files\Test.mpg" --sout=#transcode{vcodec=h264,vfilter=croppadd{paddleft=120,paddright=120},scale=Auto,acodec=mp3,ab=128,channels=2,samplerate=44100}:file{dst="F:\Output Files\Test.mp4",no-overwrite} vlc://quit
*Edit* VLC error message inserted:
Streaming / Transcoding failed:
It seems your Libav/FFmpeg (libavcodec) installation lacks the following encoder:
H264 - MPEG-4 AVC (part 10).
If you don't know how to fix this, ask for support from your distribution.

This is not an error inside VLC media player.
Do not contact the VideoLAN project about this issue.
"This is not an error inside VLC media player." - but it works as soon as I remove "vfilter=croppadd{paddleft=120,paddright=120}," from the command!

Can anyone help?
Last edited by steve333 on 21 Dec 2014 16:31, edited 1 time in total.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Further Windows Command Line Problems (Batch File)

Postby mederi » 21 Dec 2014 15:10

Windows 7 64-bit
cmd /?
start /?

start "" /wait vlc.exe ...
?

steve333
Blank Cone
Blank Cone
Posts: 64
Joined: 21 Dec 2008 21:24
Location: UK

Re: Further Windows Command Line Problems (Batch File)

Postby steve333 » 21 Dec 2014 16:22

Thanks for your quick reply.
Sorry I forgot to mention the version of windows, you are correct (I've updated the original post with version info).

I saw the use of "cmd" in an old example, but it appears to do exactly the opposite of what's needed (ie. it runs the command in the background), so I thought I was out of luck trying to achieve this with Windows.

However as you mention it seems that "start" will do the trick (never seen this one before!).

(I must try again to get Ubuntu installed - but that's a complex graphics driver issue I need to resolve in another forum).


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 61 guests