• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged mobile

Windows> Batch convert video with Handbrake

May13
2011
Written by Scott Rowley

The following code is setup for use with a Nook Color, but you could change the resolution for use with other devices as well. If you have any that you find work well for you please post them in the comments and I will extend the article.

First off, if you don’t already have it you obviously need Handbrake

Thanks to RedShirt for the original code.
handbrake_nook.bat

:: http://www.sudobash.net?p=594
:: Nook Color
@echo off
FOR /F "tokens=*" %%G IN ('DIR "%~1" /B /S /A:-d') do (
FOR /F "tokens=*" %%H IN ('DIR "%%G" /B /A:-d') do (
:: This assumes you have the default install location on Windows 7.
"C:\Program Files (x86)\Handbrake\HandBrakeCLI" -e x264 -2 -b 702 -a 1 -E faac -B 48 -6 mono -R Auto -D 0.0 -f mp4 -I -X 854 -m -x level=30:cabac=0:ref=1:analyse=all:me=umh:no-fast-pskip=1:psy-rd=0,0:bframes=0:weightp=0:subme=6:8x8dct=0:trellis=0 -D 1.5 -i "%%G" -o "C:\Users\YOUR_LOGIN_NAME\Videos\transcode\%%H-NOOK.mp4"
)
)

handbrake_kfire.bat

:: http://www.sudobash.net?p=594
:: Kindle Fire
@echo off
FOR /F "tokens=*" %%G IN ('DIR "%~1" /B /S /A:-d') do (
FOR /F "tokens=*" %%H IN ('DIR "%%G" /B /A:-d') do (
:: This assumes you have the default install location on Windows 7.
"C:\Program Files (x86)\Handbrake\HandBrakeCLI" -e x264 -2 -b 702 -a 1 -E faac -B 48 -6 mono -R Auto -D 0.0 -f mp4 -I -X 1024 -m -x level=30:cabac=0:ref=1:analyse=all:me=umh:no-fast-pskip=1:psy-rd=0,0:bframes=0:weightp=0:subme=6:8x8dct=0:trellis=0 -D 1.5 -i "%%G" -o "C:\Users\YOUR_LOGIN_NAME\Videos\transcode\%%H-FIRE.mp4"
)
)

Make sure the entire command is all on one line with no line breaks or wrapping or this will not work. Don’t forget to change your destination directory to reflect your own login name. Also make sure that the entire destination path exists (by creating the “transcode” directory). Don’t worry about “Videos”, Windows sees that the same as “My Videos”.

Note: This code references the (x86) Program Files. If you are not running 64 bit then this will not be an accurate location:
Untested — Remove ” (x86)” for use on non 64-bit Windows

Now, you can either place the batch file wherever you like and then run it from the command line like so:
handbrake_nook.bat

Or you can run the bat file right from the same directory the video files are in and supply no directory, such as:
handbrake_nook.bat

To Do: Have a nightly check to see if there are any files in the selected directory. If so — convert them and then move the originals to another folder.

Posted in Windows - Tagged bat, batch, color, convert, handbrake, kindle, kindle fire, nook, transcode, Windows

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top