Add this flag to img2 (fixes -vcodec copy to image2 in some cases)
Originally committed as revision 21773 to svn://svn.ffmpeg.org/ffmpeg/trunk
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. */
#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */
+#define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */
typedef struct AVOutputFormat {
const char *name;
img_write_header,
img_write_packet,
NULL,
- .flags= AVFMT_NOTIMESTAMPS | AVFMT_NOFILE
+ .flags= AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE
};
#endif
#if CONFIG_IMAGE2PIPE_MUXER
CODEC_ID_MJPEG,
img_write_header,
img_write_packet,
- .flags= AVFMT_NOTIMESTAMPS
+ .flags= AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
};
#endif
av_log(s, AV_LOG_ERROR, "time base not set\n");
return -1;
}
- if(st->codec->width<=0 || st->codec->height<=0){
+ if((st->codec->width<=0 || st->codec->height<=0) && !(s->oformat->flags & AVFMT_NODIMENSIONS)){
av_log(s, AV_LOG_ERROR, "dimensions not set\n");
return -1;
}