dmorse Posted August 29, 2017 Share Posted August 29, 2017 I've updated to the latest kernel code, rebuilt and I I can now see /dev/video when I call "modprobe ov5640; modprobe vfe_v4l2" after booting into the nanopi. However, when I run the following ffmpeg -re -i /dev/video0 -c:v libx265 -preset ultrafast -x265-params crf=23 -f h264 ./out.mp4 I get the following error error [video4linux2,v4l2 @ 0x1a9a7f0] Dequeued v4l2 buffer contains 40960 bytes, but 38016 were expected. Flags: 0x00000001. The video format is yuv420p, 176x144, so it should be 176*144*1.5 bytes = 38016bytes. However the buffer seems to be slightly larger. I have written a few small c programs of my own and no matter what there seems to be a bit of extra bytes in the buffer. output of dmesg is attached. dmesg.out Link to comment Share on other sites More sharing options...
dmorse Posted August 31, 2017 Author Share Posted August 31, 2017 I've managed to track this down to this line in videobuf-core.c b->bytesused = vb->size; vb->size seems to the the size of the whole buffer, but the actual buffer used is a bit smaller. I was goign to modify this to use b->bytesused = vb->bytesperline * vb->height; But after adding a printk to my kernel I can see that bytesperline is 0 Link to comment Share on other sites More sharing options...
dmorse Posted August 31, 2017 Author Share Posted August 31, 2017 I've also taken a look at vb->bsize, but that has the same value as vb->size as far as I can see, Link to comment Share on other sites More sharing options...
dmorse Posted September 7, 2017 Author Share Posted September 7, 2017 I've bug a bit further with this. Looks like vb.size gets at in sunxi-vfe/vfe.c in the function buffer prepare. buf->vb.size = dev->buf_byte_size; dev->buf_byte_size is set from the bsp in vidioc_s_fmt_vid_cap dev->buf_byte_size = bsp_isp_set_size(isp_fmt,&size_settings); Link to comment Share on other sites More sharing options...
Recommended Posts