bytedeco/javacv

Slight but noticeable color shift when using FFmpegFrameGrabber

Open

#2.172 aberto em 18 de jan. de 2024

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Java (1.583 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (6.985 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 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

Guia do colaborador