Skip to content

mmal fails to decode mjpeg from usb camera #668

Open
@linhuifj

Description

@linhuifj

Example of the frame:
example of frame

I have a USB camera that outputs mjpeg frames that fail to be decoded by mmal.
I have tried to use hello_mmal_jpeg, hello_mmal_video, and FFmpeg with mmal_mjpeg decoder, none of them is ok.

My experiment environment: Pi 4b, 32bit raspberry pi os

I finally come out with the solution to use mjpeg2jpeg converter in FFmpeg:
./ffmpeg -i ~/raw.jpg -codec copy -bsf:v mjpeg2jpeg yy.jpg
I writer a convert by referring to the code in FFmpeg mjpeg2jpeg.

My question:

  1. Is there any better solution?
  2. what's the highest framerate supported by mmal (rpi 4b) to decode video with size 3840x2160? I have tested the decoding of hello_mmal_jpeg and found that it takes about 150ms to decode the image, which is too slow.
  3. Is mjpeg video decoding faster than image decoding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions