I'm trying to open a dshow device using avformat_open_input and I'm having trouble figuring out where to put what, avformat_open_input always returns error -5, EIO. The device works fine in ffplay.exe
Here's the example code:
- Code: Select all
av_register_all();
avdevice_register_all();
AVInputFormat * a= av_find_input_format("dshow");
AVDictionaryEntry *ad= new AVDictionaryEntry;
AVDictionary *d= new AVDictionary;
d->count= 1;
d->elems= ad;
ad->value= "Laptop Integrated Webcam";
ad->key= "video";
int r;
// Open the video file
if((r= avformat_open_input(&m_pFormatCtx, "video=\"Laptop Integrated Webcam\"", a, &d))!=0)
I have tried to make filename an empty string but that didn't help. And making the dictionary NULL didn't work either.
Thanks for any help,
M