Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (21)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (4776)

  • How to encode using the FFMpeg in Android (using H263)

    3 juillet 2012, par Kenny910

    I am trying to follow the sample code on encoding in the ffmpeg document and successfully build a application to encode and generate a mp4 file but I face the following problems :

    1) I am using the H263 for encoding but I can only set the width and height of the AVCodecContext to 176x144, for other case (like 720x480 or 640x480) it will return fail.

    2) I can't play the output mp4 file by using the default Android player, isn't it support H263 mp4 file ? p.s. I can play it by using other player

    3) Is there any sample code on encoding other video frame to make a new video (which mean decode the video and encode it back in different quality setting, also i would like to modify the frame content) ?

    Here is my code, thanks !

    JNIEXPORT jint JNICALL Java_com_ffmpeg_encoder_FFEncoder_nativeEncoder(JNIEnv* env, jobject thiz, jstring filename){

    LOGI("nativeEncoder()");

    avcodec_register_all();
    avcodec_init();
    av_register_all();

    AVCodec         *codec;
    AVCodecContext  *codecCtx;
    int             i;
    int             out_size;
    int             size;
    int             x;
    int             y;
    int             output_buffer_size;
    FILE            *file;
    AVFrame         *picture;
    uint8_t         *output_buffer;
    uint8_t         *picture_buffer;

    /* Manual Variables */
    int             l;
    int             fps = 30;
    int             videoLength = 5;

    /* find the H263 video encoder */
    codec = avcodec_find_encoder(CODEC_ID_H263);
    if (!codec) {
       LOGI("avcodec_find_encoder() run fail.");
    }

    codecCtx = avcodec_alloc_context();
    picture = avcodec_alloc_frame();

    /* put sample parameters */
    codecCtx->bit_rate = 400000;
    /* resolution must be a multiple of two */
    codecCtx->width = 176;
    codecCtx->height = 144;
    /* frames per second */
    codecCtx->time_base = (AVRational){1,fps};
    codecCtx->pix_fmt = PIX_FMT_YUV420P;
    codecCtx->codec_id = CODEC_ID_H263;
    codecCtx->codec_type = AVMEDIA_TYPE_VIDEO;

    /* open it */
    if (avcodec_open(codecCtx, codec) < 0) {
       LOGI("avcodec_open() run fail.");
    }

    const char* mfileName = (*env)->GetStringUTFChars(env, filename, 0);

    file = fopen(mfileName, "wb");
    if (!file) {
       LOGI("fopen() run fail.");
    }

    (*env)->ReleaseStringUTFChars(env, filename, mfileName);

    /* alloc image and output buffer */
    output_buffer_size = 100000;
    output_buffer = malloc(output_buffer_size);

    size = codecCtx->width * codecCtx->height;
    picture_buffer = malloc((size * 3) / 2); /* size for YUV 420 */

    picture->data[0] = picture_buffer;
    picture->data[1] = picture->data[0] + size;
    picture->data[2] = picture->data[1] + size / 4;
    picture->linesize[0] = codecCtx->width;
    picture->linesize[1] = codecCtx->width / 2;
    picture->linesize[2] = codecCtx->width / 2;

    for(l=0;l/encode 1 second of video
       for(i=0;i/prepare a dummy image YCbCr
           //Y
           for(y=0;yheight;y++) {
               for(x=0;xwidth;x++) {
                   picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;
               }
           }

           //Cb and Cr
           for(y=0;yheight/2;y++) {
               for(x=0;xwidth/2;x++) {
                   picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2;
                   picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5;
               }
           }

           //encode the image
           out_size = avcodec_encode_video(codecCtx, output_buffer, output_buffer_size, picture);
           fwrite(output_buffer, 1, out_size, file);
       }

       //get the delayed frames
       for(; out_size; i++) {
           out_size = avcodec_encode_video(codecCtx, output_buffer, output_buffer_size, NULL);
           fwrite(output_buffer, 1, out_size, file);
       }
    }

    //add sequence end code to have a real mpeg file
    output_buffer[0] = 0x00;
    output_buffer[1] = 0x00;
    output_buffer[2] = 0x01;
    output_buffer[3] = 0xb7;

    fwrite(output_buffer, 1, 4, file);
    fclose(file);
    free(picture_buffer);
    free(output_buffer);
    avcodec_close(codecCtx);
    av_free(codecCtx);
    av_free(picture);

    LOGI("finish");

    return 0; }
  • Android NDK - FFMpeg, correct video seeking

    15 mars 2012, par sherman

    I want change the seek frame while playing video. I do :

    void Java_ffvideolivewallpaper_frankandrobot_com_NativeCalls_seekFrame(
    JNIEnv *env, jobject this, jint time)

    if (av_seek_frame(pFormatCtx, videoStream, time, AVSEEK_FLAG_ANY) < 0)
       __android_log_print(ANDROID_LOG_DEBUG, "ERROR SEEK!!!->>>",
               "av_seek_frame failed.");

    Video is displayed incorrectly. How do this correctly ?

  • H264 HW Decoding on Android Using FFmpeg-10

    21 septembre 2012, par limitfan

    I've noticed that ffmpeg has already included (libavcodec/libstagefright.cpp) and claimed to support H264's hardware decoding through StageFright framework. I've build the shared library according to (tools/build_libstagefright). But when doing real H264 frame decoding, it seems to be failed at Stagefright_init().
    Does anybody succeed to use this new feature ? Thank you in advance.