Recherche avancée

Médias (91)

Autres articles (34)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (2394)

  • C# Adding generic text to a video file

    14 juillet 2016, par Ozan Ayten

    I would like to add a Generics Text (like the texts you see when a movie ends, it slides down or up in a slow pace) to a video file. Hardsubbed.

    I’ve been experimented with few api but couldn’t manage to find a solution. Is this possible ? Is there a way to do it without the task getting too complicated ?

    As a side note : I want to add generic text like the Windows Movie Maker does. But I want to do it programmatically of course.

  • How to mock an .mpg file for unit tests ?

    28 juin 2012, par Richard Knop

    Ok. I have a class which runs this command :

    ffmpeg_command = "ffprobe -v quiet -print_format json -show_format -show_streams %s" % self.absolute_path

    Where self.absolute_path is a path to a movie, let's say .mpg file.

    The file I am using for testing is 4GB large and I don't want to commit it inside my GIT repo.

    So I was thinking of mocking this file and creating a file called :

    mock.mpg

    Which would return the same string as the actual mpg movie when supplied as input to ffprobe command. Is that possible ?

    Or what other approach should I choose ?

    This is my class :

     class Movie(object):

         absolute_path = None
         info = None

         def __init__(self, path):
             self.absolute_path = "%s/%s" % (os.getcwd(), path)
             if(os.path.exists(self.absolute_path) is False):
                 raise IOError("File does not exist")

             self.info = json.loads(self.get_info())

       def get_info(self):
             ffmpeg_command = "ffprobe -v quiet -print_format json -show_format -show_streams %s" % self.absolute_path
             return subprocess.check_output(ffmpeg_command, shell=True)

    This is how I will be unit testing it :

     class MovieTest(unittest.TestCase):

         def test_foo(self):
             movie = Movie("tests/test_1.mpg") # this file should be a mock file!!!
  • Cannot run ffmpeg in subproces.call

    27 juin 2012, par Richard Knop

    So, I have a simple class where I am trying to save a string response from a terminal ffmpeg command into an object property :

    import os
    import subprocess

    class Movie(object):

       absolute_path = None
       movie_info = None

       def __init__(self, path):
           self.absolute_path = "%s/%s" % (os.getcwd(), path)
           if(os.path.exists(self.absolute_path) is False):
               raise IOError("File does not exist")

       def get_movie_info(self):
           ffmpeg_command = "ffmpeg -i %s" % self.absolute_path
           self.movie_info = subprocess.call(ffmpeg_command)
           print self.movie_info

    When I then run this command in cmd :

    import os
    import sys
    sys.path.append(os.getcwd())

    from Encode.Movie import Movie

    try:
       movie = Movie("tests/test_1.mpg")
       movie.get_movie_info()
    except IOError as e:
       print e

    I get this exception :

    richard@richard-desktop:~/projects/hello-python$ python main.py
    Traceback (most recent call last):
     File "main.py", line 9, in <module>
       movie.get_movie_info()
     File "/home/richard/projects/hello-python/Encode/Movie.py", line 16, in get_movie_info
       self.movie_info = subprocess.call(ffmpeg_command)
     File "/usr/lib/python2.7/subprocess.py", line 493, in call
       return Popen(*popenargs, **kwargs).wait()
     File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
       errread, errwrite)
     File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
       raise child_exception
    OSError: [Errno 2] No such file or directory
    </module>

    The path is correct because when I do print self.absolute_path before subprocess.call(), I get :

    /home/richard/projects/hello-python/tests/test_1.mpg

    And this file exists.