MCut - Tagliare le pubblicità delle registrazioni su DB

Ferbius

Digital-Forum Silver Master
Registrato
2 Marzo 2002
Messaggi
2.513
Grandissimo Plugin per tagliare direttamente la pubblicità nel DB.

Al momento il tutto si fa tramite Telnet.
Allego di seguito il 3D dell'autore... VIRGOLA

P.S. Io ho provato a tagliare "Dalla Cina con furore" e vi assicuro che è stato velocissimo (circa 10 minuti per avere il film senza pubblicità).

PSS

1)Il taglio prima e dopo il film l'ho fatto con cutlist del DB.

2) Poi con DCC ho copiato il titolo del film (occhio deve essere quello che c'è nel DB: quindi NON "Dalla Cina con furore" ma "20070712 2145 - SKY Max - Dalla Cina con furore" senza .ts in fondo.

3) In telenet basta scrivere:

cd /media/hdd/movie/ (invio)

mcut "20070712 2145 - SKY Max - Dalla Cina con furore" (invio)

aspettare 10 minuti e vi ritrovate nella stessa cartella movie con il film tagliato.

20070712 2145 - SKY Max - Dalla Cina con furore.cut.ts

4) Il bello è che l'originale non viene cancellato e il nuovo film mantiene tutte le caratteristiche di informazione dell'originale.

----README ORIGINALE----

I have written a C code hack to actually perform the cuts specified with the cut list editor of DM7025.

The hack was inspired and guided by the similar package "moviecutter" by Georges. However, you need not wait over the night but it can run in the background as you keep watching on your dreambox, and a typical movie takes about 15 minutes to process.

What is not yet done is to provide a menu alternative "Apply cuts" next to the "Cutlist editor" alternative in the movie menu. Python is not my language though, so I may need some help with this. Currently you have to log in to the dreambox and run the program from the shell.

Another drawback is that when a section is removed within a movie the picture freezes and breaks up briefly at the cut (just as it does when you look directly at a movie with cutlist editor cuts). I guess that this means that I fail to hit the GOP-boundaries (which confuses me because I really tried to). Cutting off the start and end of a movie works without such artifacts though.

There is actually a set of related programs that are provided:

mcut <filename>
Copies the sections that are not removed according the the cut list editor marks to a new file with " cut" appended to its name.

mcutarg <filename> <starttime 1> <endtime 1> [<starttime 2> <endtime 2> ...]
Copies the sections given as arguments to a new file with " cut" appended to its name. The times are given as <hour:min:sec> as counted from the beginning of the movie, and note that the section between a start time and an end time is *retained* and not removed (i.e. opposite to the cutlist editor semantics where the given sections are removed.)

lscut <filename>
Displays the mark times as set by the cutlist editor (if you by some reason don't want to start the cutlist editor to check on screen).

chcut <filename> <starttime 1> <endtime 1> [<starttime 2> <endtime 2> ...]
Sets the cut marks for the file without using the cutlist editor according to the specified start and end times. As above, the times are given as <hour:min:sec> as counted from the beginning of the movie, and note that the section between a start time and an end time is *retained* and not removed (i.e. opposite to the cutlist editor semantics where the given sections are removed.)

mrename <filename> <new filename>
Renames the movie by renaming all the files involved. Typically, after having cut a movie you may want to delete the original and rename the result to the original name. This can of course be performed as well by a number of "mv" commands at the shell, but the file names are long and there are many files involved for each movie...

All movie filenames can be given either with or without the ".ts" suffix, and all other suffixes are added by the programs where needed.

Below are only the binaries for DM7025 included. I guess that some of the programs could be useful even without the cutlist editor (which I understand is only provided on DM7025) although I have no access to other models so I have not been able to verify that it works. If
someone likes to try to compile them on another dreambox model, please contact me and I'll send you the source code. (Or if you like the source code for any reason at all, since it is under GPL.)

Best Regards
Anders Holst
 
Ancora su Mcut

La novità è che l'autore ha rilasciato un plugin Python per farlo partire da telecomando.
Una volta installato il plugin:
1) Andare sulla lista dei film registrati;
3) Selezionare il film che si vuol tagliare (senza farlo partire);
2) Con cutlisteditor (tasto dream) fare i tagli delle parti che non interessano;
3) Sempre da tasto dream selezionare "Execute cuts".
4) Vi si aprirà una lista di comandi che vi permetterà di sceliere l'azione che volete fare.
5) Il problema, purtroppo, è che finora (ma penso per poco) il programma lavora in background e, non
avendo la barra di avanzamento l'unica possibilità di vedere se sta lavorando è collegarsi con TELNET e dare il comando "top".
Oppure aspettare circa dieci minuti (dipende dalla grandezza del film) e poi vedere se nella lista registrati appare.

Poichè il plugin è pieno di voci, io l'avrei un po' ridotto per fargli eseguire solo la parte che mi interessa.

I comandi che ho lasciato sono
1) Don't cut
2) Replace the original movie with the cut movie (sostituisce all'originale il film tagliato)
3) Place the cut movie in a new ending with "cut" ( crea un nuovo file con lo stesso titolo dell'originale,
ma con la scritta cut alla fine)

Inserisco qui lo script abbreviato (basta fare un copia e incolla e salvare come plugin.py - per poi sostituirlo all'originale.

Codice:
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Components.config import *
from Components.ActionMap import ActionMap, NumberActionMap
from Components.ConfigList import ConfigList, ConfigListScreen
from Components.Button import Button
from Components.Label import Label
from Components.Pixmap import Pixmap
from enigma import eServiceReference, eServiceCenter, iServiceInformation
import os

def main(session, service, **kwargs):
	MovieCut(session, service, **kwargs)

def Plugins(**kwargs):
	return PluginDescriptor(name="MovieCut", description="Execute cuts...", where = PluginDescriptor.WHERE_MOVIELIST, fnc=main)

class MovieCut(Screen):
        def __init__(self, session, service):
		Screen.__init__(self, session)
		self.session = session
                self.service = service
		serviceHandler = eServiceCenter.getInstance()
                path = self.service.getPath()
		info = serviceHandler.info(self.service)
                if not info:
                    self.name = path
                else:
		    self.name = info.getName(self.service)
		tlist = []
                tlist.append(("Don't cut", 0))
                tlist.append(("Replace the original movie with the cut movie", 1))
                tlist.append(("Place the cut movie in a new file ending with \" cut\"", 2))
                self.session.openWithCallback(self.cutConfirmed, ChoiceBox, _("How would you like to cut \"%s\"?") % (self.name), list = tlist, selection = 0)

	def cutConfirmed(self, confirmed):
		if not confirmed or confirmed[1] == 0:
			return self.close()
                elif confirmed[1] == 1:
                        os.spawnl(os.P_NOWAIT, "/usr/bin/mcut", "/usr/bin/mcut", "-r", self.service.getPath())
	                self.session.openWithCallback(self.endc, MessageBox, _("The movie \"%s\" is cut in the background.") % (self.name), MessageBox.TYPE_INFO)
                elif confirmed[1] == 2:
                        os.spawnl(os.P_NOWAIT, "/usr/bin/mcut", "/usr/bin/mcut", self.service.getPath())
	                self.session.openWithCallback(self.endc, MessageBox, _("The movie \"%s\" is cut in the background.") % (self.name), MessageBox.TYPE_INFO)
                elif confirmed[1] == 3:
			serviceHandler = eServiceCenter.getInstance()
			info = serviceHandler.info(self.service)
        		self.path = self.service.getPath()
			self.name = info.getName(self.service)
        		self.descr = info.getInfoString(self.service, iServiceInformation.sDescription)
                        self.session.openWithCallback(self.advcutConfirmed, self.name, self.path, self.descr)

	def advcutConfirmed(self, ret):
		if len(ret) <= 1 or not ret[0]:
			return self.close()
                clist = ["/usr/bin/mcut"]
                if ret[1] == True:
                        clist.append("-r")
                clist.append(self.service.getPath())
                if ret[2] != False:
                        clist += ["-o", ret[2]]
                if ret[3] != False:
                        clist += ["-n", ret[3]]
                if ret[4] != False:
                        clist += ["-d", ret[4]]
                if ret[5] != False:
                        clist.append("-c")
                        clist += ret[5]
                os.spawnv(os.P_NOWAIT, "/usr/bin/mcut", clist)
                self.session.openWithCallback(self.endc, MessageBox, _("The movie \"%s\" is cut in the background.") % (self.name), MessageBox.TYPE_INFO)

        def endc(self, arg = 0):
                session = self.session
                self.close()
                session.current_dialog.close()

IMPORTANTE
Spererei che qualcuno, meno ignorante di me, aggiungesse allo script la parte relativa alla "BARRA DI AVANZAMENTO".

Un grazie a virgola
 
Indietro
Alto Basso