Recherche avancée

Médias (1)

Mot : - Tags -/stallman

Autres articles (77)

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

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

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

  • JavaCV FFmpegFrameGrabber preload audio

    1er juillet 2015, par James

    I have an application that streams video data to a RTMP server using javacv’s FFmpegFrameRecorder. I want to add some audio to this stream from a separate file - a short sound clip that I want to play on repeat.

    Given the sound clip is very short, I want to preload the audio data into memory and just loop over it - so I can avoid excessive IO etc.

    I’ve attempted to add audio to the stream using javacv’s FFmpegFrameGrabber, as prescribed on multiple tutorials.

    The addition of audio works perfectly if I don’t attempt to preload/cache any of the audio data, for example :

    private FFmpegFrameRecorder frameRecorder;
    private FFmpegFrameGrabber frameGrabber;

    ...
    //frameRecorder and frameGrabber setup during initialization
    ...

    public void record(IplImage image) {
           try {
               frameRecorder.record(image);
               Frame frame = frameGrabber.grabFrame();
               if(frame == null) {
                   frameGrabber = new FFmpegFrameGrabber("audioFileHere.wav");
                   frameGrabber.start();
                   frame = frameGrabber.grabFrame();
               }
               frameRecorder.record(frame);
           } catch (FrameRecorder.Exception e) {
               log.error(getMarker(FATAL), "Can't record frame!", e);
           } catch (FrameGrabber.Exception e) {
               log.error(getMarker(FATAL), "Can't record frame!", e);
           }
    }

    However, if I try to preload the audio data I get garbage sound being played :

    private FFmpegFrameRecorder frameRecorder;
    private List<framedata> audioData;

    private static final class FrameData {
       public final Buffer[] samples;
       public final Integer sampleRate;
       public final Integer audioChannels;

       //Constructors, getters and setters here
    }

    ...
       //frameRecorder setup during initialization
       audioData = new ArrayList&lt;>();
       FFmpegFrameGrabber audioGrabber = new FFmpegFrameGrabber("audioFileHere.wav");
       try {
           audioGrabber.start();
           Frame frame;
           while ((frame = audioGrabber.grabFrame()) != null) {
               Buffer[] buffers = frame.samples;
               Buffer[] copiedBuffers = new Buffer[buffers.length];
               for (int i = 0; i &lt; buffers.length; i++) {
                   copiedBuffers[i] = ((ShortBuffer) buffers[i]).duplicate();
               }
               FrameData frameData = new FrameData(copiedBuffers, frame.sampleRate, frame.audioChannels);
               audioData.add(frameData);
           }
       } catch (FrameGrabber.Exception e) {
           e.printStackTrace();
       }
    ...

    private int frameCount = 0;

    public void record(IplImage image) {
       frameCount++;
       try {
           FrameData frameData = audioData.get(frameCount % audioData.size());
           frameRecorder.record(image);
           frameRecorder.record(frameData.sampleRate, frameData.audioChannels, frameData.samples);
       } catch (FrameRecorder.Exception e) {
           log.error(getMarker(FATAL), "Can't record frame!", e);
       }
    }
    </framedata>

    NOTE : I have to deep copy the Frame object because FFmpegFrameGrabber.grabFrame() recycles a single Frame object

    Can someone explain why this doesn’t work and/or how I could achieve the desired result ?

  • FFMPEG & ScrollMagic : Safari bug

    27 novembre 2020, par gusv7

    I got this site where video playback is linked to scroll position. I'm using a FFMPEG-encoded .mp4 file and ScrollMagic to handle the scroll event. It works perfectly on Chrome, Opera and FF, but crashes on Safari : the animation is delayed and the video disappears once it reaches the end of the playback on Safari OS. It also doesn't show on iOS, not in Safari or Chrome... :/

    &#xA;

    Here's the markup :

    &#xA;

    <section class="shaka-container padding-x-lg flex-end">&#xA;  <div class="shaka">&#xA;    <video src="/assets/maozinha.mp4" type="video/mp4" playsinline="true"></video>&#xA;  </div>&#xA;</section>&#xA;

    &#xA;

    The JS :

    &#xA;

    &#xA;<code class="echappe-js">&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js&quot;&gt;&lt;/script&gt;&#xA;&#xA;&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.8/ScrollMagic.min.js&quot; integrity=&quot;sha512-8E3KZoPoZCD&amp;#x2B;1dgfqhPbejQBnQfBXe8FuwL4z/c8sTrgeDMFEnoyTlH3obB4/fV&amp;#x2B;6Sg0a0XF&amp;#x2B;L/6xS4Xx1fUEg==&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;&#xA;&#xA;&lt;script&gt;&amp;#xA;  // Shaka Animation&amp;#xA;    const intro = document.querySelector(&amp;#x27;.shaka&amp;#x27;);&amp;#xA;    const video = intro.querySelector(&amp;#x27;video&amp;#x27;);&amp;#xA;&amp;#xA;    // SCROLL MAGIC&amp;#xA;&amp;#xA;    const controller = new ScrollMagic.Controller();&amp;#xA;&amp;#xA;    // Scenes&amp;#xA;    const scene = new ScrollMagic.Scene({&amp;#xA;      duration: 0,&amp;#xA;      triggerElement: intro,&amp;#xA;      triggerHook: 0,   &amp;#xA;    })&amp;#xA;    .addTo(controller);&amp;#xA;&amp;#xA;    // Video Animation&amp;#xA;&amp;#xA;    let accelamount = 0.5;&amp;#xA;    let scrollpos = 0;&amp;#xA;    let delay = 0;&amp;#xA;&amp;#xA;    scene.on(&amp;#x27;update&amp;#x27;, e =&gt; {&amp;#xA;      scrollpos = e.scrollPos / 1000;&amp;#xA;    });&amp;#xA;&amp;#xA;    setInterval(() =&gt; {&amp;#xA;      delay &amp;#x2B;= (scrollpos - delay) * accelamount;&amp;#xA;      video.currentTime = delay;&amp;#xA;    }, 24);&amp;#xA;&lt;/script&gt;&#xA;

    &#xA;

    I wonder if the video encoding is the issue or how Safari processes the video playback ? I've used the following encoding for the video :

    &#xA;

    First :&#xA;ffmpeg -i ~/assets/mao-final.mp4 -vf scale=960:-2 -movflags faststart -vcodec libx264 -crf 20 -g 1 -pix_fmt yuv420p mao-final-960.mp4

    &#xA;

    Then,&#xA;ffmpeg -i ~/assets/mao-final.mp4 -vf scale=960:-2 -movflags faststart -vcodec libx264 -crf 20 -g 1 -pix_fmt yuv420p maozinha.mp4

    &#xA;

    I'm considering changing it to a canvas animation if I can't get to a solution. Please help !

    &#xA;

  • Anomalie #4546 (Nouveau) : image_recadre perd l’EXIF de rotation

    4 septembre 2020, par jluc -

    Alors que image_reduire propage les données EXIF de rotation, image_recadre les perd. Cela nuit grandement au rendu final.