bytedeco/javacv

Scalling down with FFmpegFrameGrabber produces low quality results

Open

#1,279 opened on Aug 22, 2019

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

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

Description

This is something I noticed. I'm not actually sure if this is something you can fix on your end, I just want to make sure my setup is OK.

So, I decode frames from a video. Video resolution is 1920x1080, I need 1280x720.

Now, I can scale it down with FFmpegFrameGrabber, like so:

            grabber.setImageWidth(1280);
            grabber.setImageHeight(720);
            grabber.setPixelFormat(PIXEL_FORMAT);
            grabber.setImageScalingFlags(SWS_BICUBIC);

or I can decode at video's resolution and scale it down with OpenCV.

The thing is get better results with the OpenCV method, so I wanted to make sure if there's anything I could do to up the quality when using FFmpegFrameGrabber alone? I tried different image scaling flags, they don't seem to make much of a difference (if any at all).

Contributor guide