Recherche avancée

Médias (1)

Mot : - Tags -/embed

Autres articles (25)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (4970)

  • 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.

  • 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!!!
  • 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.