Video Encoding for the Zune


Since I’m working on a 4.5 year old PC at home, I find the automatic Zune video transcoding a bit slow. I was able to figure out some Zune compatible settings for Windows Media Encoder and I’ve tweaked them to run a bit faster (probably at the expense of some quality.) I’m working on an app that will monitor my video podcast folder and automatically fire up WME to encode the videos, but for now, all I have is a batch file.


pushd .
c:\
cd “\program files\windows media components\encoder\”
cscript wmcmd.vbs -a_codec WMA9STD -a_setting 128_44_2 -v_bitrate 600000 -v_width 320 -v_height 240  -v_codec WMV9 -v_framerate 29.97 -v_mode 0  -input %1 -output %1.wmv
popd

I tracked down these settings from the Zune media provider page. Some of them can be tweaked like the audio and video bit rates and codecs. The width and height must either be 320×240 or 320×180. Play around with it and find something that works well for you. I’ll post my monitoring application if I ever get it working to my satisfaction.


The video coming out of this batch file looks great and it encodes almost in real time (on a P4 2.4GHz with 1GB DDR RAM.) Someday I’ll have that shiny new quad core machine and I’ll fly through the video transcoding.


[UPDATE] Removed an extra quotation mark at the end of the cscript command.


[UPDATE 1/4/07] Don’t hold your breath waiting for that automatic encoding program I mention in this post. I got my new machine and the automatic Zune transcoding flies. I have Doppler set up to pull down all my podcasts and then the Zune software watches those folder and transcodes in the background.

zune_wme.bat

Comments (7)

  1. Anonymous says:

    You don’t need to do the CD or the drive change.

    Just PushD "C:Program Files…"

  2. Anonymous says:

    This works great. Thought I would pass along one change I made.

    I strip off the file extension for the output name like so -output %~dpn1.wmv

    %~dpn1 resolves to Drive letter, Path, and Filename of the %1 variable.

    your outputfile will be

    outputfile.wmv

    instead of

    outputfile.mpg.wmv

    Thanks for the info.

  3. blehmann says:

    Thanks for the great info. I am a complete and total newb at this, so thank you for your patience and understanding with this post.

    I can follow the commands, but I don’t see where to enter the file names I want to encode. Also,what seperator do I use between them?

    Thank you for helping in my ongoing education.

  4. Ben Martens says:

    blehmann –

    The %1 in the script is the variable for the first argument in the command line. The easiest way to use it is to save that whole series of commands as a batch file (ie. encoder.bat). Then open up Windows Explorer and navigate to the directory where encoder.bat is located. Drag your movie file onto the batch file and it should fire up.

    The other way to do it is to open a command prompt and navigate to the folder where encoder.bat is located. Type: encoder "c:my movie.avi"  Make sure you put the full path to the movie file and you’ll need quotes around the file name if it has spaces in it.

    Feel free to post more comments if this doesn’t work. Good luck!

  5. Anonymous says:

    Thanks for the help. I just realized that you were using a variable to encode your podcasts with unknown names. I was looking for a batch encoder for files that I already have. This should work perfectly. Thanks again.

  6. Anonymous says:

    Just stumbled across this post. I’m not sure if it will help or if the Zune plays xvid files but have a look at a post I did a little while ago about a similar topic for my Archos player.

    It includes a fairly complicated batch file but I did my  best to comment it along the way.

    http://www.techlifeweb.com/2007/04/how-to-convert-ipod-video-to-divx-or.html

    Cheers

  7. Anonymous says:

    Recently, I managed to get my hands on a black 80GB Zune player (Thanks to Chewy) and I was trying to

Skip to main content