Recherche avancée

Médias (91)

Autres articles (71)

  • 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

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

  • 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 (9533)

  • How to open&save a video file in python ?

    27 août 2014, par AliGH

    I’ve just started to make a ubuntu application using PyGtk. My very first object is to open, convert and then save a video file. Ignoring convert phase, I’m going to implant open-save functions. But at the moment when I open a video file, and save it, I get non-video file with 11B size. I’ve just google this and found OpenCV for python. But I’m not sure if it’s the best way to do it. I also think I’m going to use ffmpeg libraries to do some manipulates on video files. Is it what I want or there might be other built-in libraries ?

    By the way, here’s my code to open and save the file :

       def on_openFile_clicked(self, widget):
           filename=None
           dialog = Gtk.FileChooserDialog("Please choose a file", self,
               Gtk.FileChooserAction.OPEN,
               (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                Gtk.STOCK_OPEN, Gtk.ResponseType.OK))

           response = dialog.run()
           self.add_filters(dialog)

           if response == Gtk.ResponseType.OK:
               filename = dialog.get_filename()
           elif response == Gtk.ResponseType.CANCEL:
               print 'Cancel Clicked'
           dialog.destroy()

           print "File Choosen: ", filename

       def add_filters(self, dialog):

           filter_py = Gtk.FileFilter()
           filter_py.set_name("Video Files")
           filter_py.add_mime_type("video/mp4")
           filter_py.add_mime_type("video/x-flv")
           dialog.add_filter(filter_py)

           filter_any = Gtk.FileFilter()
           filter_any.set_name("Any files")
           filter_any.add_pattern("*")
           dialog.add_filter(filter_any)

       def on_saveFile_clicked(self, widget):
           filename=None
           dialog = Gtk.FileChooserDialog("Please choose a file", self,
               Gtk.FileChooserAction.SAVE,
               (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                Gtk.STOCK_SAVE, Gtk.ResponseType.OK))

           response = dialog.run()
           self.add_filters(dialog)

           if response == Gtk.ResponseType.OK:
               filename = dialog.get_filename()
           elif response == Gtk.ResponseType.CANCEL:
               print 'Cancel Clicked'
           dialog.destroy()

           if filename != None:
               save_file=open(filename, 'w')
               save_file.write("Sample Data")
               save_file.close()
           print "File Saved: ", filename
  • record desktop save every 30 minutes

    31 mars 2014, par Maged E William

    here is my question that related to the same problem :

    better way to record desktop via ffmpeg

    I have this command : ffmpeg -f dshow -i video="screen-capture-recorder" -r 30 -t 10 E:\test01.flv

    And i am happy with it, but i wonder if i can make it save every 30 minutes so if the power went off i only loses the last 30 minutes.

    I use C# to launch and hide ffmpeg cmd, so i wonder how to make it save to the same test01.flv every 30 minutes ?

  • How to record an HTML animation and save it as a video, in an automated manner in the backend

    14 mai 2022, par frizurd

    I need to record a webpage and save it as a video, in an automated manner, without human interaction.

    


    I am creating a NodeJS app that generates MP4 videos on the request of the user. The user provides an MP3 file, the app generates animated waveforms for the sound file on top of an illustration.

    


    What I came up with so far is a system that opens a generated web page in the backend, plays the audio file, and shows audio visualization for the audio file on an HTML canvas element. On top of another canvas with mainly static components, such as images, that do not animate. The system records this, the output will be a video file. Finally, I will merge the video file with the sound file to create the final file for the user.

    


    I came up with 2 possible solutions but both of them have problems which I am not able to solve at the moment.

    



    


    Solution #1

    


    Use a headless browser API such as Phantomjs or Puppeteer to snatch a screenshot x time every second and pipe it to FFmpeg.

    


    The problem

    


    The problem with this is that the process is not realtime. It would work fine if it's JUST an animation but mine is dependant on the audio file. The audio file will play-on during the render which results in a glitchy 1FPS-esque video.

    


    Possible solution ?

    


    Don't play the audio file live but convert the audio file into raw data. Animate the audio visualization based on the raw data instead.
Not sure how to do this and if it's even possible.

    



    


    Solution #2

    


    Play, record, and save the animation, all in the frontend.
Could use ccapture.js to record and save a canvas.
Use a headless browser to open the page and save it to disk when it's done playing.
Doesn't sound like it's the best solution.

    


    The problem(s)

    


    I have more than 1 canvas.
It takes a while, especially when the audio file is longer than 10 minutes.
Making users wait for a long time can be a deal-breaker.

    


    Possible solution ?

    


    Merge canvases into one.

    


    No idea how to speed up the rendering time and I doubt it's possible this way.