Below is a rather simple python script. It makes heavy use of hard-coding when it shouldn't. The motivation of this script was to have a simple, easy way to batch convert videos while still giving me direct control over mencoder arguments. More precisely, I couldn't some videos to work with ffmpegx and found some things annoying to do in ffmpegx. This script makes use of two threads because my own testing shows that to be faster than one. This may not be true for you (but probably is if you have 2 cpus). You could just use an argument to tell mencoder to use multiple CPUs, but different pieces of the image are worked on separately when you do this so you might lose a tad of quality. The script should be relatively easy for you to modify whether or not you know Python, though you'll need python if you want to be able to run it. As written, this script will convert videos named cluster#.flv to videos named cluster#.avi. It uses a separate thread fo 10-17 and 18-25. I used the copy of mencoder found at http://prdownloads.sourceforge.net/mplayerosx/ffmpegXbinaries20060307.zip
Take note that this script was mostly written for me and I didn't make it clean or have it use command line arguments. Eventually I might do something smarter but right now it's just one that is modified at need. I even left in some module imports that are not being used. That said, it might save a few people some work. If anybody ends up making use of this in some way, a quick post (unless people already responded to this thread to say so) about it is appreciated just so I'll know I didn't waste my time posting it here.
Code:#! /usr/bin/env python import re,urllib,os, threading,time,random class MyThread ( threading.Thread): def __init__ (self, starti, endi): self.starti=starti self.endi=endi+1 threading.Thread.__init__(self) def run( self): for a in xrange(self.starti, self.endi): os.spawnvp(os.P_WAIT,'./mencoder', ['mencoder',] + ['Cluster/cluster'+str(a)+'.flv',]+ ['-o'] + ['cluster'+str(a)+'.avi'] + '-oac mp3lame -lameopts abr:br=92 -srate 22050 -ovc xvid -xvidencopts bitrate=150'.split()) MyThread(10,17).start() MyThread(18,25).start()
+ Reply to Thread
Results 1 to 1 of 1
Similar Threads
-
Best all round tool to convert video formats, basic editing, etc.
By ian_g in forum Video ConversionReplies: 9Last Post: 16th Mar 2011, 05:21 -
Star Trek meets Monty Python
By freebird73717 in forum Off topicReplies: 0Last Post: 15th Sep 2009, 08:45 -
Unhandled exception error mencoder convert opendivx video - How to solve?
By melaos in forum Newbie / General discussionsReplies: 1Last Post: 8th Jul 2009, 04:43 -
ASAP! anyone has ASP script for uploading video and direct convert to .FLV?
By badsectors in forum Video Streaming DownloadingReplies: 0Last Post: 29th Oct 2008, 21:06 -
How to convert 16:9 to 4:3 using mencoder?
By sektionschef in forum Video ConversionReplies: 3Last Post: 11th Oct 2007, 14:41