Recherche avancée

Médias (91)

Autres articles (63)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (14216)

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

  • 24 cores, 25 ffmpeg session - cpu looks good but load average high

    9 août 2012, par thevoipman

    I don't know if it's my script or just the system itself, but I definitely don't want to take anything down.

    I am running a centos 6.3 64bit with about 25 sessions of ffmpeg encoding

    1. I am trying to speed up ffmpeg encoding, but it seems like whatever ram or cpu I have, the encoding process still take very long. I have used -threads 0 or even -threads 16 to see if it speed up but it doesn't.

    2. My load average is very high, how can I lower this without terminating ffmpeg tasks ?

    top - 19:33:28 up 13:09,  2 users,  load average: 161.95, 161.07, 161.02
    Tasks: 523 total,   3 running, 520 sleeping,   0 stopped,   0 zombie
    Cpu(s): 14.0%us,  1.1%sy, 84.4%ni,  0.1%id,  0.0%wa,  0.0%hi,  0.4%si,  0.0%st
    Mem:  65943668k total, 65676464k used,   267204k free,   137428k buffers
    Swap:  8388600k total,   170992k used,  8217608k free, 56438576k cached
    1. Here is my cpu usage :
     08/09/2012      _x86_64_        (24 CPU)

    07:34:15 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
    07:34:15 PM  all   10.83   86.27    0.55    0.03    0.00    0.14    0.00    0.00    2.19
    07:34:15 PM    0   18.68   69.92    5.82    0.39    0.00    3.22    0.00    0.00    1.97
    07:34:15 PM    1   11.11   86.26    0.45    0.02    0.00    0.00    0.00    0.00    2.16
    07:34:15 PM    2   11.07   86.34    0.42    0.02    0.00    0.00    0.00    0.00    2.17
    07:34:15 PM    3   10.89   86.50    0.43    0.02    0.00    0.00    0.00    0.00    2.16
    07:34:15 PM    4   11.05   86.31    0.45    0.02    0.00    0.00    0.00    0.00    2.17
    07:34:15 PM    5   11.07   86.34    0.41    0.01    0.00    0.00    0.00    0.00    2.16
    07:34:15 PM    6   12.79   84.56    0.48    0.06    0.00    0.07    0.00    0.00    2.05
    07:34:15 PM    7   11.32   86.34    0.18    0.01    0.00    0.00    0.00    0.00    2.15
    07:34:15 PM    8   11.49   86.15    0.18    0.01    0.00    0.00    0.00    0.00    2.17
    07:34:15 PM    9   11.95   85.67    0.19    0.01    0.00    0.00    0.00    0.00    2.18
    07:34:15 PM   10   11.73   85.90    0.19    0.01    0.00    0.00    0.00    0.00    2.18
    07:34:15 PM   11   11.56   86.08    0.18    0.01    0.00    0.00    0.00    0.00    2.17
    07:34:15 PM   12   13.59   82.43    1.33    0.09    0.00    0.00    0.00    0.00    2.56
    07:34:15 PM   13    8.72   88.76    0.29    0.02    0.00    0.00    0.00    0.00    2.21
    07:34:15 PM   14    8.84   88.67    0.28    0.02    0.00    0.00    0.00    0.00    2.20
    07:34:15 PM   15    8.76   88.71    0.32    0.02    0.00    0.00    0.00    0.00    2.19
    07:34:15 PM   16    8.73   88.75    0.29    0.02    0.00    0.00    0.00    0.00    2.21
    07:34:15 PM   17    8.76   88.75    0.26    0.02    0.00    0.00    0.00    0.00    2.21
    07:34:15 PM   18   10.35   87.16    0.24    0.02    0.00    0.00    0.00    0.00    2.23
    07:34:15 PM   19    9.16   88.48    0.17    0.01    0.00    0.00    0.00    0.00    2.17
    07:34:15 PM   20    9.45   88.19    0.18    0.01    0.00    0.00    0.00    0.00    2.18
    07:34:15 PM   21    9.62   88.01    0.17    0.01    0.00    0.00    0.00    0.00    2.20
    07:34:15 PM   22    9.73   87.88    0.17    0.01    0.00    0.00    0.00    0.00    2.20
    07:34:15 PM   23    9.44   88.21    0.16    0.01    0.00    0.00    0.00    0.00    2.18

    Please let me know if I'm seeing any trouble coming up if I keep on adding more ffmpeg's tasks

  • How to parse ffmpeg info in PHP ?

    29 mai 2013, par Jizbo Jonez

    How does one go about getting specific pieces of information, like the 'duration' from the output of ffmpeg -i /var/thismovie.avi ?

    I need frame height, frame width, duration of movie and frame rate. All of these are in the out put of the above command but how do i get the bits i need individually and put them in a variable in PHP ?

    I've given up on trying to install ffmpeg-php which is what I used before this to do the same job.

    Thanks

    ffmpeg -i /var/thismovie.avi produce an output like this

    ffmpeg version N-43171-ga763caf Copyright (c) 2000-2012 the FFmpeg developers built on Aug 3 2012 07:56:19 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52) configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-pic --enable-libx264 --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC libavutil 51. 66.100 / 51. 66.100 libavcodec 54. 48.100 / 54. 48.100 libavformat 54. 22.100 / 54. 22.100 libavdevice 54. 2.100 / 54. 2.100 libavfilter 3. 5.102 / 3. 5.102 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [avi @ 0x18e8e240] non-interleaved AVI [avi @ 0x18e8e240] max_analyze_duration 5000000 reached at 5000000 Input #0, avi, from &#39;/var/www/vhosts/mysite.com/httpdocs/movie.avi&#39;: Duration: 00:00:10.76, start: 0.000000, bitrate: 5180 kb/s Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 50 tbc Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, s16, 128 kb/s At least one output file must be specified`