|
|||||||||
|
Thread Tools | Search this Thread |
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. |
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
__________________
http://www.LandYachtMedia.com |
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 |
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 |
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
__________________
http://www.LandYachtMedia.com |
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?
|
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
|
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 |
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 |
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 |
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.
|
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.
|
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 |
| ||||||
|
|