Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (103)

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

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (11605)

  • Convert audio to MP3 : 4 frames left in the queue on closing

    21 août 2024, par Vololodymyr

    I am trying to convert AMR audio to MP3 :

    


            ByteArrayInputStream amrStream = new ByteArrayInputStream(amrData);
        ByteArrayOutputStream mp3Stream = new ByteArrayOutputStream();

        try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(amrStream);
             FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(mp3Stream, grabber.getAudioChannels())) {
            
            grabber.setFormat("amr");
            grabber.start();

            recorder.setFormat("mp3");
            int sampleRate = grabber.getSampleRate();

            recorder.setSampleRate( sampleRate < MIN_SAMPLE_RATE ? MIN_SAMPLE_RATE : sampleRate);
            recorder.setAudioChannels(grabber.getAudioChannels());

            // The AMR low bitrate sounds better then same bitrate on mp3, so we increase it
            int bitrate = grabber.getAudioBitrate();
            recorder.setAudioBitrate(bitrate < MIN_BITRATE ? MIN_BITRATE : bitrate);
            recorder.start();

            Frame frame;
            while ((frame = grabber.grab()) != null) {
                if (frame.samples != null) {
                    recorder.record(frame);
                }
            }
            recorder.flush();
            recorder.release();
            grabber.release();
            recorder.stop();
            grabber.stop();
        } catch (Exception e) {
            throw new IOException("Failed to convert AMR to MP3", e);
        }


    


    For some reason, the output mp3 file is always cut for half of a second.

    


    And in logs, I can see :
[libmp3lame @ 000002106e0b26c0] 4 frames left in the queue on closing

    


    Any ideas on how I can flush those 4 frames to my output steam ?
I tried flushing with Thread.sleep(), other order of release/stop calls, nothing works.

    


  • FFMpeg jni in Android ?

    4 février 2014, par Whyhow

    I have built FFMPEG executables and libraries as provided by Bambuser (http://bambuser.com/opensource). So I managed to build the Android executables and libraties. How can I link these libs in my Eclipse project and invoke the FFmpeg functions from Java ? The open source code includes the C header-files.

    I am new to native coding for Android, and I could not find an easy answer for this. In basic : having a bunch of Android compatible libraries and some C header files what do I have to do to reuse those libaries' functionality from java (+Android SDK) ?

    Any help would be appreciated.

    Kind regards,

    WhyHow

  • Feeding raw image bytes into ffmpeg rawvideo fails with Invalid buffer size on linux only

    13 février 2021, par cherouvim

    I have a nodejs program which generates raw (rgb24) image(s), which I then pipe into ffmpeg so it saves as png or mp4. My code looks like this :

    


    const fs = require("fs");
// ...
const outputBuffer = Buffer.alloc(outputPngWidth * 3 * outputPngHeight);
// ... write data into outputBuffer
fs.writeSync(process.stdout.fd, outputBuffer);


    


    I then do the following in CLI :

    


    node generate | ffmpeg -f rawvideo -pixel_format rgb24 -video_size 1000x1000 -i - test.png


    


    Alternatively, if I generate lots of images from my program, I do this to generate the video file :

    


    node generate | ffmpeg -f rawvideo -pixel_format rgb24 -video_size 1000x1000 -r 60 -i - -codec:v libx265 test.mp4


    


    On windows this works flawlessly. On linux (either on Ubuntu 20 VM, or Ubuntu 20 installed directly on a physical machine), it consistently fails with :

    


    pipe:: corrupt input packet in stream 0
[rawvideo @ 0x55f5256c8040] Invalid buffer size, packet size 65536 < expected frame_size 3000000
Error while decoding stream #0:0: Invalid argument


    


    If I split this in 2 phases like so, then it works perfectly on linux as well :

    


    node generate > test.raw
cat test.raw | ffmpeg -f rawvideo -pixel_format rgb24 -video_size 1000x1000 -i - test.png


    


    By looking at the error "packet size 65536 < expected frame_size 3000000" it seems that node's fs.writeSync only sends 65536 bytes at a time, but ffmpeg expects 3000000 bytes (that is 1000 width * 1000 height * 3 channels).

    &#xA;

    If I reduce my image size to something small, e.g 50x50 or 100x100, then it works. As soon as x * y * 3 exceeds 65536, it fails (eg. 160x160 fails with "packet size 65536 < expected frame_size 76800" because 160 * 160 * 3 = 76800).

    &#xA;

    What I've tried so far to solve the issue without luck :

    &#xA;

      &#xA;
    • Force node to spit out the whole buffer at once :
    • &#xA;

    &#xA;

    fs.writeSync(process.stdout.fd, outputBuffer, 0, outputBuffer.length);&#xA;

    &#xA;

    &#xA;

    Is there a way to overcome this ?

    &#xA;