Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (100)

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

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

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

Sur d’autres sites (14657)

  • FFMPEG Replacing black color fragments with alpha channel transparency

    31 décembre 2017, par kostya572

    I have file.mov video. It has a lot of blank black color fragments that have different durations.

    I need to replace black color fragments that show up for more than 5 seconds with transparency. Is that possible to add some alpha channel for that purpose ?

    Comment to Mulvya’s answer :

    Amazing solution. With #2 section everything ok.

    With #1 section I created this code :

    output=$(ffprobe -f lavfi -i "movie=file.mov,blackdetect=d=3.5" -show_entries tags=lavfi.black_start,lavfi.black_end -of compact=p=0 -v 0|awk '!/^$/')
    echo $output

    using awk '!/^$/' to remove empty lines.

    Here is the output I get :

    output

    tag:lavfi.black_start repeats with same value several times, not having right structure with closing tag:lavfi.black_end

    If I change blackdetect=d=3.5 to other value, for exaple d=10, it outputs the same result as d=3.5. How could I solve this issue having right tag:lavfi.black_start,tag:lavfi.black_end synthax with correct grepping d= value ?

  • 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
  • Split a video in two and burn subtitles into each output video

    11 février, par Kairei

    I want to split a single input video "input.mp4" into two separate videos "out1.mp4" and "out2.mp4." I also want to burn hard subtitles into each of the output files. The subtitles come from two pre-existing subtitle files "subtitles1.ass" and "subtitles2.ass." I tried just adding -vf "ass=subtitles1.ass" and -vf "ass=subtitles2.ass" before each of the output files. Subtitles from subtitles1.ass were added to out1.mp4 but out2.mp4 had no subtitles. I spent hours reading docs and trying things and realized I probably need a complex filter and mapping so came up with this :

    


    ffmpeg.exe -i "input.mp4" -filter_complex "[0:v]split=2[in1][in2];[in1]ass=subtitles1.ass[out1];[in2]ass=subtitles2.ass[out2]" -map "[out1]" -map 0:a -ss 0:00:00.00 -to 0:01:00.00 "C:\out1.mp4" -map "[out2]" -map 0:a -ss 0:01:00.00 -to 0:02:00.00 "C:\out2.mp4"

    


    ... which I think means "Take the input file, split it into two "input pads," send input pad 1 through the subtitle filter with parameter subtitles1.ass and send input pad 2 through the subtitle filter with parameter subtitles2.ass. The two then come out to output pads out1 and out2. I then map out1 (which has the video with burned in subtitles) and also map the audio from the input file, and send the first hour of the video to out1.mp4. I do the same thing for output pad out2 and try to get the second hour of video with subtitles from subtitiles2.ass.

    


    I do get out1.mp4 with the first hour of video and audio and properly burned in subtitles. Unfortunately, out2.mp4 has the correct second hour of video and audio but no subtitles. Am I missing something to get subtitles2.ass burned into out2.mp4 ?