Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (52)

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

  • Building FFmpeg for android to run command line args

    11 septembre 2012, par Zargoon

    I am trying to build the FFmpeg library to use in my android app with the NDK. The reason for this is because I am using the native video capture feature in android because I really don't want to write my own video recorder. However, the native video capture only allows for either high-quality encoding, or low quality encoding. I want something in between, and I believe that the solution is to use the FFmpeg library to re-encode the high quality video to be lighter.

    So far I have been able to build the FFmpeg library according to this guide : http://www.roman10.net/how-to-build-ffmpeg-for-android/ and which a few tweaks I have been able to get it to work.

    However, everything that I've found seems to be about writing your own encoder, which seems like overkill to me. All that I really want to do is send a string in command line format to the main() function of FFmpeg and re-encode my video. However, I can't seem to figure out how I build FFmpeg to give me access to the main method. I found this post : Compile ffmpeg.c and call its main() via JNI which links to a project doing what I want more of less, but for the life of me I cannot figure out what is going on. It also seems like he is compiling more than I want, and I would really like to keep my application as light weight as possible.

    Some additional direction would be extremely helpful. Thank you.

  • Decoding audio w/ ffmpeg error on Android

    14 août 2012, par stranded

    Well, I knew I was going out of my comfort zone when I decided to try and decode audio using ffmpeg on Android but now I will have to admit that I'm stranded.
    It took me many days to just build ffmpeg for Android. Roman's10 guide did not work for me but finally things started looking up, thanks to this tutorial. So because of Dmitry's help I managed to build the armeabi version (not armeabi-v7) for my phone (LG P500) and everything basic works.

    But when I try to use avcodec_decode_audio3() things go downhill :( Never before have I felt so close to making things work (after all it seems to be only one line that is troublesome)
    but unable to though. I've read many questions here on SO that have brought me closer to the goal. Googling, on the other hand, has had limited results - making questions here the only fruit.

    Yes, I know ! I ramble. But I can't help it, I'm only trying to explain in detail where I'm stuck and how I got there. So without further ado I bring you the code :

    NATIVE CODE :

    #include
    #include <android></android>log.h>

    #include "libavcodec/avcodec.h"
    #include "libavformat/avformat.h"

    #define LOG_TAG "mylib"
    #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
    #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

    #define INBUFF_SIZE 4096
    #define AUDIO_INBUFF 20480
    #define AUDIO_REFILL_SIZE 4096

    jint Java_com_nothingworks_for_me_MainActivity_decode(JNIEnv * env, jobject this, jstring jfilename){
       const char *filename = (*env)->GetStringUTFChars(env, jfilename, NULL);
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int audioStream;
       int out_size, len, i;
       FILE *f, *outfile;
       uint8_t *outbuf;
       uint8_t inbuf[AUDIO_INBUFF + FF_INPUT_BUFFER_PADDING_SIZE];
       AVPacket avpkt;
       AVFormatContext *pFormatCtx;

       av_register_all();
       avcodec_init();
       av_init_packet(&amp;avpkt);

       if(av_open_input_file(&amp;pFormatCtx, filename, NULL, 0, NULL)!=0)
       {
           LOGE("Can&#39;t open file &#39;%s&#39;\n", filename);
           return 1;
       }
       else
       {
           LOGI("File was opened\n");
           LOGI("File &#39;%s&#39;, Codec %s",
                   pFormatCtx->filename,
                   pFormatCtx->iformat->name
           );
       }

       if (av_find_stream_info(pFormatCtx) &lt; 0){
           LOGE("Can&#39;t find stream info");
       }
       audioStream = -1;
       for (i = 0; i &lt; pFormatCtx->nb_streams; i++) {
           if (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO) {
               audioStream = i;
               break;
           }
       }

       if (audioStream == -1) {
           LOGE("Didn&#39;t find stream!");
       }
       c = pFormatCtx->streams[audioStream]->codec;

       codec = avcodec_find_decoder(c->codec_id);
       if (!codec) {
           LOGE("Unsupported Codec!");
       }

       c= avcodec_alloc_context();

       /* open it */
       if (avcodec_open(c, codec) &lt; 0) {
           LOGE("Can&#39;t open codec");
           exit(1);
       }

       outbuf = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE * 2);

       f = fopen(filename, "rb");
       if (!f) {
           LOGE("Can&#39;t open file");
           exit(1);
       }

       /* decode until eof */
       avpkt.data = inbuf;
       avpkt.size = fread(inbuf, 1, AUDIO_INBUFF, f);
       LOGI("avpkt.size %d", avpkt.size);

       while (avpkt.size > 0) {
           out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE * 2;

    THINGS GO WRONG HERE ! avcodec_decode_audio3() The code continues from ▲ to ▼ :

           len = avcodec_decode_audio3(c, (int16_t *)outbuf, &amp;out_size, &amp;avpkt);
           LOGI("data_size %d len %d", out_size, len);
           if (len &lt; 0) {
               LOGE("Error while decoding");
               exit(1);
           }
           if (out_size > 0) {

           }
           avpkt.size -= len;
           avpkt.data += len;
           if (avpkt.size &lt; AUDIO_REFILL_SIZE) {
               /* Refill the input buffer, to avoid trying to decode
                * incomplete frames. Instead of this, one could also use
                * a parser, or use a proper container format through
                * libavformat. */
               memmove(inbuf, avpkt.data, avpkt.size);
               avpkt.data = inbuf;
               len = fread(avpkt.data + avpkt.size, 1,
                       AUDIO_INBUFF - avpkt.size, f);
               if (len > 0)
                   avpkt.size += len;
           }
       }
       fclose(f);
       free(outbuf);

       avcodec_close(c);
       av_free(c);
       return 0;
    }

    What happens is that avcodec_decode_audio3() returns -1 and that's pretty much it :(
    I have no idea what to do next. I can't find much info about this and I only started fiddling with C less than two weeks ago so your guidance is my only hope now [play dramatic sound]. Hope someone can shed a little light on this mystery.

    Ohh ! And the native code is some kind of a hybrid between what I have found here on SO, like this and this, and the ffmpeg example. On the java side I only have a call to this native method and pass it string which is the path to a MP3 song on my droid. I don't use AudioTrack or anything else in my java code yet 'cause I'm only trying to get the decoding to work for now.

    -Drama Queen OUT !

  • Streaming images with ffmpeg gives shorter video

    24 juin 2014, par darko_5

    I am streaming a video form my camera by passing to ffmpeg images from that camera. I am using command :

    ffmpeg -r 26 -re -f image2pipe -vcodec mjpeg -i - -c:v libx264 -f flv -preset ultrafast -s hd720 -maxrate 2000k -bufsize 150k rtmp://someaddress:port

    My problem is that, when light is weak and/or computer is slow my fps number is getting lower, even so i set it to -r 26. Low fps causing that video playad on web side is sometimes in fast motion and file i save to disk is shorter than it should.
    My opereting system is OS X. How can i do it so the video i s in proper speed.