Skip to content

timestamp remains the same for all pictures with V4L2_PIX_FMT_JPEG #2351

Closed
@vitaliy-gis

Description

@vitaliy-gis

If pixel format is V4L2_PIX_FMT_JPEG, then buf.timestamp.tv_sec and buf.timestamp.tv_usec are the same as previous values, but the pictures are different. If I use other format (e.g. V4L2_PIX_FMT_RGB24) - all is ok.

Here is the sample code:

`static int read_frame() {
struct v4l2_buffer buf;

CLEAR(buf);

buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP; 
if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf))
{
    switch (errno)
    {
    case EAGAIN:
        return 0;
    case EIO:
        /* Could ignore EIO, see spec. */
        /* fall through */
    default:
        errno_exit("VIDIOC_DQBUF");
    }
}
assert(buf.index < n_buffers);

 //buf.timestamp.tv_sec               same as previous value
 //buf.timestamp.tv_usec             same as previous value
 //do some work with buffer    

if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
errno_exit("VIDIOC_QBUF");
return 1;}

`

Metadata

Metadata

Assignees

Labels

Waiting for internal commentWaiting for comment from a member of the Raspberry Pi engineering team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions