Automatic Media Conversion (Ipod / Iphone)
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
my mistake, in the for, you need to quote "%dirname%"
Re: Automatic Media Conversion (Ipod / Iphone)
Perfect, cheers
- pieteckhart
- Release Testers
- Posts: 131
- Joined: April 30th, 2008, 9:34 am
- Location: Netherlands
- Contact:
Re: Automatic Media Conversion (Ipod / Iphone)
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 "%dirname%\%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 "%dirname%\%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 "%dirname%\%name%.mp4"
i put ffmpeg.exe inside C:\Windows\System32\ so i can use from anywhere in my system
thanks for posting this!
Last edited by pieteckhart on December 24th, 2008, 6:41 am, edited 1 time in total.
SABnzbd+ Windows 7 Gadget
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
Manage your downloads from your desktop.
Download: http://eckhart.hopto.org/sabgadget/sabgadget2.gadget
Site: http://eckhart.hopto.org/sabgadget/
Re: Automatic Media Conversion (Ipod / Iphone)
Awesome script! Thanks for this. Any chance of getting something similar to join *.ts files?
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
I've never done that. what's the command? justRXP wrote: Awesome script! Thanks for this. Any chance of getting something similar to join *.ts files?
copy filea.ts+file2.ts+file3.ts all.ts
?
Re: Automatic Media Conversion (Ipod / Iphone)
This is a highly useful thread
One quick comment/request - any way to add a simple command to delete the original file once ipod conversion is complete via ffmpeg?
Thanks in advance!
One quick comment/request - any way to add a simple command to delete the original file once ipod conversion is complete via ffmpeg?
Thanks in advance!
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
just by chance, I downloaded a multi-part ts last night, so this is what you need to join them -RXP wrote: Awesome script! Thanks for this. Any chance of getting something similar to join *.ts files?
Code: Select all
set name=%3
set name=%name:"=%
set dirname=%1
set dirname=%dirname:"=%
copy /B "%dirname%\*.ts" "%dirname%\temp.newts" && del /q "%dirname%\*.ts" && rename "%dirname%\temp.newts" "%name%.ts"
I imagine there are other progs out there to do this, but this is how i'd do it using built-in commands.
Last edited by doubledrat on December 27th, 2008, 9:19 am, edited 1 time in total.
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
I would think sticking this on the end of the "for" lines would workjl0810 wrote: This is a highly useful thread
One quick comment/request - any way to add a simple command to delete the original file once ipod conversion is complete via ffmpeg?
Thanks in advance!
Code: Select all
&& del %%f
Re: Automatic Media Conversion (Ipod / Iphone)
Thanks - think thats going to work. Testing now but FFMPEG take a while on my pentitum 4. This may be slightly off topic but if I wanted to then move the converted mp4 file say to a dedicated directory ("C:\ConvertedVids"), is that easy as well?
Re: Automatic Media Conversion (Ipod / Iphone)
that should be possible also.
Have a look here : http://forums.sabnzbd.org/index.php?topic=61.0
In this script it moves the files after joining is done
Have a look here : http://forums.sabnzbd.org/index.php?topic=61.0
In this script it moves the files after joining is done
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
easier to create the mp4 in that directory. just replace the %dirname% at the end of the ffmpeg line with your directory. will even speed up the process if it's on another hard drivejl0810 wrote: Thanks - think thats going to work. Testing now but FFMPEG take a while on my pentitum 4. This may be slightly off topic but if I wanted to then move the converted mp4 file say to a dedicated directory ("C:\ConvertedVids"), is that easy as well?
Re: Automatic Media Conversion (Ipod / Iphone)
Good info. I was happy with the new script, but had some trouble tweaking the values of ffmpeg to give me a "universal" video that would work on my ipod and apple tv - at a high quality level. So i switched out FFMPEG for Handbrake CLI and used the universal settings. So if you're interested in Handbrake (I'm a huge fan), you just need to download the Handbrake CLI, and use this in place of the FFMPEG command in the For lines
HandBrakeCLI.exe -i "%%f" -o "%dirname%\%name%.mp4" -e x264 -q 0.589999973773956 -a 1,1 -E faac,ac3 -B 160,auto -R 48,Auto -6 dpl2,auto -f mp4 -X 720 -P -m -x level=30:cabac=0:ref=3:mixed-refs=1:analyse=all:me=umh:no-fast-pskip=1
I've only tested once so don't expect anything too flawless quite yet
HandBrakeCLI.exe -i "%%f" -o "%dirname%\%name%.mp4" -e x264 -q 0.589999973773956 -a 1,1 -E faac,ac3 -B 160,auto -R 48,Auto -6 dpl2,auto -f mp4 -X 720 -P -m -x level=30:cabac=0:ref=3:mixed-refs=1:analyse=all:me=umh:no-fast-pskip=1
I've only tested once so don't expect anything too flawless quite yet
Re: Automatic Media Conversion (Ipod / Iphone)
Awesome! Thank you so much. I tried the script last night and it works, but only one problem - it joined every single ts file in my download directory into one big file lol. Anyway to only get it to process the file that's been downloaded?doubledrat wrote:just by chance, I downloaded a multi-part ts last night, so this is what you need to join them -RXP wrote: Awesome script! Thanks for this. Any chance of getting something similar to join *.ts files?
this should join the files into a new one. delete the old ones and rename the new one. (the && means only do the next command if the previous one succeeded)Code: Select all
set name=%3 set name=%name:"=% set dirname=%1 set dirname=%dirname:"=% copy /B "%dirname%\*.ts" "%dirname%\temp.newts" && del /q "%dirname%\*.ts" && rename "%dirname%\temp.newts" "%name%.ts"
I imagine there are other progs out there to do this, but this is how i'd do it using built-in commands.
-
- Release Testers
- Posts: 180
- Joined: February 20th, 2008, 3:16 pm
Re: Automatic Media Conversion (Ipod / Iphone)
you'll need to get sabnzbd to create a new directory for every item it downloads, otherwise there's no real way of knowing what files relate to the download! It's easy to do...
Awesome! Thank you so much. I tried the script last night and it works, but only one problem - it joined every single ts file in my download directory into one big file lol. Anyway to only get it to process the file that's been downloaded?
sorry, I assumed that's what you'd be doing!
Re: Automatic Media Conversion (Ipod / Iphone)
Well I do, but with Sab's TV sorting option enabled it extracts it to a single folder. I guess I'll just manually add a category for ts files.
And it wasn't your fault, just glad I finally have a solution to joining ts files, been wanting one for like 2 years now!
And it wasn't your fault, just glad I finally have a solution to joining ts files, been wanting one for like 2 years now!