Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Freevo Wiki" for change 
notification.

The following page has been changed by James Simmons:
http://freevo.sourceforge.net/cgi-bin/moin.cgi/TipsAndTricks

------------------------------------------------------------------------------
@@ -143,6 +143,47 @@
 
 mammique.
 
+A slightly enhanced version of the above linked script:
+
+{{{
+ #!/usr/local/freevo-1.5.0/runtime/apps/freevo_python
+
+ import sys, os, mmpython, glob
+ from stat import *
+
+ args = sys.argv[1:len(sys.argv)]
+ print "What percentage into the clip should the screenshot be taken?"
+ percent = sys.stdin.readline()
+ convert = float(percent) / 100.0
+
+ for file in args:
+    try:
+        position = str(mmpython.parse(file).video[0].length * convert)
+    except:
+        # else arbitrary consider that file is 1Mbps and grab position at 10%
+        position = str((os.stat(file)[ST_SIZE]/1024/1024) * convert)
+    
+    mplayer_in, mplayer_out, mplayer_err = \
+                os.popen3(('mplayer', '-nosound',
+                           '-vo', 'jpeg',
+                           '-frames', '8',
+                           '-ss', position,
+                           '-vop', 'scale=240:-2', file))
+    mplayer_out.read()
+    captures = glob.glob('000000??.jpg')
+    try:
+        capture = captures[-1:][0]
+        os.rename(capture, os.path.splitext(file)[0] + ".jpg")
+        captures = captures[:-1]
+        print file
+    except: print "error creating capture for %s" % file
+    for capture in captures:
+        try: os.remove(capture)
+        except: print "error removing temporary captures for %s" % file
+}}}
+
+There are three enhancements.  First, the first line is changed to point at the 
runtime version of python, so mmpython can be found if you are using the runtime.  
Second, it prompts you for what percentage into the clip you want your screen capture 
to be taken.  The original script just goes halfway in, which does not always give you 
the thumbnail you want.  Third, it generates JPG's instead of PNG's, which I needed 
because my copy of mplayer was not compiled with PNG support.  Compare both versions 
of the script and you should be able to come up with something that meets your 
thumbnail-generating needs.
+
 == Favourites/Favorites ==
 
 If you find that your favourite programs are not being picked up automatically, you 
need to do one of either of the following two things - either ensure you are picking 
up the xmltv guide info via the command "freevo tv_grab" or you need to run the helper 
script "freevo schedulefavorites" after manually putting the latest TV.xml file in the 
/tmp directory.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Freevo-wikilog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-wikilog

Reply via email to