ok, as you say, the errors are from the dirs of files that don't exist. it's because sysoutput is being redirected, not syserror
your error is because you are not quoting the "%1\%%Qa"
and you shouldn't have the a on the end either
i.e. you need "%1\%%Q"
I would be inclined to use the code from my other suggestion, so it's more readable e.g.
Code: Select all
set name=%3
set name=%name:"=%
set dirname=%1
set dirname=%dirname:"=%
for /R %dirname% %%f in (*.avi) do D:\FFmpeg\ffmpeg.exe -y -i "%%f" -f mp4 -vcodec libx264 -level 30 -s 480x272 -r 30000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -threads auto -acodec libfaac -ac 2 -ab 128k "%dirname%\%name%.mp4"
for /R %dirname% %%f in (*.mpg) do D:\FFmpeg\ffmpeg.exe -y -i "%%f" -f mp4 -vcodec libx264 -level 30 -s 480x272 -r 30000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -threads auto -acodec libfaac -ac 2 -ab 128k "%dirname%\%name%.mp4"
etc
(the /R will find stuff even if is not in the top level folder)
you should be aware, that by stating -s 480x272, you are assuming your source is 16:9 which will make anything that is not 16:9 look odd.
I wrote something yesterday that should alleviate that, but "buyer beware", although it seems ok, it's very new code (and it's part of a greater whole, so sorry if I miss anything when I cut the relevant bits out -
Code: Select all
set dirname=%1
set dirname=%dirname:"=%
set name=%3
set name=%name:"=%
set mp4s=C:\TEMP\MP4s
REM convert to iphone format
for /R %dirname% %%f in (*.mkv) do call :iphoneit %%~sf
for /R %dirname% %%f in (*.wmv) do call :iphoneit %%~sf
for /R %dirname% %%f in (*.avi) do call :iphoneit %%~sf
for /R %dirname% %%f in (*.mov) do call :iphoneit %%~sf
GOTO :EOF
:iphoneit
REM don't repeat the exercise
IF EXIST "%mp4s%\%name%.mp4" GOTO :EOF
REM work out the aspect ratio
"f:\Program Files\MPlayer\mplayer.exe" -identify -frames 0 -vo null -ao null "%1" | find "ID_" > t.tmp
c:\uutils\sed15.exe -e "s/^/set /" -e "s/\"//g" < t.tmp > ID.bat
CALL ID.bat
DEL ID.bat
SET vw=480
SET /A ratio=%ID_VIDEO_WIDTH%*1000/%ID_VIDEO_HEIGHT%
SET /A vh=%vw%*1000/%ratio%
"F:\Program Files\ipodvidconverter\tools\ffmpeg\ffmpeg.exe" -y -i "%1" -f mp4 -vcodec mpeg4 -level 30 -s %vw%x%vh% -r 30000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -threads 4 -acodec libfaac -ac 2 -ab 128k "%mp4s%\%name%.mp4"
CALL cscript d:\user\itunes\addtoitunes.js "%mp4s%"
GOTO :EOF
as you can see, you will need mplayer which is freely available.