Permalink
Browse files

Añadida comprobacion de MP3LAME

Añadido soporte de tipo de subtitulo en XML (PAL o NTSC)
  • Loading branch information...
1 parent 10c9c33 commit 10ad85e00290503c312acc84641c87a67a4892bd @rastersoft committed Nov 26, 2011
Showing with 301 additions and 145 deletions.
  1. +1 −1 devede.py
  2. +32 −2 devede_convert.py
  3. +54 −13 devede_executor.py
  4. +2 −1 devede_ffmpeg_convert.py
  5. +6 −1 devede_subtitles.py
  6. +1 −1 interface/aboutdialog1.ui
  7. +79 −0 interface/wno_mp3lame.ui
  8. +6 −6 po/ca.po
  9. +6 −6 po/cs_CZ.po
  10. +6 −6 po/da.po
  11. +6 −6 po/de_DE.po
  12. +6 −6 po/el.po
  13. +6 −6 po/es.po
  14. +6 −6 po/fr.po
  15. +6 −6 po/gl.po
  16. +6 −6 po/hu_HU.po
  17. +6 −6 po/it_IT.po
  18. +6 −6 po/nb_NO.po
  19. +6 −6 po/nl.po
  20. +6 −6 po/pl.po
  21. +6 −6 po/pt_BR.po
  22. +6 −6 po/pt_PT.po
  23. +6 −6 po/ru.po
  24. +6 −6 po/sk.po
  25. +6 −6 po/sv.po
  26. +6 −6 po/untitled.pot
  27. +6 −6 po/zh_CN.po
  28. +6 −6 po/zh_TW.po
View
@@ -34,7 +34,7 @@
import pickle
import cairo
-print "DeVeDe 3.17.1"
+print "DeVeDe 3.19.0"
if (sys.platform!="win32") and (sys.platform!="win64"):
try:
print "Locale: "+str(os.environ["LANG"])
View
@@ -148,6 +148,24 @@ def check_free_space(self,filefolder,structure,actions,erase_temporary_files,sou
else:
return False,""
+ def check_mp3lame(self):
+ runner=devede_executor.executor()
+ runner.launch_program(["ffmpeg","-codecs"],sep_stderr=True,keep_out=True)
+ runner.wait_end2()
+
+ print "Salida "+str(runner.cadena)
+ pos=runner.cadena.find("mp3lame")
+ if (pos==-1):
+ tree=devede_other.create_tree(self,"wno_mp3lame",self.gladefile)
+ w=tree.get_object("nomp3lame")
+ w.show()
+ w.run()
+ w.destroy()
+ self.has_mp3lame=False
+ return False
+ else:
+ self.has_mp3lame=True
+ return True
def __init__(self,gladefile,structure,global_vars,callback):
@@ -164,6 +182,12 @@ def __init__(self,gladefile,structure,global_vars,callback):
self.gladefile=gladefile
self.structure=structure
self.global_vars=global_vars
+
+ self.has_mp3lame=True
+ if (global_vars["disctocreate"]=="divx") and (global_vars["use_ffmpeg"]):
+ if (False==self.check_mp3lame()):
+ return
+
self.tree=devede_other.create_tree(self,"wprogress",self.gladefile)
self.window=self.tree.get_object("wprogress")
@@ -216,6 +240,9 @@ def init_queue(self):
def preview(self,filefolder):
+ if (self.has_mp3lame==False):
+ return
+
self.init_queue()
newtree=devede_other.create_tree(self,"wpreview_dialog",self.gladefile,False)
timev=newtree.get_object("seconds_preview")
@@ -269,6 +296,9 @@ def create_disc(self):
self.time=0
+ if (self.has_mp3lame==False):
+ return
+
# first, check for empty titles
empty=False
@@ -456,7 +486,7 @@ def time_callback(self):
encpass = int(action[0][1])
print "Segundos "+str(self.seconds)
if (self.global_vars["use_ffmpeg"]):
- self.runner=devede_ffmpeg_convert.video_converter(self.global_vars,self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, encpass,self.global_vars["AC3_fix"])
+ self.runner=devede_ffmpeg_convert.video_converter_ffmpeg(self.global_vars,self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, encpass,self.global_vars["AC3_fix"])
else:
self.runner=devede_video_convert.video_converter(self.global_vars,self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, encpass,self.global_vars["AC3_fix"])
return True
@@ -465,7 +495,7 @@ def time_callback(self):
title=action[1]
chapter=action[2]
if (self.global_vars["use_ffmpeg"]):
- self.runner=devede_ffmpeg_convert.video_converter(self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, 2,self.global_vars["AC3_fix"])
+ self.runner=devede_ffmpeg_convert.video_converter_ffmpeg(self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, 2,self.global_vars["AC3_fix"])
else:
self.runner=devede_video_convert.video_converter(self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, 2,self.global_vars["AC3_fix"])
return True
View
@@ -47,18 +47,25 @@ def __init__(self,filename=None,filefolder=None,progresbar=None):
self.initerror=False
self.handle=None
+ self.cadena=""
+ self.err_cadena=""
+ self.sep_stderr=False
+ self.platform_win32=((sys.platform=="win32") or (sys.platform=="win64"))
+ self.print_error="Undefined error"
+ self.keep_output=False
if filename!=None:
self.bar=progresbar
if progresbar!=None:
progresbar.set_text(" ")
self.filefolder=filefolder
self.filename=filename
- self.platform_win32=((sys.platform=="win32") or (sys.platform=="win64"))
- self.cadena=""
self.printout=True
- self.print_error="Undefined error"
-
+ else:
+ self.bar=None
+ self.filename=None
+ self.filefolder=None
+ self.printout=True
def cancel(self):
@@ -84,6 +91,19 @@ def wait_end(self):
self.handle.wait()
return self.handle.returncode
+
+
+ def wait_end2(self):
+
+ r1,r2=self.handle.communicate()
+ self.cadena=r1
+ if (self.sep_stderr):
+ self.err_cadena=r2
+ else:
+ self.cadena+=r2
+ if (self.printout):
+ print r1,
+ print r2,
def launch_shell(self,program,read_chars=80,output=True,stdinout=None):
@@ -142,13 +162,16 @@ def launch_shell(self,program,read_chars=80,output=True,stdinout=None):
return None
- def launch_program(self,program,read_chars=80,output=True,win32arg=True,with_stderr=True):
+ def launch_program(self,program,read_chars=80,output=True,win32arg=True,with_stderr=True, sep_stderr=False,keep_out=False):
""" Launches a program that can be located in any of the directories stored in PATHLIST """
self.read_chars=read_chars
self.output=output
self.handle=None
+
+ self.sep_stderr=sep_stderr
+ self.keep_output=keep_out
wd=sys.path[-1:] # working directory. This works with py2exe
if (sys.platform=="win32") or (sys.platform=="win64"):
@@ -203,28 +226,36 @@ def refresh(self):
return -1 # there's no program running
if self.output==False: # if we don't want to read the output...
- self.bar.pulse() # just PULSE the progress bar
+ if (self.bar!=None):
+ self.bar.pulse() # just PULSE the progress bar
if self.handle.poll()==None:
return 0 # if the program didn't end, return 0
else:
return 1 # and 1 if the program ended
ret_value=1
- v1=[]
while self.handle.poll()==None:
+ ret_value=0
if self.read_line_from_output():
- ret_value=0
break
if (self.set_progress_bar()): # progress_bar is defined in each subclass to fit the format
self.cadena=""
if ret_value==1: # read what remains in the STDOUT and STDERR queues
- while self.read_line_from_output():
- tmp=1
+ r1,r2=self.handle.communicate()
+ self.cadena+=r1
+ if (self.sep_stderr):
+ self.err_cadena+=r2
+ else:
+ self.cadena+=r2
+ if (self.printout):
+ print r1,
+ print r2,
return ret_value # 0: nothing to read; 1: program ended
+
def read_line_from_output(self):
if self.platform_win32:
@@ -238,13 +269,19 @@ def read_line_from_output(self):
for element in v1:
if (sys.platform=="win32") or (sys.platform=="win64"):
readed = element#[0,self.read_chars]
- self.cadena+=readed
+ if (self.sep_stderr) and (element==self.handle.stderr):
+ self.err_cadena+=readed
+ else:
+ self.cadena+=readed
if (self.printout) or (element==self.handle.stderr):
print readed,
break # this break statement and setting the priority lower in launch_program makes devede work a lot better on windows
else:
readed=element.readline(self.read_chars)
- self.cadena+=readed
+ if (self.sep_stderr) and (element==self.handle.stderr):
+ self.err_cadena+=readed
+ else:
+ self.cadena+=readed
if (self.printout) or (element==self.handle.stderr):
print readed,
@@ -256,7 +293,11 @@ def set_progress_bar(self):
# By default, just do nothing
if self.filename!=None:
self.bar.pulse()
- return True
+
+ if self.keep_output:
+ return False
+ else:
+ return True
def create_filename(self,filename,title,file,avi):
View
@@ -34,7 +34,8 @@
if (sys.platform == "win32") or (sys.platform=="win64"):
import win32file
-class video_converter(devede_executor.executor):
+
+class video_converter_ffmpeg(devede_executor.executor):
def adjust_audiorate(self,audiorate,isdvd):
View
@@ -76,7 +76,12 @@ def __init__(self,videofile,filename,filefolder,progresbar,proglabel,disctype,ti
self.initerror=True
return
- fichero.write('<subpictures>\n\t<stream>')
+ fichero.write('<subpictures format="')
+ if (videofile["fps"]==25) :
+ fichero.write('PAL')
+ else:
+ fichero.write('NTSC')
+ fichero.write('">\n\t<stream>')
if (subtitle_list["sub_codepage"]!="UTF-8"):
final_type="UTF-8"
subfilename=os.path.join(filefolder,filename+"_sub_tmp.sub")
@@ -9,7 +9,7 @@
<property name="icon">devede.svg</property>
<property name="type_hint">normal</property>
<property name="program_name">DeVeDe</property>
- <property name="version">3.18.0</property>
+ <property name="version">3.19.0</property>
<property name="copyright">(C)2006-2011 Raster Software Vigo,
Peter Gill and Gustavo Sanchez</property>
<property name="website">http://www.rastersoft.com/programas/devede.html</property>
View
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <requires lib="gtk+" version="2.24"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkDialog" id="nomp3lame">
+ <property name="width_request">400</property>
+ <property name="height_request">270</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">center</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Your FFMPEG version is compiled
+without MP3LAME support, so
+Devede can't create DivX.</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Recompile your FFMPEG code, or
+install a version with MP3LAME
+support.</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="10">button1</action-widget>
+ </action-widgets>
+ </object>
+</interface>
View
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ca\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-11-26 00:21+0100\n"
+"POT-Creation-Date: 2011-11-26 14:53+0100\n"
"PO-Revision-Date: 2010-01-26 21:49+0100\n"
"Last-Translator: Joan Farrerons <jfarrerons@economistes.com>\n"
"Language-Team: catala <ca@li.org>\n"
@@ -52,8 +52,8 @@ msgstr ""
"No hi ha prou espai lliure. Per crear aquest disc\n"
"necessiteu %(total)d MBytes, però només hi ha %(free)d MBytes disponibles."
-#: ../devede_convert.py:247 ../devede_subtitles.py:75
-#: ../devede_subtitles.py:87 ../devede_xml_menu.py:123
+#: ../devede_convert.py:273 ../devede_subtitles.py:75
+#: ../devede_subtitles.py:92 ../devede_xml_menu.py:123
#: ../devede_xml_menu.py:474 ../devede_xml_menu.py:482
#: ../devede_xml_menu.py:486 ../devede_xml_menu.py:490
msgid ""
@@ -63,7 +63,7 @@ msgstr ""
"S'ha produït un error en intentar escriure en el directori de destinació.\n"
"Comproveu que hi teniu permisos i espai lliure."
-#: ../devede_convert.py:339
+#: ../devede_convert.py:368
#, python-format
msgid ""
"The file or folder\n"
@@ -78,7 +78,7 @@ msgstr ""
"\n"
"ja existeix. Si continueu s'esborrarà."
-#: ../devede_convert.py:435
+#: ../devede_convert.py:464
msgid "Unknown error"
msgstr "S'ha produït un error desconegut"
@@ -234,7 +234,7 @@ msgstr "Afegiu un fitxer de pel·lícula abans d'afegir subtítols."
msgid "Adding subtitles to"
msgstr "S'estan afegint els subtítols de"
-#: ../devede_subtitles.py:181 ../devede_subtitles.py:192
+#: ../devede_subtitles.py:186 ../devede_subtitles.py:197
msgid ""
"Conversion failed.\n"
"It seems a bug of SPUMUX."
Oops, something went wrong.

0 comments on commit 10ad85e

Please sign in to comment.