ffmpeg and python big problem

Emile van Sebille emile at fenx.com
Fri May 22 16:13:22 EDT 2009


On 5/22/2009 11:38 AM Rhodri James said...
> On Fri, 22 May 2009 13:54:26 +0100, TerabyteST <gabrycir at gmail.com> wrote:
<snip>
>> @Emile: if I can access MEncoder from python and give it the images
>> one by one, using a stream like i'm doing in ffmpeg, or telling it a
>> sequence to make a video from, I could try it.
> 

Here's the relevant code I'm using.  You can follow by mencoder's 
argument options what everything is, but essentially it expects that the 
images are collected in stillsdir, sub-titles are in srtfn, sub-title 
font in fontfn and then it creates the movie tmpfile, and if successful, 
renames it avifile.

HTH,

Emile

---------
cmdstr = '/usr/local/bin/mencoder mf://%s/*.jpg -mf 
type=jpg:w=640:h=480:fps=%d -fps %d -ofps %d -s
ub %s -font %s -vf pp=hb/vb -ovc lavc -lavcopts 
vcodec=msmpeg4v2:vbitrate=%d -oac copy -quiet -o "%s" && mv -f
  "%s" "%s"' % 
(stillsdir,FPS,FPS,FPS,srtfn,fontfn,vkbps,tmpfile,tmpfile,avifile)
print "generating movie %s from %s/" % (avifile,stillsdir)
print cmdstr
results = commands.getstatusoutput(cmdstr)
print results


> You seem to have emailed me directly, not the list.  I've copied this
> back to the list so Emile can see it too.

Thanks Rhodri -- Emile





More information about the Python-list mailing list