Hello to all. I'm a libav beginner and I'm working at video capture project.

I'm learning ffmpeg based on this tutorial:
http://www.dranger.com/ffmpeg/

So now I need to get images from webcam (v4l2), and I'm using these
instructions:

AVInputFormat *iFmt = av_find_input_format("video4linux2");
AVFormatContext *pFormatCtx;

When I open the video

av_open_input_file(&pFormatCtx,"/dev/video0",iFmt,0,NULL);

this message is printed on screen:

[video4linux2 @ 0x19c6010]Estimating duration from bitrate, this may
be inaccurate

And the dump data show stream with negative bitrate (-2147483). This
is the dump_format() output:

Input #0, video4linux2, from '/dev/video0':
  Duration: N/A, start: 1275920057.312480, bitrate: -2147483 kb/s
    Stream #0.0: Video: rawvideo, yuyv422, 320x240, -2147483 kb/s,
1000k tbr, 1000k tbn, 1000k tbc

After get the stream, when I start the frame capture loop with
av_read_frame, I see that each packet captured is a frame (I don't
know if this is the correct behavior) and after 32 frames the programs
exit with this error:

[video4linux2 @ 0x19c6010]ioctl(VIDIOC_DQBUF): Invalid argument

My program doesn't have GUI, and it needs to get frames from camera,
encode and store on disk. I tried to read ffmpeg.c and ffplay - which
get the bitrate correctly - to learn about libav, but they are very
complex (in ffplay there is a mix with libav and sdl, and this
dificult my life :-)).

So I need to do where can I find a good and updated tutorial or thread
on list for libav beginners. For example, who is the "img_convert"
replacement?

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

Reply via email to