Wednesday, August 25, 2010

Solo6x10: Recording from video

I've finally gotten around to writing an example program for recording from Solo6x10 devices to a file. This program is very basic. It leaves the video device in it's default state (resolution, frame rate, etc). So you can modify those settings separately, and then use this program to record at those settings.

I also did not put motion detection examples in this, mainly because I have not satisfied my desire to create a decent API in v4l2 yet for that that.

Next step, I will add sound recording into this.

You can find the example source here.

To compile it, run:

gcc -lavformat bc-record.c -o bc-record

Execute it with a single command line option, the device for a solo6x10 encoder (e.g. /dev/video1). It will record until you hit ^C.

Happy recording!

3 comments:

  1. your intelect on this stuff allways impresses me. I havnt a clue what ur talking about.

    ReplyDelete
  2. I've updated the program. There was one mistake where I was setting the av packet size to the wrong value. It needed to use vb->bytesused.

    Anyone using this, make sure to get the updated copy of the source.

    Thanks!

    ReplyDelete
  3. I'm getting this when I try to compile:

    # gcc -lavformat bc-record.c -o bc-record
    bc-record.c: In function ‘av_prepare’:
    bc-record.c:145:11: warning: assignment makes pointer from integer without a cast
    bc-record.c:166:33: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
    bc-record.c:166:33: note: each undeclared identifier is reported only once for each function it appears in
    bc-record.c:178:3: warning: ‘av_set_parameters’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1400)
    bc-record.c:190:3: warning: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
    bc-record.c:193:3: warning: ‘av_write_header’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1458)
    bc-record.c: In function ‘video_out’:
    bc-record.c:204:18: error: ‘PKT_FLAG_KEY’ undeclared (first use in this function)

    ReplyDelete