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.
This was a great help to me. I was looking for Handbrake command line settings for the Nook Color, but the batch functionality is icing on the cake. Thanks for posting this.
Suh-weet! Glad it worked out well for you and thanks for the feedback!
Thanks for the hints. I spent several hours last week tinkering with it and trying to the proper settings to use to export something I edited from Sony Vegas for my Nook Color. Being able to simple export a Youtube-able MP4 and then convert it for Nook in Handbrake will be AWESOME! Thumbs up, my good man!
Awesome! Glad it worked out well for you and thanks for the feedback!
Hi,
Thanks for this batch.I modified it and use it to encode my.mov files to .mkv files, fore play on my pc..
But i have an issue: The new file name keep the old extension of source file name (video.mov.mkv).
How can i avoid that ? (I want a video.mkv).
I’ve been meaning to transcode a couple of movies, this will give me an excuse to and I’ll check it out and get back to you.
thanks
Hi,
Something about my request ?
Thanks
I found, it works by adding ~n between the %% and the H :
“%%~nH”
Bye
Ah, excellent. Sorry I couldn’t get back to you or conduct my test. Been uber busy. Thanks for posting your solution as well!