bytedeco/javacv

Slight but noticeable color shift when using FFmpegFrameGrabber

Open

#2,172 opened on Jan 18, 2024

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
bughelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

There's a slight change in colors when grabbing frames with FFmpegFrameGrabber and the bgr24 pixel format, compared to what the ffmpeg command line tool produces when saving frames as PNGs or when compared to ffplay's output. Parts of the image are sometimes more contrasty, which makes compression artifacts more pronounced (e.g., banding with some low-contrast gradients).

I'm attaching the same frame fragment, one grabbed with FFmpegFrameGrabber and the other saved as a PNG with the command line tool.

Correct colors (straight from ffmpeg): ffmpeg

Colors from the same frame grabbed with FFmpegFrameGrabber: grabbed

The FFmpegFrameGrabber one has a slight, greenish tint (judging purely by eye).

To get the PNGs with the command line tool, I used this:

ffmpeg -i in.mp4 -t 00:00:01 out/%04d.png

Contributor guide