Hi,

I'm trying to grab images from a webcam, and I'm trying to use the following code:

AVCodecContext  *pCodecCtx;
AVInputFormat   *pFormat;
const char      device[]     = "/dev/video0";
const char      formatName[] = "video4linux";


av_register_all();

if (!(pFormat = av_find_input_format(formatName))) {
    printf("can't find input format %s\n", formatName);
    return -1;
}

if (av_open_input_file(&pFormatCtx, device, pFormat, 0, NULL)!=0) {
    printf("can't find open input file %s\n", device);
    return -1;
}



but I'm finding that I always get a null as a return value from av_find_input_format(). I tried all sort os values for formatName, ranging from mp2, mp4, dv1394, h264, video4linux and video4linux2. all these values are listed when I issue:

ffmpeg -formats


it seems that on my setup, av_find_input_format() just doesn't find any of the formats. what am I doing wrong?


Akos
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to