Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (54)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (6649)

  • How to use command of ffmpeg on android

    23 janvier 2015, par user2830969

    I download ffmpeg static from http://ffmpeg.gusari.org/static/ and I run command

    ./ffmpeg -i inputFile.mp4 -vf drawtext="fontsize=60:fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-ascent" outputFile.mp4

    it work fine on my desktop.
    I want to use this command to run in android. I copy ffmpeg file to my android app to run command but it not work.

    public ProcessRunnable create() {
           if (inputPath == null || outputPath == null) {
               throw new IllegalStateException("Need an input and output filepath!");
           }  

           final List<string> cmd = new LinkedList<string>();
            public ProcessRunnable create() {
           if (inputPath == null || outputPath == null) {
               throw new IllegalStateException("Need an input and output filepath!");
           }  

           final List<string> cmd = new LinkedList<string>();

           cmd.add(mFfmpegPath);
           cmd.add("-i");
           cmd.add(inputPath);
           cmd.add("-vf");
           cmd.add("drawtext=\"fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-a
           cmd.add(mFfmpegPath);
           cmd.add("-i");
           cmd.add(inputPath);
           cmd.add("-vf");
           cmd.add("drawtext=\"fontsize=60:fontfile=/system/fonts/DroidSans.ttf:fontcolor=green:text=AAAA:x=(w-max_glyph_w)/2:y=h/2-ascent\"");
           cmd.add(outputPath);
           Log.w("Command", cmd.toString());
           final ProcessBuilder pb = new ProcessBuilder(cmd);
           return new ProcessRunnable(pb);
       }
    </string></string></string></string>

    please tell me know "How can I do that ?" thanks so much

  • Problems of using MediaCodec.getOutputFormat() for an encoder in Android 4.1/4.2 devices

    13 mars 2014, par Mark

    I'm trying to use MediaCodec to encode frames (either by camera or decoder) into a video.
    When processing the encoder output by dequeueOutputBuffer(), I expect to receive the return index = MediaCodec.INFO_OUTPUT_FORMAT_CHANGED, so I can call getOutputFormat() to get the encoder output format as the input of the currently used ffmpeg muxer.

    I have tested some pad/phone devices with Android version 4.1 4.3. All of them have at least one hardware video AVC encoder and is used in the test. On the devices with version 4.3, the encoder gives MediaCodec.INFO_OUTPUT_FORMAT_CHANGED before writing the encoded data as expected, and the output format returned from getOutputFormat() can be used by the muxer correctly. On the devices with 4.2.2 or lower, the encoder never gives MediaCodec.INFO_OUTPUT_FORMAT_CHANGED while it can still output the encoded elementary stream, but the muxer cannot know the exact output format.

    I want to ask the following questions :

    1. Does the behavior of encoder (gives MediaCodec.INFO_OUTPUT_FORMAT_CHANGED or not before outputing encoded data) depend on the Android API Level or the chips on individual devices ?
    2. If the encoder writes data before MediaCodec.INFO_OUTPUT_FORMAT_CHANGED appears, is there any way to get the output format of the encoded data ?
    3. The encoder still output the codec config data (with flag MediaCodec.BUFFER_FLAG_CODEC_CONFIG) on the devices before the encoded data. It is mostly used to config a decoder, but can I derive the output format by the codec config data ?

    I have tried these solutions to get the output format but failed :

    • Call getOutputFormat() frequently during the whole encode process. However, all of them throw IllegalStateException without the appearance of MediaCodec.INFO_OUTPUT_FORMAT_CHANGED.
    • Use the initial MediaFormat use to config the encoder at the beginning, like the example :

      m_init_encode_format = MediaFormat.createVideoFormat(m_encode_video_mime, m_frame_width, m_frame_height);
      int encode_bit_rate = 3000000;
      int encode_frame_rate = 15;
      int encode_iframe_interval = 2;

      m_init_encode_format.setInteger(MediaFormat.KEY_COLOR_FORMAT, m_encode_color_format);
      m_init_encode_format.setInteger(MediaFormat.KEY_BIT_RATE, encode_bit_rate);
      m_init_encode_format.setInteger(MediaFormat.KEY_FRAME_RATE, encode_frame_rate);
      m_init_encode_format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, encode_iframe_interval);

      m_encoder = MediaCodec.createByCodecName(m_video_encoder_codec_info.getName());
      m_encoder.configure(m_init_encode_format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);

      // Assume m_init_encode_format is the output format of the encoder

      However it fails since the output format of the encoder is still "changed" from the initial one.

    Please help me to realize the behavior of an encoder, and if there is any solution to query the output format if the required MediaCodec.INFO_OUTPUT_FORMAT_CHANGED is missing.


    By comparing the output format and the codec config data, the missing fields are csd-0, csd-1, and a "what" field with value = 1869968451.
    (I do not understand the "what" field. It seems to be a constant and is not required. Can anyone tell me about its meaning ?)

    If I parse the codec config data as the csd-1 field (last 8 bytes) and csd-0 field (remaining bytes), it seems that the muxer can work correctly and output a video playable on all of the testing devices.
    (But I want to ask : is this 8-byte assumption correct, or there is more reliable way to parse the data ?)

    However, I got another problem that If I decode the video by Android MediaCodec again, the BufferInfo.presentationTimeUs value get by dequeueOutputBuffer() is 0 for most of the decoded frames. Only the last few frames has correct time. The sample time get by MediaExtractor.getSampleTime() is correct and exactly the value I set to the encoder/muxer, but the decoded frame time is not. This issue only happen on 4.2.2 or lower device.

    It is strange that the frame time is incorrect but the video can be playback in correct speed on the device. (Most of the devices with 4.2.2 or lower I've tested has only 1 Video AVC decoder.) Do I need to set other fields that may affect the presentation time ?

  • ffmpeg not converting via PHP script

    16 mars 2014, par user3331834

    Essentially, I have this code :

    if(in_array($ext,$audio)&amp;&amp;($ext!=="flac")){
       exec("ffmpeg -i -loglevel &#39;verbose&#39; ".$fileName.".".$ext." ".$fileName.".flac null >/dev/null 2>/var/www/resources/ffmpegAudio.log &amp;",$ffmpegOutput);
       print_r($ffmpegOutput);
       $editApproveStatus="Audio entry approved. File converted.";
    }

    Ultimately, my goal is to convert files and show a live progress of the conversion (or at least something that updates every few seconds), and running in the background, so that the same page can be used to convert further files.

    Now I'm already stuck, because the conversion just isn't working. I know that the preceding code should be fine, since it makes it all the way to this if statement above, and no errors are being throw up by the PHP. However, my log output shows :

    ffmpeg version 0.8.10-6:0.8.10-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
     built on Feb  6 2014 20:59:46 with gcc 4.8.1
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    -loglevel: No such file or directory

    Which also leads me to another question : If ffmpeg is deprecated, and avconv is the way to do, can I still use the exec code in my PHP as is (replacing the ffmpeg bit with avconv) ? From what I've seen so far on the avconv page, it looks similar, but I can't be certain that it's exactly the same.

    So my two questions : Why isn't the file being converted, and is there any change in the syntax between avconv and ffmpeg ?