} else if (s->oformat == &yuv4mpegpipe_oformat) { img->img_fmt = IMGFMT_YUV4MPEG; img->header_written = 0;
static int img_write_header(AVFormatContext *s){    VideoData *img = s->priv_data;    img->img_number = 1;    strcpy(img->path, s->filename);    /* find format */    if (s->oformat->flags & AVFMT_NOFILE)        img->is_pipe = 0;    else        img->is_pipe = 1;            if (s->oformat == &pgmyuvpipe_oformat ||        s->oformat == &pgmyuv_oformat) {        img->img_fmt = IMGFMT_PGMYUV;    } else if (s->oformat == &pgmpipe_oformat ||               s->oformat == &pgm_oformat) {        img->img_fmt = IMGFMT_PGM;    } else if (s->oformat == &imgyuv_oformat) {        img->img_fmt = IMGFMT_YUV;    } else if (s->oformat == &ppmpipe_oformat ||               s->oformat == &ppm_oformat) {        img->img_fmt = IMGFMT_PPM;    } else {        goto fail;    }    return 0; fail:    av_free(img);    return -EIO;}