This image is the top of the content box. Unfortunately, there is no information-based reason for this div to be here. It's just here for design reasons. Sorry.
Go Back   MisticRiver :: For iriver Enthusiasts > iriver (Reigncom) > iRiver HD, CDP's and PMP's > HD DAP's > E10 Series
Home Forums Register FAQ Search Today's Posts Mark Forums Read


Welcome to the misticriver forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: ,

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old April 22nd, 2008, 06:40 AM
Eager Mistic Beaver
 
Join Date: Aug 2005
Posts: 253
mencoder batch encoding script (python)

Hey.
I made a python script for my gentoo linux pc so I could batch encode videos so they are playable on my E10. The script uses mencoder and I thought I would share it in case anyone found it useful by any chance.

If you do use the script you may want to change the OUT_DIR variable/constant so it maps to your E10 mount point. You may also wish to change the scale parameter in the encode string depending on the aspect ratio of the videos you are encoding.


To run the script stick it in a file, e10_converter.py for example.

To run the script type:
python e10_converter.py [file1] [file2] [...]

You can use wildcards obviously:
python e10_converter.py /mnt/video/*


Code:
#!/usr/bin/python
import sys, os

#--------------------------------TWEAKS--------------------------------#
#Path to mencoder
MENCODER = "/usr/bin/mencoder"

#Append postfix to differentiate original and converted video
FILE_POSTFIX="-e10"

#Encoding bitrate
BITRATE = 384

#Output directory for converted videos
OUT_DIR = "/media/E10/Video"
#----------------------------------------------------------------------#

encode = "%s %s -ofps 15 -ovc lavc -oac mp3lame -lameopts cbr:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=%d -srate 44100 -vf scale=128:96,expand=:128 -ffourcc XVID - o %s >& /dev/null"

file_count = len(sys.argv) - 1
for i in range(1, file_count + 1):
	f = sys.argv[i]
	infile = "\"%s\"" % f
	fn = f[f.rfind("/") + 1:]
	fn = fn[0:fn.rfind(".")]
	
	outfile = "\"%s/%s%s.avi\"" % (OUT_DIR, fn, FILE_POSTFIX)
	print "Encoding file: %d of %d" % (i, file_count)
	os.system(encode % (MENCODER, infile, BITRATE, outfile))
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 01:53 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
This image is the bottom of the content box. Unfortunately, there is no information-based reason for this div to be here. It's just here for design reasons. Sorry.