Recherche avancée

Médias (91)

Autres articles (50)

  • Participer à sa documentation

    10 avril 2011

    La documentation est un des travaux les plus importants et les plus contraignants lors de la réalisation d’un outil technique.
    Tout apport extérieur à ce sujet est primordial : la critique de l’existant ; la participation à la rédaction d’articles orientés : utilisateur (administrateur de MediaSPIP ou simplement producteur de contenu) ; développeur ; la création de screencasts d’explication ; la traduction de la documentation dans une nouvelle langue ;
    Pour ce faire, vous pouvez vous inscrire sur (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (5606)

  • Decoder crashes after ffmpeg upgrade

    5 mai 2014, par Igor R.

    Recently I upgraded ffmpeg from 0.9 to 1.0 (tested on Win7x64 and on iOS), and now avcodec_decode_video2 seagfaults. Long story short : the crash occurs every time the video dimensions change (eg. from 320x240 to 160x120 or vice versa).

    I receive mpeg4 video stream from some proprietary source and decode it like this :

    // once, during initialization:
    AVCodec *codec_ = avcodec_find_decoder(CODEC_ID_MPEG4);
    AVCodecContext ctx_ = avcodec_alloc_context3(codec_);
    avcodec_open2(ctx_, codec_, 0);
    AVPacket packet_;
    av_init_packet(&packet_);
    AVFrame picture_ = avcodec_alloc_frame();

    // on every frame:
    int got_picture;
    packet_.size = size;
    packet_.data = (uint8_t *)buffer;
    avcodec_decode_video2(ctx_, picture_, &got_picture, &packet_);

    Again, all the above had worked flawlessly until I upgraded to 1.0. Now every time the frame dimensions change - avcodec_decode_video2 crashes. Note that I don’t assign width/height in AVCodecContext - neither in the beginning, nor when the stream changes - can it be the reason ?

    I’d appreciate any idea !

    Update : setting ctx_.width and ctx_.height doesn’t help.

    Update2 : just before the crash I get the following log messages :

    mpeg4, level 24 : "Found 2 unreleased buffers !".
    level 8 : "Assertion i < avci->buffer_count failed at libavcodec/utils.c:603"

    Update3 upgrading to 1.1.2 fixed this crash. The decoder is able again to cope with dimensions change on the fly.

  • Decode AAC to PCM with ffmpeg on android

    26 novembre 2012, par JeffG

    I have built ffmpeg 0.8.12 (love) with the android NDK (r8c) on ubuntu.
    I then use the generated library in another android application through JNI.

    Essentially what I want to do is pass a byte stream from java to my c jni function and use ffmpeg to decode it into a PCM audio buffer which will then be passed back to java to be played using Android's AudioTrack. I can successfully pass the buffer through to jni (have checked the values) and ffmpeg seems to initialise correctly, but when it tries to decode the first frame, it throws an error in the aac_decode_frame_int method in aacdec.c "channel element 0.0 is not allocated". The aac file plays fine and is valid.

    Here is my jni code to do the decoding

    jint Java_com_example_testffmpeg_MainActivity_decodeAacBytes(JNIEnv * env,
           jobject this, jbyteArray input, jint numBytes) {

       //copy bytes from java
       jbyte* bufferPtr = (*env)->GetByteArrayElements(env, input, NULL);
       uint8_t inputBytes[numBytes + FF_INPUT_BUFFER_PADDING_SIZE];
       memset(inputBytes, 0, numBytes + FF_INPUT_BUFFER_PADDING_SIZE);
       memcpy(inputBytes, bufferPtr, numBytes);
       (*env)->ReleaseByteArrayElements(env, input, bufferPtr, 0);

       av_register_all();

       AVCodec *codec = avcodec_find_decoder(CODEC_ID_AAC);

       if (codec == NULL) {
           LOGE("Cant find AAC codec\n");
           return 0;
       }
       LOGI("AAC codec found\n");

       AVCodecContext *avCtx = avcodec_alloc_context();

       if (avCtx == NULL) {
           LOGE("Could not allocate codec context\n");
           return 0;
       }
       LOGI("codec context allocated\n");

       if (avcodec_open2(avCtx, codec, NULL) &lt; 0) {
           LOGE("Could not open codec\n");
           return 0;
       }
       LOGI("AAC codec opened");

       //the input buffer
       AVPacket avPacket;
       av_init_packet(&amp;avPacket);

       LOGI("AVPacket initialised\n");

       avPacket.size = numBytes; //input buffer size
       avPacket.data = inputBytes; // the input buffer

       int outSize;
       int len;
       uint8_t *outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);

       while (avPacket.size > 0) {
           outSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
           len = avcodec_decode_audio3(avCtx, (short *) outbuf, &amp;outSize,
                   &amp;avPacket);

           if (len &lt; 0) {
               LOGE("Error while decoding\n");
               return 0;
           }

           if (outSize > 0) {
               LOGI("Decoded some stuff\n");
           }

           avPacket.size -= len;
           avPacket.data += len;
       }

       LOGI("Freeing memory\n");

       av_free_packet(&amp;avPacket);
       avcodec_close(avCtx);
       av_free(avCtx);

       return 0;
    }

    The problem occurs in the call to avcodec_decode_audio3, when the decoding first occurs. I have stepped through the ffmpeg code, but can't find the problem. Any help would be greatly appreciated !

  • Using FFMPEG and url_fopen example

    2 novembre 2012, par Blender

    I wonder how to get a stream from a URL (with url_fopen for example) (live video or PCM stream for example) and encode it into something ?

    Update :
    This actually was a mall formated question. It was about how to stream something out using url_fopen.

    Answer :
    It is quite simple :
    There is like a short article explaining how to use it
    And I had a small video streaming solution which actually used it and url_write called HelloVideoStreaming (windows sln) some many revisions ago.

    Good thing is that you actually do not really need or want to use ffmpeg for streaming. But you want to have sendable packets of encoded data in order to send. We have a client that does it (crossplatform, with premake project generation script). Main thing there is to use url_open_dyn_buf and url_close_dyn_buf which are shortly described here