Recherche avancée

Médias (91)

Autres articles (30)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

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

  • Wrong frame rate when saving camera feed to a file using FFMPEG

    23 août 2015, par LEM

    I’m trying to save the live feed from an IP camera to a file but the resulting file always plays much faster than the original speed.

    I have tried with the following commands :

    ffmpeg -i http://171.22.3.47/image -vcodec copy -an -t 900 c:\output.mp4

    ffmpeg -i http://171.22.3.47/image -c:v libx264 -an c:\output.mp4

    Does anybody know what I’m missing ? Both commands create the file and I can use Windows Media Player to play them, but they run much faster.

  • Video too fast FFmpeg

    22 novembre 2012, par Spamdark

    I am having an issue again with ffmpeg, I'm a newbie with ffmpeg, and I can't find a good tutorial up to date...

    This time, when I play a video with ffmpeg, it plays too fast, ffmpeg is ignoring the FPS, I don't want to handle that with a thread sleep, because the videos have differents FPS's.

    I created a thread, there you can find the loop :

    AVPacket framepacket;

    while(av_read_frame(formatContext,&framepacket)>= 0){
       pausecontrol.lock();

       // Is it a video or audio frame¿?
       if(framepacket.stream_index==gotVideoCodec){
           int framereaded;
           // Video? Ok
           avcodec_decode_video2(videoCodecContext,videoFrame,&framereaded,&framepacket);
           // Yeah, did we get it?
           if(framereaded && doit){
               AVRational millisecondbase = {1,1000};
               int f_number = framepacket.dts;
               int f_time = av_rescale_q(framepacket.dts,formatContext->streams[gotVideoCodec]->time_base,millisecondbase);
               currentTime=f_time;
               currentFrameNumber=f_number;

               int stWidth = videoCodecContext->width;
               int stHeight = videoCodecContext->height;
               SwsContext *ctx = sws_getContext(stWidth, stHeight, videoCodecContext->pix_fmt, stWidth,
               stHeight, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
               if(ctx!=0){
               sws_scale(ctx,videoFrame->data,videoFrame->linesize,0,videoCodecContext->height,videoFrameRGB->data,videoFrameRGB->linesize);
               QImage framecapsule=QImage(stWidth,stHeight,QImage::Format_RGB888);

               for(int y=0;ydata[0]+y*videoFrameRGB->linesize[0],stWidth*3);
               }
               emit newFrameReady(framecapsule);
               sws_freeContext(ctx);
               }

           }
       }
       if(framepacket.stream_index==gotAudioCodec){
           // Audio? Ok
       }
       pausecontrol.unlock();
       av_free_packet(&framepacket);
    }

    Any Idea ?

  • 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) < 0) {
           LOGE("Could not open codec\n");
           return 0;
       }
       LOGI("AAC codec opened");

       //the input buffer
       AVPacket avPacket;
       av_init_packet(&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, &outSize,
                   &avPacket);

           if (len < 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(&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 !