Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (84)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (5665)

  • Slowing or speeding up video or altering frames in video to set video length

    18 novembre 2022, par user19019404

    Using ffmpeg is there a way to change the length of the video without losing frames ?
That is, I want all my videos to be 5 minutes long. Due to CPU processing and other issues (external videos received) some videos are between 2 and 4 minutes minutes, some videos are between 6 and 8 minutes. I don't seem to have lost any frames and they are all intact, just some videos play a bit slower than real seconds and some play faster.

    


    I want to change the speed of the video so that they all end up being exactly 5 minutes. So if I go 2 minutes 30 into the video we are always at the halfway point.

    


    Is this something that can be achieved with ffmpeg ?

    


    Thanks

    


  • QTableWidget and QProcess - update table based on multiple process results

    9 mars 2017, par Spencer

    I have a python program that runs through a QTableWidget and for each item it runs a QProcess (an FFMPEG process to be exact). What I’m trying to do is update the "parent" cell when the process completes. Right now there is a for loop that goes through each row and launches a process for each, and connects the finished signal of that process to a "finished" function, which updates the QTableWidget cell. I’m just having trouble properly telling the function WHICH sell to update - right now I am passing it the index of the current row (seeing as it is being spawned by the for loop) but what happens is by the time the processes start to finish it will only get the last row in the table... I’m quite new to Python and PyQt so it is possible there is some fundamental thing I have wrong here !

    I tried passing the actual QTabelWidgetItem instead of the index but I got this error : "RuntimeError : wrapped C/C++ object of type QTableWidgetItem has been deleted"

    My code, the function "finished" and line #132 are the relevant ones :

    import sys, os, re
    from PyQt4 import QtGui, QtCore

    class BatchTable(QtGui.QTableWidget):
       def __init__(self, parent):
           super(BatchTable, self).__init__(parent)
           self.setAcceptDrops(True)
           self.setColumnCount(4)
           self.setColumnWidth(1,50)
           self.hideColumn(3)
           self.horizontalHeader().setStretchLastSection(True)
           self.setHorizontalHeaderLabels(QtCore.QString("Status;Alpha;File;Full Path").split(";"))

           self.doubleClicked.connect(self.removeProject)

       def removeProject(self, myItem):
           row = myItem.row()
           self.removeRow(row)

       def dragEnterEvent(self, e):
           if e.mimeData().hasFormat('text/uri-list'):
               e.accept()
           else:
               print "nope"
               e.ignore()

       def dragMoveEvent(self, e):
           e.accept()

       def dropEvent(self, e):
           if e.mimeData().hasUrls:
               for url in e.mimeData().urls():
                   chkBoxItem = QtGui.QTableWidgetItem()
                   chkBoxItem.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)
                   chkBoxItem.setCheckState(QtCore.Qt.Unchecked)

                   rowPosition = self.rowCount()
                   self.insertRow(rowPosition)
                   self.setItem(rowPosition, 0, QtGui.QTableWidgetItem("Ready"))
                   self.setItem(rowPosition, 1, chkBoxItem)
                   self.setItem(rowPosition, 2, QtGui.QTableWidgetItem(os.path.split(str(url.toLocalFile()))[1]))
                   self.setItem(rowPosition, 3, QtGui.QTableWidgetItem(url.toLocalFile()))
                   self.item(rowPosition, 0).setBackgroundColor(QtGui.QColor(80, 180, 30))

    class ffmpegBatch(QtGui.QWidget):
       def __init__(self):
           super(ffmpegBatch, self).__init__()
           self.initUI()

       def initUI(self):

           self.edit = QtGui.QTextEdit()

           cmdGroup = QtGui.QGroupBox("Commandline arguments")
           fpsLbl = QtGui.QLabel("FPS:")
           self.fpsCombo = QtGui.QComboBox()
           self.fpsCombo.addItem("29.97")
           self.fpsCombo.addItem("23.976")
           hbox1 = QtGui.QHBoxLayout()
           hbox1.addWidget(fpsLbl)
           hbox1.addWidget(self.fpsCombo)
           cmdGroup.setLayout(hbox1)

           saveGroup = QtGui.QGroupBox("Output")
           self.outputLocation = QtGui.QLineEdit()
           self.browseBtn = QtGui.QPushButton("Browse")
           saveLocationBox = QtGui.QHBoxLayout()
           # Todo: add "auto-step up two folders" button
           saveLocationBox.addWidget(self.outputLocation)
           saveLocationBox.addWidget(self.browseBtn)
           saveGroup.setLayout(saveLocationBox)

           runBtn = QtGui.QPushButton("Run Batch Transcode")

           mainBox = QtGui.QVBoxLayout()
           self.table = BatchTable(self)
           # TODO: add "copy from clipboard" feature
           mainBox.addWidget(self.table)
           mainBox.addWidget(cmdGroup)
           mainBox.addWidget(saveGroup)
           mainBox.addWidget(runBtn)
           mainBox.addWidget(self.edit)

           self.setLayout(mainBox)
           self.setGeometry(300, 300, 600, 500)
           self.setWindowTitle('FFMPEG Batch Converter')

           # triggers/events
           runBtn.clicked.connect(self.run)

       def RepresentsInt(self, s):
           try:
               int(s)
               return True
           except ValueError:
               return False

       def run(self):
           if (self.outputLocation.text() == ''):
               return
           for projIndex in range(self.table.rowCount()):
               # collect some data
               ffmpeg_app = "C:\\Program Files\\ffmpeg-20150702-git-03b2b40-win64-static\\bin\\ffmpeg"
               frameRate = self.fpsCombo.currentText()
               inputFile = self.table.model().index(projIndex,3).data().toString()
               outputPath = self.outputLocation.text()
               outputPath = outputPath.replace("/", "\\")

               # format the input for ffmpeg
               # find how the exact number range, stored as 'd'
               imageName = os.path.split(str(inputFile))[1]
               imageName, imageExt = os.path.splitext(imageName)
               length = len(imageName)
               d = 0
               while (self.RepresentsInt(imageName[length-2:length-1]) == True):
                   length = length-1
                   d = d+1
               inputPath = os.path.split(str(inputFile))[0]
               inputFile = imageName[0:length-1]
               inputFile = inputPath + "/" + inputFile + "%" + str(d+1) + "d" + imageExt
               inputFile = inputFile.replace("/", "\\")

               # format the output
               outputFile = outputPath + "\\" + imageName[0:length-2] + ".mov"


               # build the commandline
               cmd = '"' + ffmpeg_app + '"' + ' -y -r ' + frameRate + ' -i ' + '"' + inputFile + '"' + ' -vcodec dnxhd -b:v 145M -vf colormatrix=bt601:bt709 -flags +ildct ' + '"' + outputFile + '"'

               # launch the process
               proc = QtCore.QProcess(self)
               proc.finished.connect(lambda: self.finished(projIndex))
               proc.setProcessChannelMode(proc.MergedChannels)
               proc.start(cmd)
               proc.readyReadStandardOutput.connect(lambda: self.readStdOutput(proc, projIndex, 100))
               self.table.setItem(projIndex, 0, QtGui.QTableWidgetItem("Running..."))
               self.table.item(projIndex, 0).setBackgroundColor(QtGui.QColor(110, 145, 30))

       def readStdOutput(self, proc, projIndex, total):
           currentLine = QtCore.QString(proc.readAllStandardOutput())
           currentLine = str(currentLine)
           frameEnd = currentLine.find("fps", 0, 15)
           if frameEnd != -1:
               m = re.search("\d", currentLine)
               if m:
                   frame = currentLine[m.start():frameEnd]
                   percent = (float(frame)/total)*100
                   print "Percent: " + str(percent)
                   self.edit.append(str(percent))
                   self.table.setItem(projIndex, 0, QtGui.QTableWidgetItem("Encoded: " + str(percent) + "%"))

       def finished(self, projIndex):
           # TODO: This isn't totally working properly for multiple processes (seems to get confused)
           print "A process completed"
           print self.sender().readAllStandardOutput()
           if self.sender().exitStatus() == 0:
               self.table.setItem(projIndex, 0, QtGui.QTableWidgetItem("Encoded"))
               self.table.item(projIndex, 0).setBackgroundColor(QtGui.QColor(45, 145, 240))


    def main():
       app = QtGui.QApplication(sys.argv)
       ex = ffmpegBatch()
       ex.show()
       sys.exit(app.exec_())

    if __name__ == '__main__':
       main()

    (And yes I do know that my percentage update is totally wrong right now, still working on that...)

  • WebRTC predictions for 2016

    17 février 2016, par silvia

    I wrote these predictions in the first week of January and meant to publish them as encouragement to think about where WebRTC still needs some work. I’d like to be able to compare the state of WebRTC in the browser a year from now. Therefore, without further ado, here are my thoughts.

    WebRTC Browser support

    I’m quite optimistic when it comes to browser support for WebRTC. We have seen Edge bring in initial support last year and Apple looking to hire engineers to implement WebRTC. My prediction is that we will see the following developments in 2016 :

    • Edge will become interoperable with Chrome and Firefox, i.e. it will publish VP8/VP9 and H.264/H.265 support
    • Firefox of course continues to support both VP8/VP9 and H.264/H.265
    • Chrome will follow the spec and implement H.264/H.265 support (to add to their already existing VP8/VP9 support)
    • Safari will enter the WebRTC space but only with H.264/H.265 support

    Codec Observations

    With Edge and Safari entering the WebRTC space, there will be a larger focus on H.264/H.265. It will help with creating interoperability between the browsers.

    However, since there are so many flavours of H.264/H.265, I expect that when different browsers are used at different endpoints, we will get poor quality video calls because of having to negotiate a common denominator. Certainly, baseline will work interoperably, but better encoding quality and lower bandwidth will only be achieved if all endpoints use the same browser.

    Thus, we will get to the funny situation where we buy ourselves interoperability at the cost of video quality and bandwidth. I’d call that a “degree of interoperability” and not the best possible outcome.

    I’m going to go out on a limb and say that at this stage, Google is going to consider strongly to improve the case of VP8/VP9 by improving its bandwidth adaptability : I think they will buy themselves some SVC capability and make VP9 the best quality codec for live video conferencing. Thus, when Safari eventually follows the standard and also implements VP8/VP9 support, the interoperability win of H.264/H.265 will become only temporary overshadowed by a vastly better video quality when using VP9.

    The Enterprise Boundary

    Like all video conferencing technology, WebRTC is having a hard time dealing with the corporate boundary : firewalls and proxies get in the way of setting up video connections from within an enterprise to people outside.

    The telco world has come up with the concept of SBCs (session border controller). SBCs come packed with functionality to deal with security, signalling protocol translation, Quality of Service policing, regulatory requirements, statistics, billing, and even media service like transcoding.

    SBCs are a total overkill for a world where a large number of Web applications simply want to add a WebRTC feature – probably mostly to provide a video or audio customer support service, but it could be a live training session with call-in, or an interest group conference all.

    We cannot install a custom SBC solution for every WebRTC service provider in every enterprise. That’s like saying we need a custom Web proxy for every Web server. It doesn’t scale.

    Cloud services thrive on their ability to sell directly to an individual in an organisation on their credit card without that individual having to ask their IT department to put special rules in place. WebRTC will not make progress in the corporate environment unless this is fixed.

    We need a solution that allows all WebRTC services to get through an enterprise firewall and enterprise proxy. I think the WebRTC standards have done pretty well with firewalls and connecting to a TURN server on port 443 will do the trick most of the time. But enterprise proxies are the next frontier.

    What it takes is some kind of media packet forwarding service that sits on the firewall or in a proxy and allows WebRTC media packets through – maybe with some configuration that is necessary in the browsers or the Web app to add this service as another type of TURN server.

    I don’t have a full understanding of the problems involved, but I think such a solution is vital before WebRTC can go mainstream. I expect that this year we will see some clever people coming up with a solution for this and a new type of product will be born and rolled out to enterprises around the world.

    Summary

    So these are my predictions. In summary, they address the key areas where I think WebRTC still has to make progress : interoperability between browsers, video quality at low bitrates, and the enterprise boundary. I’m really curious to see where we stand with these a year from now.

    It’s worth mentioning Philipp Hancke’s tweet reply to my post :

    — we saw some clever people come up with a solution already. Now it needs to be implemented 🙂

    The post WebRTC predictions for 2016 first appeared on ginger’s thoughts.