Hi to all,
I am trying develop an video chat app on android and have ported ffmpeg 2.0.1
to android successfully. The code to open camera is very simple:
AVFormatContext *fmt_ctx = NULL;
AVInputFormat *input_fmt;
input_fmt = av_find_input_format("video4linux2");
if (input_fmt == NULL)
return -1;
char f_name[] = "/dev/video0";
if ((ret = avformat_open_input(&fmt_ctx, f_name, input_fmt, NULL)) < 0)
// stuck here
{
LOG_D("can not open camera, ret = %d", ret);
return ret;
}
the strange thing is the ret value is always negative with the following logcat
output by av_log:
09-26 15:27:48.901: E/Codec-FFMpeg(17716): ioctl(VIDIOC_G_PARM): Invalid
argument
Do i forget anything before calling avformat_open_input()? Thank you!
Regards,
craig_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user