Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (111)

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

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

Sur d’autres sites (10534)

  • FFmpeg sample code for creating a video file from still images JNI Android

    21 juin 2012, par anish

    How i modify the following FFMPEG sample code for creating a video file from still images that i am having in my android phone. I am using JNI for invoking ffmpeg.

    JNIEXPORT void JNICALL videoEncodeExample((JNIEnv *pEnv, jobject pObj, jstring filename)

       {
        AVCodec *codec;
        AVCodecContext *c= NULL;
        int i, out_size, size, x, y, outbuf_size;
        FILE *f;
        AVFrame *picture;
        uint8_t *outbuf, *picture_buf;

        printf("Video encoding\n");

        /* find the mpeg1 video encoder */
        codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
        if (!codec) {
            fprintf(stderr, "codec not found\n");
            exit(1);
        }

        c= avcodec_alloc_context();
        picture= avcodec_alloc_frame();

        /* put sample parameters */
        c->bit_rate = 400000;
        /* resolution must be a multiple of two */
        c->width = 352;
        c->height = 288;
        /* frames per second */
        c->time_base= (AVRational){1,25};
        c->gop_size = 10; /* emit one intra frame every ten frames */
        c->max_b_frames=1;
        c->pix_fmt = PIX_FMT_YUV420P;

        /* open it */
        if (avcodec_open(c, codec) < 0) {
            fprintf(stderr, "could not open codec\n");
            exit(1);
        }

        f = fopen(filename, "wb");
        if (!f) {
            fprintf(stderr, "could not open %s\n", filename);
            exit(1);
        }

        /* alloc image and output buffer */
        outbuf_size = 100000;
        outbuf = malloc(outbuf_size);
        size = c->width * c->height;
        picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */

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

        /* encode 1 second of video */
        for(i=0;i<25;i++) {
            fflush(stdout);
            /* prepare a dummy image */
            /* 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(c, outbuf, outbuf_size, picture);
            printf("encoding frame %3d (size=%5d)\n", i, out_size);
            fwrite(outbuf, 1, out_size, f);
        }

        /* get the delayed frames */
        for(; out_size; i++) {
            fflush(stdout);

            out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
            printf("write frame %3d (size=%5d)\n", i, out_size);
            fwrite(outbuf, 1, out_size, f);
        }

        /* add sequence end code to have a real mpeg file */
        outbuf[0] = 0x00;
        outbuf[1] = 0x00;
        outbuf[2] = 0x01;
        outbuf[3] = 0xb7;
        fwrite(outbuf, 1, 4, f);
        fclose(f);
        free(picture_buf);
        free(outbuf);

        avcodec_close(c);
        av_free(c);
        av_free(picture);
        printf("\n");
       }

    Thanks and Regards
    Anish

  • Mass Watermark Videos with Different Formats/Dimensions Programmatically

    17 septembre 2012, par ColorWP.com

    Is there a way to programmatically (using PHP) convert a directory full of videos with all kinds of formats (avi, mp4, mpeg, wmv) with different dimensions to a single format output (e.g. mp4) with the same dimensions as the input video and with a custom image watermark at the same position over the video (e.g. bottom left). Preferably, without lowering video quality and without making the watermark too large or too small for the resolution (maybe relative size to the video dimensions ?).

  • X264 encoding using Opencv

    29 novembre 2011, par user573193

    I am working with a high resolution camera : 4008x2672. I a writing a simple program which grabs frame from the camera and sends the frame to a avi file. For working with such a high resolution, I found only x264 codec that could do the trick (Suggestions welcome). I am using opencv for most of the image handling stuff. As mentioned in this post http://doom10.org/index.php?topic=1019.0 , I modified the AVCodecContext members as per ffmpeg presets for libx264 (Had to do this to avoid broken ffmpeg defaults settings error). This is output I am getting when I try to run the program

    libx264 @ 0x992d040]non-strictly-monotonic PTS
    1294846981.526675 1 0 //Timestamp camera_no frame_no
    1294846981.621101 1 1
    1294846981.715521 1 2
    1294846981.809939 1 3
    1294846981.904360 1 4
    1294846981.998782 1 5
    1294846982.093203 1 6
       Last message repeated 7 times
    [avi @ 0x992beb0]st:0 error, non monotone timestamps
    -614891469123651720 >= -614891469123651720

    OpenCV Error: Unspecified error (Error while writing video frame) in
    icv_av_write_frame_FFMPEG, file
    /home/ajoshi/ext/OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp, line 1034
    terminate called after throwing an instance of 'cv::Exception'
    what():  /home/ajoshi/ext/OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp:1034:
    error: (-2) Error while writing video frame in function icv_av_write_frame_FFMPEG

    Aborted

    Modifications to the AVCodecContext are :

    if(codec_id == CODEC_ID_H264)
    {
       //fprintf(stderr, "Trying to parse a preset file for libx264\n");
       //Setting Values manually from medium preset
       c->me_method = 7;
       c->qcompress=0.6;
       c->qmin = 10;
       c->qmax = 51;
       c->max_qdiff = 4;
       c->i_quant_factor=0.71;
       c->max_b_frames=3;
       c->b_frame_strategy = 1;
       c->me_range = 16;<br />
       c->me_subpel_quality=7;
       c->coder_type = 1;
       c->scenechange_threshold=40;
       c->partitions = X264_PART_I8X8 | X264_PART_I4X4 | X264_PART_P8X8 | X264_PART_B8X8;
       c->flags = CODEC_FLAG_LOOP_FILTER;
       c->flags2 = CODEC_FLAG2_BPYRAMID | CODEC_FLAG2_MIXED_REFS | CODEC_FLAG2_WPRED | CODEC_FLAG2_8X8DCT | CODEC_FLAG2_FASTPSKIP;
       c->keyint_min = 25;
       c->refs = 3;
       c->trellis=1;
       c->directpred = 1;
       c->weighted_p_pred=2;
    }

    I am probably not setting the dts and pts values which I believed ffmpeg should be setting it for me.

    Any sugggestions welcome.
    Thanks in advance