Re: Automatic Media Conversion (Ipod / Iphone)
Posted: May 18th, 2009, 11:41 am
your fix didn't work because the FFMPEG is done on all files in the directory BEFORE it does the tagging. doing something like this should work thoughbnb wrote: I just got an iphone finally, and this thread has been great. I am not very good with scripts, so its taken me hours of reading through this thread and I sort of understand it, but I am having a looping issue on the batch file I made. Could someone take a look at mine for me?
I just added in:Code: Select all
set name=%3 set name=%name:"=% set dirname=%1 set dirname=%dirname:"=% for /R "%dirname%" %%f in (*.avi) do 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 -acodec libfaac -ac 2 -ab 128k "g:\iphone tv\%name%.mp4" && CALL :tagTVshow "g:\iphone tv\%name%.mp4" for /R "%dirname%" %%f in (*.mkv) do 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 -acodec libfaac -ac 2 -ab 128k "g:\iphone tv\%name%.mp4" && CALL :tagTVshow "g:\iphone tv\%name%.mp4" for /R "%dirname%" %%f in (*.wmv) do 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 -acodec libfaac -ac 2 -ab 128k "g:\iphone tv\%name%.mp4" && CALL :tagTVshow "g:\iphone tv\%name%.mp4" :tagTVshow REM split down into component parts FOR /F "TOKENS=1-3 DELIMS=-" %%a in ("%name%") DO set show="%%a" FOR /F "TOKENS=1-3 DELIMS=-" %%a in ("%name%") DO set seasXep="%%b" FOR /F "TOKENS=1-3 DELIMS=-" %%a in ("%name%") DO set eptitle="%%c" REM clean up leading or trailing spaces SET eptitle=%eptitle:" =% SET eptitle=%eptitle: "=% SET eptitle=%eptitle:"=% SET show=%show:" =% SET show=%show: "=% SET show=%show:"=% REM remove all spaces (and quotes) SET seasXep=%seasXep:"=% SET seasXep=%seasXep: =% REM split down the season and episode number FOR /F "TOKENS=1-2 DELIMS=xX" %%a in ("%seasXep%") DO set season=%%a FOR /F "TOKENS=1-2 DELIMS=xX" %%a in ("%seasXep%") DO set episode=%%b REM now tag the file with this information for iTunes %AtomicParsley% "g:\iphone tv\%name%.mp4" --overWrite --title "%eptitle%" --genre "TV Shows" --stik "TV Show" --TVShowName "%show%" --TVEpisodeNum %episode% --TVSeason %season% REM don't repeat the exercise IF EXIST "g:\iphone tv\%name%.mp4" GOTO :EOF call cscript "c:\program files\sabnzbd\scripts\itunesupdate.js" "g:\iphone tv" curl.exe --get "http://192.168.1.103/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)" GOTO :EOF
REM don't repeat the exercise
IF EXIST "g:\iphone tv\%name%.mp4" GOTO :EOF
But I obviously didn't do it right, b/c it is doing the same thing.
It loops at this part:
C:\Program Files\SABnzbd>curl.exe --get "http://192.168.1.103/xbmcCmds/xbmcHttp? ... ary(video)"
This version of C:\Program Files\SABnzbd\curl.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.
C:\Program Files\SABnzbd>GOTO :EOF
C:\Program Files\SABnzbd>ffmpeg.exe -y -i "g:\tv\South Park\Season 13\South Park - S13E05 - Fishsticks.avi" -f mp4 -vcodec libx264 -level 30 -s 480x272 -r 30000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -acodec libfaac -ac 2 -ab 128k "g:\iphone tv\South Park - 13x04 - Eat, Pray, Queef.mp4" && CALL :tagTVshow "g:\iphone tv\South Park - 13x04 - Eat, Pray, Queef.mp4"
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --enable-postproc --enable-swscale --enable-gpl --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libxvid --enable-libx264 --disable-ffserver --disable-ffplay --enable-avisynth --enable-libdirac --enable-libschroedinger --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-libspeex --enable-libopenjpeg --enable-small --disable-decoder=aac --extra-cflags=-mtune=generic -fno-common -I/usr/local/include --extra-ldflags=-L/usr/local/lib
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 13 2009 23:50:16, gcc: 4.3.3
And starts ffmpeg again. It probably has something to do with the GOTO :EOF commands, but I'm not sure how to implement those.
Here is the output:
http://pastebin.com/m4f69a59a
Thanks again.
Code: Select all
for /R "%dirname%" %%f in (*.avi) do call :mpegit "%%f"
.
.
.
GOTO :EOF
:mpegit
ffmpeg.exe -y -i %1 -f mp4 -vcodec libx264 -level 30 -s 480x272 -r 30000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -acodec libfaac -ac 2 -ab 128k "g:\iphone tv\%name%.mp4" && CALL :tagTVshow "g:\iphone tv\%name%.mp4"
GOTO :EOF
:tagTVshow
REM split down into component parts
FOR /F "TOKENS=1-3 DELIMS=-" %%a in ("%name%") DO set show="%%a"
FOR /F "TOKENS=1-3 DELIMS=-" %%a in ("%name%") DO set seasXep="%%b"
.
.