Skip to content

Improvements to avfilter interface and color handling - #1992

Merged
jstebbins merged 9 commits into
HandBrake:masterfrom
jstebbins:avfilter-api
Apr 8, 2019
Merged

jstebbins merged 9 commits into
HandBrake:masterfrom
jstebbins:avfilter-api

Conversation

@jstebbins

@jstebbins jstebbins commented Mar 15, 2019 •

Copy link
Copy Markdown
Contributor

Simplifies the internal API to avfilter.
Reworks how avfilter based hb filters are initialized.
Improves logging of avfilter based hb filters.
Adds colorspace conversion filter (currently unused and untested)
Propagate colorspace information everywhere that it might be needed.

  • Windows 10+ (via MinGW)
  • macOS 10.13+
  • Ubuntu Linux

@jstebbins

Copy link
Copy Markdown
Contributor Author

I forgot to mention, eliminates cropscale.c by using avfilter.

Comment thread libhb/hbavfilter.h Resolved
@bradleysepos

Copy link
Copy Markdown
Contributor

Initial read looks good. Very promising!

@Nomis101

Nomis101 commented Apr 3, 2019

Copy link
Copy Markdown
Contributor

I've tested this on macOS 10.13 with some different video files. I found there is an issue with movies which are from UHD Blu-Rays (4k, HDR10). If I convert one of those into 10-bit HEVC, the resulting video is just green (I know, it doesn't make sense to convert 10-bit HEVC into 10-bit HEVC, but this was just a test).

Source file:
Stream #0:0(eng): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 49979 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 23.98 tbc (default)

Output file:
Stream #0:0(und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1600 [SAR 1:1 DAR 12:5], 22780 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc (default)

No issue with current master.

@jstebbins

Copy link
Copy Markdown
Contributor Author

Any chance you could clip a few seconds of the source and supply a sample?

I can't think how the output would be different than current master since in theory nothing has changed aside from passing the color information through the pipeline.

@jstebbins

Copy link
Copy Markdown
Contributor Author

I've reproduced the issue, thanks for doing some testing and pointing this out.

@jstebbins

Copy link
Copy Markdown
Contributor Author

Fixed

@bradleysepos

Copy link
Copy Markdown
Contributor

You've invented a new planar format! 😸

@Nomis101

Nomis101 commented Apr 3, 2019

Copy link
Copy Markdown
Contributor

Fixed

Yes, seems fixed. :-)

Use this interface in decavcodec.
Remove cropscale.c and use avfilter for crop and scale.
Improve log output of filters that are aliases for avfilter.
Propagates pix_fmt, range, primaries, transfer, and matrix everywhere.

Everything that passes or creates video frames tags the frames with
their color matrix info.

All filters know the expected color matrix info of input frames.
Reserve VideoColorMatrixCode for doing color conversion.
VideoColorMatrixCodeOverride sets color flags without transforming video
frame colors.
Splits the initialization of pad, cropscale, deinterlace, rotate, and
colorspace into their own files.  Also splits internal avfilter API into
it's own file.
It appears some color prim/tran/matrix settings result in high bit
depth output of the scale filter.
@jstebbins
jstebbins merged commit 460fdf4 into HandBrake:master Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants