void write_video_frame(AVFormatContext *oc, AVStream *st)

{

    int x, y, i, out_size;

    AVCodecContext *c;



    c = &st->codec;

    

    /* prepare a dummy image */

    /* Y */

    i = frame_count++;

    for(y=0;y<c->height;y++) {

        for(x=0;x<c->width;x++) {

            picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;

        }

    }

    

    /* Cb and Cr */

    for(y=0;y<c->height/2;y++) {

        for(x=0;x<c->width/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, video_outbuf, video_outbuf_size, picture);



    /* write the compressed frame in the media file */

    if (av_write_frame(oc, st->index, video_outbuf, out_size) != 0) {

        fprintf(stderr, "Error while writing video frame\n");

        exit(1);

    }

}

void write_video_frame(AVFormatContext *oc, AVStream *st)

{

    int x, y, i, out_size;

    AVCodecContext *c;



    c = &st->codec;

    

    

    

    i = frame_count++;

    for(y=0;y<c->height;y++) {

        for(x=0;x<c->width;x++) {

            picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;

        }

    }

    

    

    for(y=0;y<c->height/2;y++) {

        for(x=0;x<c->width/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;

        }

    }



    

    out_size = avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture);



    

    if (av_write_frame(oc, st->index, video_outbuf, out_size) != 0) {

        fprintf(stderr, "Error while writing video frame\n");

        exit(1);

    }

}

        exit(1);         exit(1); void write_video_frame(AVFormatContext *oc, AVStream *st)     int x, y, i, out_size;     AVCodecContext *c;     c = &st->codec;     i = frame_count++;     for(y=0;y<c->height;y++) {         for(x=0;x<c->width;x++) {             picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;     for(y=0;y<c->height/2;y++) {         for(x=0;x<c->width/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;     out_size = avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture);     if (av_write_frame(oc, st->index, video_outbuf, out_size) != 0) {
void FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1)

{

    int VAR_2, VAR_3, VAR_4, VAR_5;

    AVCodecContext *c;



    c = &VAR_1->codec;

    

    

    

    VAR_4 = frame_count++;

    for(VAR_3=0;VAR_3<c->height;VAR_3++) {

        for(VAR_2=0;VAR_2<c->width;VAR_2++) {

            picture->data[0][VAR_3 * picture->linesize[0] + VAR_2] = VAR_2 + VAR_3 + VAR_4 * 3;

        }

    }

    

    

    for(VAR_3=0;VAR_3<c->height/2;VAR_3++) {

        for(VAR_2=0;VAR_2<c->width/2;VAR_2++) {

            picture->data[1][VAR_3 * picture->linesize[1] + VAR_2] = 128 + VAR_3 + VAR_4 * 2;

            picture->data[2][VAR_3 * picture->linesize[2] + VAR_2] = 64 + VAR_2 + VAR_4 * 5;

        }

    }



    

    VAR_5 = avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture);



    

    if (av_write_frame(VAR_0, VAR_1->index, video_outbuf, VAR_5) != 0) {

        fprintf(stderr, "Error while writing video frame\n");

        exit(1);

    }

}

void FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1)
{ int VAR_2, VAR_3, VAR_4, VAR_5; AVCodecContext *c; c = &VAR_1->codec; VAR_4 = frame_count++; for(VAR_3=0;VAR_3<c->height;VAR_3++) { for(VAR_2=0;VAR_2<c->width;VAR_2++) { picture->data[0][VAR_3 * picture->linesize[0] + VAR_2] = VAR_2 + VAR_3 + VAR_4 * 3; } } for(VAR_3=0;VAR_3<c->height/2;VAR_3++) { for(VAR_2=0;VAR_2<c->width/2;VAR_2++) { picture->data[1][VAR_3 * picture->linesize[1] + VAR_2] = 128 + VAR_3 + VAR_4 * 2; picture->data[2][VAR_3 * picture->linesize[2] + VAR_2] = 64 + VAR_2 + VAR_4 * 5; } } VAR_5 = avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture); if (av_write_frame(VAR_0, VAR_1->index, video_outbuf, VAR_5) != 0) { fprintf(stderr, "Error while writing video frame\n"); exit(1); } }