Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (84)

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

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

Sur d’autres sites (4591)

  • avformat_open_input fails intermittently with avfoundation due to "audio format is not supported"

    27 septembre 2019, par NaderNader

    My application uses the ffmpeg APIs (avformat, avdevice, etc) to open a selected audio input for encoding. For some inputs I can reliably open them the first time, but when I close and reopen that input later, the avformat_open_input() call fails due to "audio format is not supported". My testing shows that it never fails the first time after starting my, and has only about a 50% chance of success when reopening.

    The failure only occurs with my "Built-in Microphone" audio input. I have a USB audio card that reliably opens and closes repeatedly. I have read the documentation and see that the proper way to free the resources after opening is to call avformat_close_input. The only way I have found to guarantee success is to only open the input once.

    I have written a test program to recreate these failures.

    int main() {

       avdevice_register_all();

       cout << "Running open audio test" << endl;


       int i;
       for(i = 0; i< 10; i++) {

           AVDictionary* options = NULL;
           AVInputFormat* inputFormat = av_find_input_format("avfoundation");
           if (!inputFormat) {
               cout << "avfoundation inputFormat=null" << endl;
           }

           AVFormatContext* formatContext = avformat_alloc_context();
           int result = avformat_open_input(&formatContext, ":1", inputFormat, &options);
           if (result < 0) {
               char error[256];
               av_strerror(result, error, sizeof(error));
               cout << "result=" << result << " " << error << endl;
           } else {
               cout << "input opened successfully" << endl;
           }

           sleep(1);

           avformat_close_input(&formatContext);

           sleep(1);

       }

       return 0;
    }

    I would expect the main loop to succeed each time but a typical output shows a high failure rate :

    Running open audio test

    input opened successfully
    [avfoundation @ 0x7fdeb281de00] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully
    input opened successfully
    [avfoundation @ 0x7fdeb2068800] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully

    I have tried increasing the sleep time between close and open to 5 seconds, but saw no difference in behavior.

    The source of the failure is https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/avfoundation.m#L672

    It appears avfoundation.m internally is opening an input stream and grabbing an audio frame to determine the format, but the value returned is not valid sometimes, when the process has previously opened and closed that input.

    Am I not closing the resources properly ? Do I have a hardware issue specific to my macbook ?

    Additional Details :

    Tested MacBook Pro with MacOS Mojave 10.14.6
    Tested with Ffmpeg 3.4.1, 4.0, and 4.1

    list_devices :

    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation video devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7f80fff066c0] [1] Capture screen 0
    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation audio devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] Behringer Duplex
    [AVFoundation input device @ 0x7f80fff066c0] [1] Built-in Microphone
    [AVFoundation input device @ 0x7f80fff066c0] [2] USB Audio CODEC
  • avformat_open_input for 24-bit audio fails intermittently with avfoundation due to "audio format is not supported"

    27 septembre 2019, par NaderNader

    My application uses the ffmpeg APIs (avformat, avdevice, etc) to open a selected audio input for encoding. For audio inputs configured for 24-bit I can reliably open them the first time, but when I close and reopen that input later, the avformat_open_input() call fails due to "audio format is not supported". My testing shows that it never fails the first time after starting my, and has only about a 50% chance of success when reopening.

    The failure only occurs when I configure my "Built-in Microphone" audio input for 24-bit integer. 16-bit integer and 32-bit float work reliably. Changing the number of channels and sample rate has no effect.

    I have read the documentation and see that the proper way to free the resources after opening is to call avformat_close_input. The only way I have found to guarantee success is to only open the input once.

    I have written a test program to recreate these failures.

    int main() {

       avdevice_register_all();

       cout << "Running open audio test" << endl;


       int i;
       for(i = 0; i< 10; i++) {

           AVDictionary* options = NULL;
           AVInputFormat* inputFormat = av_find_input_format("avfoundation");
           if (!inputFormat) {
               cout << "avfoundation inputFormat=null" << endl;
           }

           AVFormatContext* formatContext = avformat_alloc_context();
           int result = avformat_open_input(&formatContext, ":1", inputFormat, &options);
           if (result < 0) {
               char error[256];
               av_strerror(result, error, sizeof(error));
               cout << "result=" << result << " " << error << endl;
           } else {
               cout << "input opened successfully" << endl;
           }

           sleep(1);

           avformat_close_input(&formatContext);

           sleep(1);

       }

       return 0;
    }

    I would expect the main loop to succeed each time but a typical output shows a high failure rate :

    Running open audio test

    input opened successfully
    [avfoundation @ 0x7fdeb281de00] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully
    input opened successfully
    [avfoundation @ 0x7fdeb2068800] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully

    I have tried increasing the sleep time between close and open to 5 seconds, but saw no difference in behavior. While this program runs, I can use the MacOS Audio MIDI Setup to change the microphone input configuration and watch the output change from all success to intermittent errors.

    The source of the failure is https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/avfoundation.m#L672

    It appears avfoundation.m internally is opening an input stream and grabbing an audio frame to determine the format, but the value returned is not valid sometimes, when the process has previously opened and closed that input.

    Am I not closing the resources properly ? Do I have a hardware issue specific to my macbook ?

    Additional Details :

    Tested MacBook Pro with MacOS Mojave 10.14.6
    Tested with Ffmpeg 3.4.1, 4.0, and 4.1

    list_devices :

    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation video devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7f80fff066c0] [1] Capture screen 0
    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation audio devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] Behringer Duplex
    [AVFoundation input device @ 0x7f80fff066c0] [1] Built-in Microphone
    [AVFoundation input device @ 0x7f80fff066c0] [2] USB Audio CODEC
  • avformat/matroskadec : Fix use-after-free when demuxing ProRes

    7 décembre 2019, par Andreas Rheinhardt
    avformat/matroskadec : Fix use-after-free when demuxing ProRes
    

    ProRes in Matroska is supposed to not contain the first atom header
    (containing a size field and the tag "icpf") and therefore the Matroska
    demuxer has to recreate it ; this involves an allocation and copy, of
    course. Whether the old buffer (containing the data without the atom
    header) needs to be freed or not depends upon whether it is what was
    directly read (in which case it is owned by an AVBuffer) or whether it
    has been allocated when reversing the track's content compression (e.g.
    zlib compression) that Matroska supports.

    So there are three pointers involved : The one pointing to the directly
    read data (owned by the AVBuffer), the one pointing to the currently
    valid data (which coincides with the former if no content compression
    needed to be reverted) and the one pointing to the new data with the
    first atom header. The check for whether to free the second of these is
    simply whether the first two are different.

    This works mostly, but there is a complication : Some muxers don't strip
    the first atom header away and in this case, it is also not reinserted
    and no new buffer is allocated ; instead, the second and the third
    pointers agree. In this case, one must never free the second buffer.
    Yet it is currently done if the track is e.g. zlib compressed.
    This commit fixes this.

    This is a regression since b8e75a2a.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavformat/matroskadec.c