}
}
-AVFormatContext *open_input_stream(const char *fname, int w, int h, int fps)
+AVFormatContext *open_input_stream(const char *fname, int w, int h, int fps, const char *impform)
{
AVFormatContext *s;
AVInputFormat *fmt;
param.pix_fmt = PIX_FMT_YUV420P;
param.time_base.den = fps;
param.time_base.num = 1;
- fmt = av_find_input_format("video4linux2");
+ if(impform == NULL)
+ impform = "video4linux2";
+ fmt = av_find_input_format(impform);
res = av_open_input_file(&s, fname, fmt, 0, ¶m);
if (res < 0) {
fprintf(stderr, "Error opening %s: %d\n", fname, res);