Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9010593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:30:13+00:00 2026-06-16T02:30:13+00:00

i try to capture images from a webcam with video4linux and mmap method. My

  • 0

i try to capture images from a webcam with video4linux and mmap method. My device is an Aptina MT9M114 camera on a Gentoo Linux (Kernel version 2.6.33.20). The code is based on this sample program: http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html

When i want to start captering, i run the following code to prepare my buffers:

enum v4l2_buf_type type;

for (uint8_t i = 0; i < n_buffers; i++) {
    struct v4l2_buffer buf;
    CLEAR (buf);
    buf.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    buf.memory = V4L2_MEMORY_MMAP;
    buf.index  = i;

    if (-1 == ioctl(fd, VIDIOC_QBUF, &buf)) {
        return false;
    }
}

When calling ioctl() here i get a deep layer crash. This is my syslog, i have no further informations:

Mar  2 20:06:30 nao33 klogd: kernel BUG at drivers/media/video/videobuf-core.c:227!
Mar  2 20:06:30 nao33 klogd: invalid opcode: 0000 [#2] PREEMPT
...
Mar  2 20:06:30 nao33 klogd: EIP: 0060:[<f804dad3>] EFLAGS: 00010246 CPU: 0
Mar  2 20:06:30 nao33 klogd: EIP is at videobuf_qbuf+0x23f/0x32d [videobuf_core]
Mar  2 20:06:30 nao33 klogd: EAX: 00000001 EBX: f5bf7e6c ECX: 00000000 EDX: f5bf7e6c
Mar  2 20:06:30 nao33 klogd: ESI: f6bcf61c EDI: f657f140 EBP: f5bf7dc4 ESP: f5bf7db4
Mar  2 20:06:30 nao33 klogd:  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 preempt:00000000
Mar  2 20:06:30 nao33 klogd: Process videoexample (pid: 2979, ti=f5bf6000 task=f5bf00b0 task.ti=f5bf6000)
Mar  2 20:06:30 nao33 klogd: Stack:
Mar  2 20:06:30 nao33 klogd:  f5bf7e6c f5bf7e6c 00000000 f8255ca3 f5bf7dcc f8255cb0 f5bf7e48 f8148980
Mar  2 20:06:30 nao33 klogd: <0> 0000ee34 00000001 c14a6e94 c044560f f6bcf600 f5bfb540 f825777c f6b18000
Mar  2 20:06:30 nao33 klogd: <0> c14a6e94 f5bf7e10 c101ee52 00000000 f5bf00b0 f5bf7e20 c100160a f5bf0d80
Mar  2 20:06:30 nao33 klogd: Call Trace:
Mar  2 20:06:30 nao33 klogd:  [<f8255ca3>] ? vidioc_qbuf+0x0/0xf [unicorn]
Mar  2 20:06:30 nao33 klogd:  [<f8255cb0>] ? vidioc_qbuf+0xd/0xf [unicorn]
Mar  2 20:06:30 nao33 klogd:  [<f8148980>] ? __video_do_ioctl+0xe00/0x2d31 [videodev]
Mar  2 20:06:30 nao33 klogd:  [<c101ee52>] ? set_next_entity+0xab/0x117
Mar  2 20:06:30 nao33 klogd:  [<c100160a>] ? __switch_to+0x12/0x14d
Mar  2 20:06:30 nao33 klogd:  [<c112dd83>] ? might_fault+0x14/0x16
Mar  2 20:06:30 nao33 klogd:  [<c112dedc>] ? _copy_from_user+0x31/0x115
Mar  2 20:06:30 nao33 klogd:  [<f814ab79>] ? video_ioctl2+0x2c8/0x368 [videodev]
Mar  2 20:06:30 nao33 klogd:  [<c104635f>] ? T.366+0x27/0x33
Mar  2 20:06:30 nao33 klogd:  [<f814a8b1>] ? video_ioctl2+0x0/0x368 [videodev]
Mar  2 20:06:30 nao33 klogd:  [<f814711c>] ? v4l2_ioctl+0x33/0x37 [videodev]
Mar  2 20:06:30 nao33 klogd:  [<c1085daf>] ? vfs_ioctl+0x69/0x91
Mar  2 20:06:30 nao33 klogd:  [<c10862ad>] ? do_vfs_ioctl+0x448/0x486
Mar  2 20:06:30 nao33 klogd:  [<c107c9dd>] ? fget_light+0x87/0x91
Mar  2 20:06:30 nao33 klogd:  [<c108632c>] ? sys_ioctl+0x41/0x61
Mar  2 20:06:30 nao33 klogd:  [<c1002790>] ? sysenter_do_call+0x12/0x26
Mar  2 20:06:30 nao33 klogd: Code: 0f 8e e1 00 00 00 68 ba ec 04 f8 e9 77 fe ff ff 83 3d cc f4 04 f8 00 7e 0b 68 dc ec 04 f8 e8 13 e3 29 c9 5a 8b 4e 48 85 c9 75 04 <0f> 0b eb fe 83 f9 07 75 1d 83 7e 4c 02 75 0b c7 46 4c 03 00 00
Mar  2 20:06:30 nao33 klogd: EIP: [<f804dad3>] videobuf_qbuf+0x23f/0x32d [videobuf_core] SS:ESP 0068:f5bf7db4

Has anybody a hint, what is the problem here? Actually this code should work, since its working on my local PC and its mainly copied from this example. So i have no idea how to find the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:30:14+00:00Added an answer on June 16, 2026 at 2:30 am

    The error seems to be connected with the process of setting the image dimensions. Setting V4L2_FIELD_NONE instead of V4L2_FIELD_ANY solved to crash.

    struct v4l2_format fmt;
    ...
    fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    fmt.fmt.pix.width       = ...
    fmt.fmt.pix.height      = ...
    fmt.fmt.pix.pixelformat = ...
    fmt.fmt.pix.field       = V4L2_FIELD_NONE;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i really a newbie with EgmuCV i try to capture images from webcam with
Possible Duplicate: NullPointerException when try to capture imagem from webcam I saw this good
I've built a little camera capture daemon which captures a sequence of images from
I'm trying to capture images from a webcam for one application in WPF/C# 1)
I would like to capture an image from the camera on Android, and send
I am using the jengelsma code from this post Capture Image from Camera and
I want to capture image using camera and want image path. I try following
I try take photo from camera this way: private void photo() { String storageState
I'm trying to capture the image from my webcam, but I got the error
i did an application which has imageview to capture image from camera and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.