Recherche avancée

Médias (91)

Autres articles (72)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (13348)

  • How to record/trim/combine audio seamlessly in a React/Node web app

    16 mai 2021, par Rayhan Memon

    I've developed a digital audio workstation for the browser that you can check out here. Essentially it helps authors narrate their own audiobooks themselves at home.

    


    I'm looking to dramatically improve the speed at which audio files are combined or trimmed.

    


    Right now, the user records some variable amount of audio (a line, paragraph, or entire passage). When the user stops recording, this clip is added to the main audio file for the section using ffmpeg.wasm like so :

    


            if (duration === 0) {
            //concatenate the two files (they should already be written to memory)
            await ffmpeg.run('-i', 'concat:fullAudio.mp3|clip.mp3', '-c', 'copy', 'fullAudio.mp3');

        } else {
            //Set the insert time to wherever the user's cursor is positioned
            let insertTime = duration;
            if (selectedObj) {
                insertTime = selectedObj.endTime;
            }

            //split the audio file into two parts at the point we want to insert the audio
            await ffmpeg.run('-i', 'fullAudio.mp3', '-t', `${insertTime}`, '-c', 'copy', 'part1.mp3', '-ss',  `${insertTime}`, '-codec', 'copy', 'part2.mp3');

            //concatenate the three files
            await ffmpeg.run('-i', 'concat:part1.mp3|clip.mp3', '-acodec', 'copy', 'intermediate.mp3');
            await ffmpeg.run('-i', 'concat:intermediate.mp3|part2.mp3', '-acodec', 'copy', 'fullAudio.mp3');
        }

        //Read the result from memory
        const data = ffmpeg.FS('readFile', 'fullAudio.mp3');

        //Create URL so it can be used in the browser
        const url = URL.createObjectURL(new Blob([data.buffer], { type: 'audio/mp3' }));
        globalDispatch({ type: "setFullAudioURL", payload: url });


    


    After every recorded clip, the user is forced to wait a few seconds for this concatenation process to finish up - and the longer the main file or recorded clip gets, the longer the user has to wait. Looking at other browser-based audio editors such as AudioMass, it clearly seems possible to make a seamless recording and editing experience with zero wait time, but I can't seem to figure out how to do the same within my react app.

    


    Is it possible to seamlessly combine or trim audio data within a React app ? Is FFMPEG the best way to go about it, or are there simpler ways using pure javascript ?

    


  • MoviePy, using a gif as an ImageClip ?

    13 avril 2018, par Slake

    Using a gif inside an ImageClip doesn’t work, is it a normal behavior ?

    The code

    #!/usr/bin/env python
    from moviepy.editor import *

    video = VideoFileClip('./video.mp4')
    watermark = (ImageClip("./my.gif")
                           .set_duration(10))

    watermaked = CompositeVideoClip([video, watermark], size=video.size)
    watermaked.write_videofile('./gif_output.mp4', fps=30, threads=1)

    .

    The error

    ValueError: could not broadcast input array from shape (150,150) into shape (150,150,3)

    .

    The stack error

    Traceback (most recent call last):
     File "./gif_test.py", line 9, in <module>
       watermaked.write_videofile('./gif_output.mp4', fps=30, threads=1)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 54, in requires_duration
       return f(clip, *a, **k)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 137, in use_clip_fps_by_default
       return f(clip, *new_a, **new_kw)
     File "", line 2, in write_videofile
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
       return f(clip, *a, **k)
     File "/Library/Python/2.7/site-packages/moviepy/video/VideoClip.py", line 349, in write_videofile
       progress_bar=progress_bar)
     File "/Library/Python/2.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 209, in ffmpeg_write_video
       fps=fps, dtype="uint8"):
     File "/Library/Python/2.7/site-packages/tqdm/_tqdm.py", line 833, in __iter__
       for obj in iterable:
     File "/Library/Python/2.7/site-packages/moviepy/Clip.py", line 475, in generator
       frame = self.get_frame(t)
     File "", line 2, in get_frame
     File "/Library/Python/2.7/site-packages/moviepy/decorators.py", line 89, in wrapper
       return f(*new_a, **new_kw)
     File "/Library/Python/2.7/site-packages/moviepy/Clip.py", line 95, in get_frame
       return self.make_frame(t)
     File "/Library/Python/2.7/site-packages/moviepy/video/compositing/CompositeVideoClip.py", line 110, in make_frame
       f = c.blit_on(f, t)
     File "/Library/Python/2.7/site-packages/moviepy/video/VideoClip.py", line 611, in blit_on
       return blit(img, picture, pos, mask=mask, ismask=self.ismask)
     File "/Library/Python/2.7/site-packages/moviepy/video/tools/drawing.py", line 45, in blit
       new_im2[yp1:yp2, xp1:xp2] = blitted
    ValueError: could not broadcast input array from shape (150,150) into shape (150,150,3)
    </module>
  • Moviepy V2 How do you position a TextClip and apply an effect ?

    31 janvier, par Brandon

    I am trying to refactor my code to use the new Moviepy Version 2.0 and I'm having trouble with .with_position / SlideIn / SlideOut effect.

    &#xA;

    When I apply the SlideIn effect it seems to override any position I have applied. It there a way to explicitly set the position of a TextClip and apply a SlideIn and SlideOut effect without using nested CompositeVideoClip ?

    &#xA;

    In the below example the with_position((0,0)) would not be implemented and the position of the TextClip would revert to the default centred position. If I remove the lines .with_effect... then the TextClip would be positioned as expected in the 0,0 location.

    &#xA;

    Any help would be much appreciated.

    &#xA;

    from moviepy import *&#xA;&#xA;clips = []&#xA;clip = ImageClip("path1.png", duration=3).with_start(0)&#xA;clips.append(clip)&#xA;title = TextClip("path3.ttf", text="Text...", font_size=80, color="#fff", text_align="center", duration=1,)&#xA;title = title.with_start(1).with_position((0,0))&#xA;title = title.with_effects([vfx.SlideIn(0.25, "left")])&#xA;title = title.with_effects([vfx.SlideOut(0.25, "left")])&#xA;clips.append(title)&#xA;&#xA;final_clip = CompositeVideoClip(clips)&#xA;final_clip.write_videofile("final_clip.mp4")&#xA;

    &#xA;

    *EDIT&#xA;To get the expected behaviour I need to use multiple nested CompositeVideoClips but this significantly slows it down. Is there anyway that I can make this code more efficient ?

    &#xA;

    from moviepy import *&#xA;&#xA;clips = []&#xA;clip = ImageClip("path1.png", duration=3).with_start(0)&#xA;clips.append(clip)&#xA;title = TextClip("path3.ttf", text="Text...", font_size=80, color="#fff", text_align="center", duration=1,)&#xA;title = CompositeVideoClip(title.with_effects([vfx.SlideIn(0.25, "left")]))&#xA;title = CompositeVideoClip(title.with_effects([vfx.SlideOut(0.25, "left")]))&#xA;title = title.with_start(1).with_position((0,0))&#xA;clips.append(title)&#xA;&#xA;final_clip = CompositeVideoClip(clips)&#xA;final_clip.write_videofile("final_clip.mp4")&#xA;

    &#xA;