DV Info Net

DV Info Net (https://www.dvinfo.net/forum/)
-   What Happens in Vegas... (https://www.dvinfo.net/forum/what-happens-vegas/)
-   -   how to BATCH ffmpeg in DOC command prompt (https://www.dvinfo.net/forum/what-happens-vegas/510043-how-batch-ffmpeg-doc-command-prompt.html)

Marius Boruch August 16th, 2012 02:44 PM

how to BATCH ffmpeg in DOC command prompt
 
I have problems with BATCH function in ffmpeg; here is what I use for single file and it works OK

VIDEO OK
ffmpeg -i c:\a\videos\358_5308_01.mxf -vcodec copy -acodec copy -y c:\a\converted\358_5308_01conv.m2t
AUDIO OK
ffmpeg -i c:\a\videos\358_5308_01.mxf -map 0:0 -vcodec copy -map 0:1 -acodec copy -y c:\a\converted\358_5308_01conv.wav

but for BATCH conversion I found this script online (all mxf files and ffmpeg are in c:\ location) but the script shows "%%a was unexpected at this time" error message.

for %%a in ("*.mxf") do ffmpeg.exe -i "%%a" -vcodec copy -acodec copy -y "%%~na_conv.m2t"

there must be some easy trick to make this BATCH thing work in DOS. Please help.

Chris Medico August 16th, 2012 04:10 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
Give this a read and see if it helps.

How to Batch Convert with FFmpeg in Windows - The Back Room

Marius Boruch August 16th, 2012 04:22 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
thanks but it produces same error: "%%i was unexpected at this time"

I am not sure it is for DOS

Chris Medico August 16th, 2012 04:29 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
Right click the "ffmpeg.exe" file, select properties and make sure sure you have it "unblocked".

Win7 blocks exe files that don't have a security certificate embedded within.

Chris Medico August 16th, 2012 04:36 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
Also take a read of this and see if it help.

How To: Setup and Use ffmpeg on Windows

Marius Boruch August 16th, 2012 04:36 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
Chris, where to find "unblock" option?

Marius Boruch August 16th, 2012 04:59 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
I did "unblock" function but still same error

Chris Medico August 16th, 2012 05:00 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
Bummer. I'm running out of ideas. I wonder if your antivirus software is causing a conflict.

I can run batches of files here on my machine and its a Win7 64bit setup.

Marius Boruch August 16th, 2012 05:06 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
can you provide simple syntax of running batch?
it runs single conversions OK but there is some catch in syntax of the loop

Chris Medico August 16th, 2012 05:31 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
The info you need is here:

forfiles dos and windows command lne help

With Win7 you need to use the "forfiles" command. I don't have my scripts handy. Looks like I wiped them out in the last bit of drive cleaning I did.

Martin Smith December 23rd, 2012 10:09 AM

Re: how to BATCH ffmpeg in DOC command prompt
 
Theres a really good free script based encoder (front end)/(back end) for ffmpeg and x264 over at EZEncoder An awesome ffmpeg based encoder that does it all Its free and can do all sorts of conversions and is all drag n drop.

Roberto Diaz December 23rd, 2012 10:45 PM

Re: how to BATCH ffmpeg in DOC command prompt
 
I think you have to use %%a if you have this in a .bat file, but if you are typing this on the command line, then use just %a.

Jon Shohet December 24th, 2012 07:41 AM

Re: how to BATCH ffmpeg in DOC command prompt
 
Here's a script that works for me : (in this case remux flv to mp4 but you can change of course to whatever ffmpeg option you want)

I put all the files I want to batch convert into a single folder. Then I drag and drop this .bat file onto a dos window :

for /r %1 %%z in (*.flv) do (
ffmpeg -i "%%z" -vcodec copy -acodec copy "%%~dpnz.mp4"
)

Then I press the "space" key once in the dos window, and then drag and drop the folder containing my files onto to the same dos window, and hit "enter".
command line should read something like this :

C:\Users\user>"C:\pathToScript\script.bat" "C:\pathToFolder\folderWithFilesToEncode"

This script assumes ffmpeg is in system32 folder or has been manually added to PATH


All times are GMT -6. The time now is 09:47 PM.

DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network