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!
your intelect on this stuff allways impresses me. I havnt a clue what ur talking about.
ReplyDeleteI'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.
ReplyDeleteAnyone using this, make sure to get the updated copy of the source.
Thanks!
I'm getting this when I try to compile:
ReplyDelete# 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)