how to BATCH ffmpeg in DOC command prompt at DVinfo.net
DV Info Net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...
Register FAQ Today's Posts Buyer's Guides

What Happens in Vegas...
...stays in Vegas! This PC-based editing app is a safe bet with these tips.

Reply
 
Thread Tools Search this Thread
Old August 16th, 2012, 02:44 PM   #1
Major Player
 
Join Date: Aug 2005
Posts: 421
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.
Marius Boruch is offline   Reply With Quote
Old August 16th, 2012, 04:10 PM   #2
Inner Circle
 
Join Date: Aug 2006
Location: Efland NC, USA
Posts: 2,322
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
__________________
http://www.LandYachtMedia.com
Chris Medico is offline   Reply With Quote
Old August 16th, 2012, 04:22 PM   #3
Major Player
 
Join Date: Aug 2005
Posts: 421
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
Marius Boruch is offline   Reply With Quote
Old August 16th, 2012, 04:29 PM   #4
Inner Circle
 
Join Date: Aug 2006
Location: Efland NC, USA
Posts: 2,322
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.
__________________
http://www.LandYachtMedia.com
Chris Medico is offline   Reply With Quote
Old August 16th, 2012, 04:36 PM   #5
Inner Circle
 
Join Date: Aug 2006
Location: Efland NC, USA
Posts: 2,322
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
__________________
http://www.LandYachtMedia.com
Chris Medico is offline   Reply With Quote
Old August 16th, 2012, 04:36 PM   #6
Major Player
 
Join Date: Aug 2005
Posts: 421
Re: how to BATCH ffmpeg in DOC command prompt

Chris, where to find "unblock" option?
Marius Boruch is offline   Reply With Quote
Old August 16th, 2012, 04:59 PM   #7
Major Player
 
Join Date: Aug 2005
Posts: 421
Re: how to BATCH ffmpeg in DOC command prompt

I did "unblock" function but still same error
Marius Boruch is offline   Reply With Quote
Old August 16th, 2012, 05:00 PM   #8
Inner Circle
 
Join Date: Aug 2006
Location: Efland NC, USA
Posts: 2,322
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.
__________________
http://www.LandYachtMedia.com
Chris Medico is offline   Reply With Quote
Old August 16th, 2012, 05:06 PM   #9
Major Player
 
Join Date: Aug 2005
Posts: 421
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
Marius Boruch is offline   Reply With Quote
Old August 16th, 2012, 05:31 PM   #10
Inner Circle
 
Join Date: Aug 2006
Location: Efland NC, USA
Posts: 2,322
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.
__________________
http://www.LandYachtMedia.com
Chris Medico is offline   Reply With Quote
Old December 23rd, 2012, 10:09 AM   #11
Regular Crew
 
Join Date: May 2007
Location: Orlando, FL
Posts: 66
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.
Martin Smith is offline   Reply With Quote
Old December 23rd, 2012, 10:45 PM   #12
Regular Crew
 
Join Date: Aug 2012
Location: Northwest Chicago, IL
Posts: 61
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.
Roberto Diaz is offline   Reply With Quote
Old December 24th, 2012, 07:41 AM   #13
Major Player
 
Join Date: Dec 2007
Location: London, UK
Posts: 277
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
Jon Shohet is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

B&H Photo Video
(866) 521-7381
New York, NY USA

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...


 



All times are GMT -6. The time now is 01:18 PM.


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