Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 11/05/2005, à 19:27

flouzy

DivFix ou comment réparer ses divx tous cassés :)

DivFix peut reconstruire l'index de vos divx/xvid et supprimer les secteurs défecteux.

J'ai eu du mal à le faire marcher sur ma Ubuntu, pourtant c'était pas si dur big_smile

Tout d'abord il faut aller prendre le logiciel et sa librairie ici : http://divfix.maxeline.com/index.php?target=showdoc&docid=355

Extraire l'archive et mettre la librairie libborqt-6.9-qt2.3.so dans le même répertoire que DivFix pour plus de commodités smile

Editer le fichier DivFix.sh pour y ajouter le chemin du programme et de sa librairie, le mien ressemble à ca :
#!/bin/bash
libpath=./librairie
applcationpath=./
export LD_LIBRARY_PATH=$libpath:$LD_LIBRARY_PATH
export PATH=$PATH:$applicationpath
DivFix

Maintenant on est supposé ouvrir un terminal, se mettre dans le répertoire de DivFix et tapez ./DivFix.sh ce qui lance le GUI du programme, mais chez moi il lui a été impossible de traiter un quelconque fichier... Je suis donc passé par la version perl en ligne de commande, qui elle marche parfaitement bien smile

Pour ce faire il faut ouvrir un terminal, se mettre dans le répertoire Perl version et taper :

$ perl divfix -v -bd lechemindemavideo.avi

En espérant que ca serve à quelqu'un wink

Hors ligne

#2 Le 12/05/2005, à 20:54

Kagou

Re : DivFix ou comment réparer ses divx tous cassés :)

Merci à toi smile


«black-out» du Net français

http://www.laquadrature.net/HADOPI

Hors ligne

#3 Le 25/11/2006, à 18:07

akwell

Re : DivFix ou comment réparer ses divx tous cassés :)

il y a pas une autre solution graphique car je suis pas trop adepte des lignes de codes...

merci

Hors ligne

#4 Le 26/11/2006, à 11:40

flouzy

Re : DivFix ou comment réparer ses divx tous cassés :)

Ce topic est assez vieux mais c'est pas grave je vais essayer de répondre...

Je viens d'essayer la version windows sous wineet ca semble marcher sans problème, mais je n'ai pas de divx défectueux sous la main pour confirmer.

DivFix se trouve ici à présent http://perso.orange.fr/guix/site/site_flash/logiciels/ ainsi que pas mal de logiciels utiles pour manipuler les vidéos.

wine se trouve dans les sources officielles ubuntu il me semble. Pour lancer DivFix il suffit de double cliquer sur DivFix.exe si wine a été bien associé aux fichiers .exe (c'est fait automatquement normalement)

Voilà, a+

Hors ligne

#5 Le 03/05/2009, à 00:08

l e . n o x

Re : DivFix ou comment réparer ses divx tous cassés :)

Merci pour ce partage, bien utile ce DivFix.exe wink

A tout hazard, quelqu'un connait une alternative sous Linux de DivFix ?

Version Win32 : http://download.divfix.maxeline.com/DivFix110.zip
Version Linux : http://download.divfix.maxeline.com/DivFix110.tar.gz + http://download.divfix.maxeline.com/libborqt.tar.gz

Merci et bonne soirée @ Tous tongue

Dernière modification par l e . n o x (Le 03/05/2009, à 00:14)


Zik Fan : " Vous seul savez mieux que quiconque comment organiser votre bibliothèque musicale ! "

Linux, y a moins bien.
Mais c'est plus cher. ;O)

Hors ligne

#6 Le 04/05/2009, à 20:09

l e . n o x

Re : DivFix ou comment réparer ses divx tous cassés :)

Bonjour,

Bon je me suis lancé, DivXFixTux (en fait une simple GUI en Python/Glade) est dans les bacs big_smile

En image :
1241460042.png

Principales options :
- Verification du fichier Video.
- Reparation.

La barre de progression fonctionne quand elle veux, et l'autoscroll dans la zone text n'est pas autoScroll en fait big_smile
Mais le script perl de DivxFix fonctionne sans mettre les mains dans le cambouis tongue

Si quelqu'un pouvez améliorer cette GUI, se serai vraiment cool !!

Utilisation et Installation :

1) avoir les dépendances Python + glade installé.es Python + glade installé.
2) On telecharge le Soft :  http://ordiboy.free.fr/open/Linux/DivxFixTux/DivxFixTux_1.10.tar.gz
3) on dezippe l'archive "DivxFixTux_1.10.tar.gz" sur le bureau par exemple.
4) Puis doubleclik sur "DivxFixGui.py" puis choisir lancer dans un terminal.
5) Puis on repare son Divx big_smile

Voici le code en lecture directe :

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys,os
import gobject
import time

try:
        import pygtk
        pygtk.require("2.0")
except:
        pass
try:
        import gtk
        import gtk.glade
except:
        sys.exit(1)

file_1="Fichier Video"
fold_1="Selecteur de Fichier"
sortie_console=""


#========================= je declare la class GtkWindow recupere dans fichier glade
class GtkWindow:

        def __init__(self):
                #J'active le fichier Glade
                self.gladefile = "DivxFixGui.glade" 
                self.wTree = gtk.glade.XML(self.gladefile)

#========================= je declare les attributs recupere de l'interface Graphique 

		self.reparer = self.wTree.get_widget("button1")  # Reparer
		self.verifier = self.wTree.get_widget("button2")  # Verifier
		self.annuler = self.wTree.get_widget("button3")  # Annuler

		self.selecteurdefichier = self.wTree.get_widget("filechooserbutton1") # Selecteur de fichier

		self.saisiedetexte = self.wTree.get_widget("entry1")  # Saisie de texte
		self.sortiezonedetexte = self.wTree.get_widget("textview1")  # Recup de texte

		self.progressbar1 = self.wTree.get_widget("progressbar1")  # Barre de progression
	
		# Ici on initialise la self.sortiezonedetexte "textview1" ceci n'est pas obligatoire
		self.create_text()

#========================= le dictionnaire de connection entre Action et bouton de la GUI
		dic = { 
        	"on_window1_destroy" : gtk.main_quit,
		"on_button1_clicked" : self.reparer_clicked,
		"on_button2_clicked" : self.verifier_clicked,
		"on_button3_clicked" : self.annuler_clicked,
		"on_filechooserbutton1_selection_changed" : self.selecteurdefichier_clicked,
		 }
		self.wTree.signal_autoconnect(dic)

#================ Action / code et interactions sur l'interface ===========================

	#-- Voici la zone self.sortiezonedetexte "textview1" ------------------------ 
	def insert_text(self, buffer):

		iter = buffer.get_iter_at_offset(0)
		buffer.insert(iter,sortie_console) #1 

		#2 end_iter = buffer.get_end_iter()
		#2 buffer.insert(end_iter, sortie_console)
		#2 self.sortiezonedetexte.scroll_to_mark(buffer.get_insert(), 0)

		#3 buffer.insert(iter,sortie_console)
		#3 mark = buffer.create_mark("end", buffer.get_end_iter(), False)
 		#3 self.sortiezonedetexte.scroll_to_mark(mark, 0.05, True, 0.0, 1.0)


			   
	# Ici on recupere les infos du Buffer "textview1" qu'on redirige vers "insert_text(self, buffer)"
	def create_text(self):
		view = self.sortiezonedetexte
		buffer = view.get_buffer()
		self.insert_text(buffer)
	#-------------------------------------------------------------------------------
	def evolution_barre(self):
		print "...Debut..."
		for i in [ 0.2, 0.4, 0.6, 0.8, 1]:
		    time.sleep(0.1)
		    print i
		    self.progressbar1.set_fraction(i)
		    print "...Fin..."
		    yield True
		yield False
		
	def declenche_progressbar(self, widget):
		task = self.evolution_barre()
		gobject.idle_add(task.next)


	def reparer_clicked(self, widget):
		global sortie_console
		print "..............reparer_clicked..........."

		file_1 =self.saisiedetexte.get_text() # Recupere text de entry1
		sortie_console = " perl divfix -v -bd "+file_1 #" xterm -e perl divfix -v -bd "+file_1
		print sortie_console
		#os.system(sortie_console)
		sortie_console = os.popen(sortie_console)
		sortie_console = sortie_console.read()

		self.progressbar1.set_fraction(0)
		self.declenche_progressbar(widget)
		self.create_text()

	def verifier_clicked(self, widget):
		print "..............verifier_clicked..........."
		global sortie_console

		file_1 =self.saisiedetexte.get_text() # Recupere text de entry1
		sortie_console = " perl divfix -v "+file_1 #"xterm -e perl divfix -v "+file_1 #
		print sortie_console
		#os.system(sortie_console)
		sortie_console = os.popen(sortie_console)
		sortie_console = sortie_console.read()

		self.progressbar1.set_fraction(0)
		self.declenche_progressbar(widget)
		self.create_text()

	def annuler_clicked(self, widget):
		print "..............annuler_clicked..........."
		gtk.main_quit()

	def selecteurdefichier_clicked(self, widget):
		global fold_1
		global file_1
		print "..............selecteurdefichier_clicked..........."
		fold_1 = self.selecteurdefichier.get_filename() # Recupere le texte de selecteurdefichier
		file_1 =self.saisiedetexte.set_text(fold_1) # applique texte de selecteurdefichier dans entry1 

#================== Active la GuiWindow
if __name__ == "__main__":
        hwg = GtkWindow()
        gtk.main()

Code Glade : DivxFixGui.glade

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

<glade-interface>

<widget class="GtkWindow" id="window1">
  <property name="visible">True</property>
  <property name="title" translatable="yes">- DivxFix 1.10 Tux -</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_CENTER</property>
  <property name="modal">False</property>
  <property name="default_width">600</property>
  <property name="default_height">100</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>
  <property name="decorated">True</property>
  <property name="skip_taskbar_hint">False</property>
  <property name="skip_pager_hint">False</property>
  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
  <property name="focus_on_map">True</property>
  <property name="urgency_hint">False</property>
  <signal name="destroy" handler="on_window1_destroy" last_modification_time="Sun, 03 May 2009 03:13:31 GMT"/>

  <child>
    <widget class="GtkVBox" id="vbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">0</property>

      <child>
	<widget class="GtkHBox" id="hbox2">
	  <property name="visible">True</property>
	  <property name="homogeneous">False</property>
	  <property name="spacing">0</property>

	  <child>
	    <widget class="GtkVBox" id="vbox2">
	      <property name="visible">True</property>
	      <property name="homogeneous">False</property>
	      <property name="spacing">0</property>

	      <child>
		<widget class="GtkEntry" id="entry1">
		  <property name="visible">True</property>
		  <property name="can_focus">True</property>
		  <property name="editable">True</property>
		  <property name="visibility">True</property>
		  <property name="max_length">0</property>
		  <property name="text" translatable="yes"></property>
		  <property name="has_frame">True</property>
		  <property name="invisible_char">●</property>
		  <property name="activates_default">False</property>
		</widget>
		<packing>
		  <property name="padding">0</property>
		  <property name="expand">True</property>
		  <property name="fill">False</property>
		  <property name="pack_type">GTK_PACK_END</property>
		</packing>
	      </child>

	      <child>
		<widget class="GtkLabel" id="label1">
		  <property name="visible">True</property>
		  <property name="label" translatable="yes">Fichier Video</property>
		  <property name="use_underline">False</property>
		  <property name="use_markup">False</property>
		  <property name="justify">GTK_JUSTIFY_CENTER</property>
		  <property name="wrap">False</property>
		  <property name="selectable">False</property>
		  <property name="xalign">0.5</property>
		  <property name="yalign">0.5</property>
		  <property name="xpad">0</property>
		  <property name="ypad">0</property>
		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
		  <property name="width_chars">-1</property>
		  <property name="single_line_mode">False</property>
		  <property name="angle">0</property>
		</widget>
		<packing>
		  <property name="padding">0</property>
		  <property name="expand">False</property>
		  <property name="fill">True</property>
		</packing>
	      </child>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">True</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>

	  <child>
	    <widget class="GtkFileChooserButton" id="filechooserbutton1">
	      <property name="visible">True</property>
	      <property name="title" translatable="yes">Sélectionner un fichier</property>
	      <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
	      <property name="local_only">True</property>
	      <property name="show_hidden">False</property>
	      <property name="do_overwrite_confirmation">True</property>
	      <property name="width_chars">-1</property>
	      <signal name="selection_changed" handler="on_filechooserbutton1_selection_changed" last_modification_time="Sun, 03 May 2009 01:59:24 GMT"/>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">True</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</property>
	</packing>
      </child>

      <child>
	<widget class="GtkProgressBar" id="progressbar1">
	  <property name="visible">True</property>
	  <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
	  <property name="fraction">0</property>
	  <property name="pulse_step">0.10000000149</property>
	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">False</property>
	</packing>
      </child>

      <child>
	<widget class="GtkScrolledWindow" id="scrolledwindow1">
	  <property name="visible">True</property>
	  <property name="can_focus">True</property>
	  <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
	  <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
	  <property name="shadow_type">GTK_SHADOW_IN</property>
	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>

	  <child>
	    <widget class="GtkTextView" id="textview1">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="editable">True</property>
	      <property name="overwrite">False</property>
	      <property name="accepts_tab">True</property>
	      <property name="justification">GTK_JUSTIFY_LEFT</property>
	      <property name="wrap_mode">GTK_WRAP_NONE</property>
	      <property name="cursor_visible">True</property>
	      <property name="pixels_above_lines">0</property>
	      <property name="pixels_below_lines">0</property>
	      <property name="pixels_inside_wrap">0</property>
	      <property name="left_margin">0</property>
	      <property name="right_margin">0</property>
	      <property name="indent">0</property>
	      <property name="text" translatable="yes"></property>
	    </widget>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">True</property>
	  <property name="fill">True</property>
	</packing>
      </child>

      <child>
	<widget class="GtkHBox" id="hbox1">
	  <property name="visible">True</property>
	  <property name="homogeneous">True</property>
	  <property name="spacing">0</property>

	  <child>
	    <widget class="GtkButton" id="button1">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="label" translatable="yes">reparer</property>
	      <property name="use_underline">True</property>
	      <property name="relief">GTK_RELIEF_NORMAL</property>
	      <property name="focus_on_click">True</property>
	      <signal name="clicked" handler="on_button1_clicked" last_modification_time="Sun, 03 May 2009 01:58:31 GMT"/>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">False</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>

	  <child>
	    <widget class="GtkButton" id="button2">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="label" translatable="yes">verifier</property>
	      <property name="use_underline">True</property>
	      <property name="relief">GTK_RELIEF_NORMAL</property>
	      <property name="focus_on_click">True</property>
	      <signal name="clicked" handler="on_button2_clicked" last_modification_time="Sun, 03 May 2009 01:58:22 GMT"/>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">False</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>

	  <child>
	    <widget class="GtkButton" id="button3">
	      <property name="visible">True</property>
	      <property name="can_focus">True</property>
	      <property name="label" translatable="yes">fermer</property>
	      <property name="use_underline">True</property>
	      <property name="relief">GTK_RELIEF_NORMAL</property>
	      <property name="focus_on_click">True</property>
	      <signal name="destroy" handler="on_button3_destroy" last_modification_time="Sun, 03 May 2009 03:16:31 GMT"/>
	      <signal name="clicked" handler="on_button3_clicked" last_modification_time="Sun, 03 May 2009 03:16:38 GMT"/>
	    </widget>
	    <packing>
	      <property name="padding">0</property>
	      <property name="expand">False</property>
	      <property name="fill">True</property>
	    </packing>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">False</property>
	</packing>
      </child>

      <child>
	<widget class="GtkStatusbar" id="statusbar1">
	  <property name="visible">True</property>
	  <property name="has_resize_grip">True</property>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">False</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

<widget class="GtkFileChooserDialog" id="filechooserdialog1">
  <property name="border_width">5</property>
  <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
  <property name="local_only">True</property>
  <property name="select_multiple">False</property>
  <property name="show_hidden">False</property>
  <property name="do_overwrite_confirmation">False</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</property>
  <property name="resizable">False</property>
  <property name="destroy_with_parent">False</property>
  <property name="decorated">True</property>
  <property name="skip_taskbar_hint">False</property>
  <property name="skip_pager_hint">False</property>
  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
  <property name="focus_on_map">True</property>
  <property name="urgency_hint">False</property>
  <signal name="selection_changed" handler="on_filechooserdialog1_selection_changed" last_modification_time="Sun, 03 May 2009 02:01:50 GMT"/>

  <child internal-child="vbox">
    <widget class="GtkVBox" id="dialog-vbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">2</property>

      <child internal-child="action_area">
	<widget class="GtkHButtonBox" id="dialog-action_area1">
	  <property name="visible">True</property>
	  <property name="layout_style">GTK_BUTTONBOX_END</property>

	  <child>
	    <widget class="GtkButton" id="button4">
	      <property name="visible">True</property>
	      <property name="can_default">True</property>
	      <property name="can_focus">True</property>
	      <property name="label">gtk-cancel</property>
	      <property name="use_stock">True</property>
	      <property name="relief">GTK_RELIEF_NORMAL</property>
	      <property name="focus_on_click">True</property>
	      <property name="response_id">-6</property>
	    </widget>
	  </child>

	  <child>
	    <widget class="GtkButton" id="button5">
	      <property name="visible">True</property>
	      <property name="can_default">True</property>
	      <property name="has_default">True</property>
	      <property name="can_focus">True</property>
	      <property name="label">gtk-open</property>
	      <property name="use_stock">True</property>
	      <property name="relief">GTK_RELIEF_NORMAL</property>
	      <property name="focus_on_click">True</property>
	      <property name="response_id">-5</property>
	    </widget>
	  </child>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">True</property>
	  <property name="pack_type">GTK_PACK_END</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>

Bonne journée @ Tous

Dernière modification par l e . n o x (Le 04/05/2009, à 23:03)


Zik Fan : " Vous seul savez mieux que quiconque comment organiser votre bibliothèque musicale ! "

Linux, y a moins bien.
Mais c'est plus cher. ;O)

Hors ligne

#7 Le 08/05/2009, à 18:09

Aurel07

Re : DivFix ou comment réparer ses divx tous cassés :)

Salut l e . n o x.

Je suis en train de regarder ton programme, et j'ai quelques commentaires :

- Deja, la fonction os.popen semble depassée (deprecated) et il vaut mieux utiliser subprocess :

import subprocess
...
a=subprocess.Popen(["perl", "divfix", "-v", file_1], stdout=subprocess.PIPE)
a.stdout.read()

- Pour l'autoscroll, chez moi ca marche dans ta version 2, avec self.sortiezonedetexte.scroll_to_mark(buffer.get_insert(), 0). (je suis sous archlinux, ca peut peut etre expliquer)

- Pour la progressbar, je n'ai pas de solution miracle. J'ai longtemps cherche pour arriver a faire progresser la barre avec un programme unique en tache de fond, mais sans succes. Dans ton programme, la commande lancée interromp la boucle principale (gtk.main). Je suppose qu'avec un gros fichier video, ca doit faire bloquer la fenetre. La progressbar ne se met a jour qu'une fois l'action terminee. La solution est d'utiliser un autre thread grace au module threading :

import threading
...
gobject.threads_init()                           #Pour que les threads soient lancés au moment opportun.
...
class MonThread(threading.Thread):        #la classe qui creera le thread et lancera la commande
    def __init__(self):
        super(MonThread, self).__init__()    #je sais pas a quoi ca sert, mais ca sert
        self.pid=os.getpid()                       #on recupere le pid, ca peut etre utile
        
    def run(self):                                   #lance par la commande MonThread.start()
        a=subprocess.Popen(["perl", "divfix", "-v", file_1], stdout=subprocess.PIPE)
        a.stdout.read()

class ClassePrincipale()
    .... #fait plein de trucs (initialisation de la fenetre, choix du fichier, ...)


    #quand on clique sur le bouton :
    mon_thread=MonThread()                  #instancie notre thread
    mon_thread.start()                           #demarre l'action
    timer = gobject.timeout_add (100, self.pulsate)    #Fait pulser la barre a intervalles reguliers

    def pulsate(self):                             #fonction pour faire pulser
        if mon_thread.is_alive():               #Tant que le thread est en cours, 
            progress_bar.pulse()                #on fait pulser la barre
            return True                            #et on renvoie True pour que gobject.timeout recommence
        else:
            progress_bar.set_fraction(1)      #si le thread est fini, on met la barre remplie
            progress_bar.set_text('Terminé !')     #on peut meme ecrire termine si on veut
            return False                            #On renvoie False a gobject.timeout pour qu'il s'arrete

Comme tu le remarques, ca ne fait que pulser la barre, ca ne la fait pas progresser. Je n'ai pas de solution pour recuperer la sortie de divfix en temps reel et ajuster la barre en fonction de sa sortie...

Voila, a toi de jouer !

References :
http://www.pygtk.org/pygtk2reference/
http://faq.pygtk.org/index.py?req=index notamment la 23.20

Dernière modification par Aurel07 (Le 08/05/2009, à 18:11)

Hors ligne