Update of /cvsroot/freevo/freevo/src/video/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv8958
Modified Files:
mplayer.py
Log Message:
add MPLAYER_AUTOCROP
Index: mplayer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/video/plugins/mplayer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mplayer.py 27 Jul 2003 17:12:37 -0000 1.6
--- mplayer.py 2 Aug 2003 16:21:40 -0000 1.7
***************
*** 21,24 ****
--- 21,27 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.7 2003/08/02 16:21:40 dischi
+ # add MPLAYER_AUTOCROP
+ #
# Revision 1.6 2003/07/27 17:12:37 dischi
# exception handling
***************
*** 173,177 ****
import time, os
import threading, signal
! import traceback
import config # Configuration handler. reads config file.
--- 176,180 ----
import time, os
import threading, signal
! import traceback, popen2
import config # Configuration handler. reads config file.
***************
*** 368,373 ****
command = mpl + ' "' + filename + '"'
command=vop_append(command)
!
if plugin.getbyname('MIXER'):
plugin.getbyname('MIXER').reset()
--- 371,399 ----
command = mpl + ' "' + filename + '"'
+ if config.MPLAYER_AUTOCROP and command.find('crop=') == -1:
+ (x1, y1, x2, y2) = (1000, 1000, 0, 0)
+ child = popen2.Popen3(vop_append('./runapp %s -ao null -vo null ' \
+ '-ss 60 -frames 20 -vop cropdetect' % \
+ command), 1, 100)
+ exp = re.compile('^.*-vop crop=([0-9]*):([0-9]*):([0-9]*):([0-9]*).*')
+ while(1):
+ data = child.fromchild.readline()
+ if not data:
+ break
+ m = exp.match(data)
+ if m:
+ x1 = min(x1, int(m.group(3)))
+ y1 = min(y1, int(m.group(4)))
+ x2 = max(x2, int(m.group(1)) + int(m.group(3)))
+ y2 = max(y2, int(m.group(2)) + int(m.group(4)))
+
+ if x1 < 1000 and x2 < 1000:
+ command = '%s -vop crop=%s:%s:%s:%s' % (command, x2-x1, y2-y1, x1,
y1)
+
+ child.wait()
+
+
command=vop_append(command)
!
if plugin.getbyname('MIXER'):
plugin.getbyname('MIXER').reset()
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog