Skip to content

Bug: The AVPixelFormat field lacks the common MJPG pixel format. #349

Description

@Canees

Describe the Bug

MJPG is a common format for USB cameras. Logically speaking, the AVPixelFormat field should not return NONE.

To Reproduce

exp:

  1. v4l2-ctl --device=/dev/video20 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

     [0]: 'MJPG' (Motion-JPEG, compressed)
             Size: Discrete 1920x1080
                     Interval: Discrete 0.033s (30.000 fps)
                     Interval: Discrete 0.040s (25.000 fps)
                     Interval: Discrete 0.050s (20.000 fps)
                     Interval: Discrete 0.067s (15.000 fps)
                     Interval: Discrete 0.200s (5.000 fps)
     [1]: 'YUYV' (YUYV 4:2:2)
             Size: Discrete 640x480
                     Interval: Discrete 0.033s (30.000 fps)
                     Interval: Discrete 0.040s (25.000 fps)
                     Interval: Discrete 0.050s (20.000 fps)
                     Interval: Discrete 0.067s (15.000 fps)
    
  2. const modes = await DeviceAPI.modes('/dev/video20')
    const List = modes.map(m=>({width: m.width, height: m.height, fps: m.maxFrameRate, inputFormat: avGetPixFmtName(m.pixelFormat)}))
    log:
    { width: 1920, height: 1080, fps: 30, inputFormat: null },
    { width: 1280, height: 720, fps: 30, inputFormat: null },
    { width: 640, height: 480, fps: 30, inputFormat: null },
    { width: 640, height: 480, fps: 30, inputFormat: 'yuyv422' },
    { width: 352, height: 288, fps: 30, inputFormat: null },
    { width: 320, height: 240, fps: 30, inputFormat: null },
    { width: 320, height: 240, fps: 30, inputFormat: 'yuyv422' },
    { width: 176, height: 144, fps: 30, inputFormat: null },
    { width: 160, height: 120, fps: 30, inputFormat: null }

Expected Behavior

Expected normal output: mjpeg

Code Sample

Relevant Log Output / Error Messages

no

Node.js Version

24.10.0

NodeAV Version

6.2.0-beta.12

Operating System

Armbian Linux 6.1.115-vendor-rk35xx

Installation Method

npm install

API Used

High-Level API

Hardware Acceleration

None

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions