HandBrake icon indicating copy to clipboard operation
HandBrake copied to clipboard

Expose new filters provided by FFmpeg/avfilter.

Open bradleysepos opened this issue 7 years ago • 22 comments

Made possible by the enhancements provided by #1992. In order of (my relative) priority, as requested.

Video

  • vidstabdetect and vidstabtransform
    • Stabilizes shaky video. Requires libvidstab. See #772.
  • tonemap
    • Facilitates HDR to SDR conversion. See #1307.
  • bm3d
    • BM3D is a state of the art image and video denoiser similar to, but using a different technique than NLMeans.
  • dedot
    • Dot crawl and chroma rainbow filter. The latter can have an effect similar to the more generalized Chroma Smooth filter in #1957. See #1415.
  • lut1d and lut3d
    • Very useful for applying a color grade to high bit depth video produced by professional video cameras. Such video generally looks washed out and compressed before a proper LUT is applied. Very useful for post production using the Production presets (especially the proxies). See #1348.
  • vibrance
    • Saturation boost/cut. Useful for restoring washed out videos and compensating for subtle saturation loss due to denoising and other filtering processes.
  • noise
    • Multiple passes of this filter could be used to create a regrain filter to simulate film grain, useful after denoising.
  • nnedi
    • High quality deinterlacer similar to EEDI2, using neural networks.
  • hqx, super2xsai, and xbr
    • Upscalers useful for sprites such as vintage 1/2/4/8/16-bit games. Not relevant until we allow upscaling in the GUIs according to the proposed Dimensions tab redesign.
  • EQ Filter
    • See #3987

Audio

I'm not certain whether the improvements in #1992 also help with audio, but here's a short list of useful audio filters.

  • acompressor
    • Generalized compressor that works with all audio, unlike AC-3 dynamic range compensation. See #1676 and #1681.
  • alimiter
    • Audio limiter; reduces the volume of level spikes (see also adeclip for restoring over limit peaks). Can also normalize gain. See #1676 and #1681.
  • afftdn
    • FFT audio denoiser; cleans up a noisy signal.
  • anlmdn
    • NLMeans-based audio denoiser; cleans up a noisy signal.
  • agate
    • Reduces quiet background noise and silences noise floor. Useful for podcasting and home videos.
  • crossfeed
    • Blends L and R audio channels to reduce stereo ambiance. Useful for reducing the perceived echo in ultra-wide stereo images, and improving usability for the hearing impaired and people sensitive to wide stereo images when using headphones. Stereo only.

Other User requests

  • Lends Correction (#3326)

bradleysepos avatar Mar 16 '19 01:03 bradleysepos

They don't help with audio, but it would be nice to have a filter pipeline for audio like we do for video. I'll add that to my list :wink:

Thanks!

jstebbins avatar Mar 16 '19 13:03 jstebbins

Going to lead to some pretty complex UI. Some of this, such as stabilisation is more of an NLE task I'd argue.

sr55 avatar Mar 17 '19 13:03 sr55

We should start by identifying the use case(s) for each filter. Do they fix something that our users commonly experience. Does the filter give us something one of our current filters doesn't provide (better suited for some use case, faster, etc.) We will have to document all this for our users if we have overlapping capabilities in filters. Stabilization may be a common problem, I just don't know. I don't know how many action cam users we have. I would suggest a survey, but I don't think our forum members are all that representative of the total user base :frowning_face:

The linux GUI has plenty of room for several additional filters, but I'm not completely happy with the design. So we might want to consider reworking this anyway. Currently the linux GUI orders the filter widgets in the order the filters stages are run. This results in kind of a cluttered look since each filter has different numbers and types of widgets associated with it and things tend not to align well on the screen. Perhaps we could categorize the filters and group them by category. To show the flow through the filters, we could have a visual representation of the enabled filters at the top or bottom of the filter pane. If screen real estate gets tight (or just to create a cleaner look), categories could be expandable. I.e. the filter settings are not visible until you expand a category.

jstebbins avatar Mar 17 '19 15:03 jstebbins

I will be happy to work on a Filters UI revision similar to what I did with the Dimensions tab, if desired.

Until very recently, many NLEs did not have stabilization, requiring the use of an effects compositor or third party plugin. Ironically, mobile apps by third parties such as Instagram/Facebook/etc. have made great strides in realtime stabilization, while most first party camera/video apps don't provide it at all.

Given the prominence of handheld mobile video, I think stabilization would be a win for HandBrake users. I'd use it a lot.

bradleysepos avatar Mar 17 '19 20:03 bradleysepos

If you do add audio filters, I'd love it if sofalizer was one of them

samhutchins avatar Mar 19 '19 09:03 samhutchins

http://ffmpeg.org/pipermail/ffmpeg-devel/2019-April/242691.html

bradleysepos avatar Apr 17 '19 19:04 bradleysepos

Instead off ending up with a pretty complex UI, wouldn't it be possible to just add an "Extra options" box to the filters part (similar to that one in the videos tab)? And then in this box every filter that FFmpeg provides could be applied to the video by entering the syntax from the FFmpeg documentation.

Nomis101 avatar Dec 09 '19 13:12 Nomis101

You could do that, but I would argue that if that box were used, you should disable every other filter (including crop and scale) and assume the user knows what they are doing. Filters must be applied in a particular order to get the correct results. A generic text entry box tells us nothing about where we should place the filter(s) in the pipeline.

jstebbins avatar Dec 09 '19 16:12 jstebbins

Also there is an argument for not including everything in the UI, or potentially hiding a lot of the stuff typical users won't care about.

sr55 avatar Dec 09 '19 16:12 sr55

I had considered this as well, however I think one of HandBrake's strengths is filter presets, so a curated list of filters with tailored presets would be preferable and done well, not very complex.

bradleysepos avatar Dec 10 '19 00:12 bradleysepos

Also there is an argument for not including everything in the UI, or potentially hiding a lot of the stuff typical users won't care about.

I think HDR to SDR conversion is something typical users will care about, especially since AFAIK, UHD Blu-Ray sets of TV shows generally don't come with both HD and UHD discs.

RedSoxFan04 avatar Jan 07 '20 20:01 RedSoxFan04

Adding Request - Lens Correction to the list #3326

sr55 avatar Jan 07 '21 19:01 sr55

For audio filters, I would like to bring up dynaudnorm for discussion.

Nomis101 avatar Mar 11 '21 17:03 Nomis101

For audio filters, I would like to bring up dynaudnorm for discussion.

I've long wanted to add a basic compressor with gain compensation to HandBrake, so this seems useful to me.

:speaker: 🤯 :speaker:

bradleysepos avatar Mar 11 '21 17:03 bradleysepos

Will it have low-pass and high-pass support?

NanaMizukiAnother7 avatar Mar 11 '21 23:03 NanaMizukiAnother7

Some of the links here you may want to check out: https://forum.videohelp.com/threads/401145-Hybrid-not-detecting-GPU-features-Won-t-allow-certain-GPU-accelerations#post2614210

And speaking of ffmpeg, minterpolate unfortunately can only use one core.

60fpshacksrock avatar Mar 25 '21 00:03 60fpshacksrock

For audio filters, I would like to bring up surround and dialogue enhance audio filter for discussion.

Nomis101 avatar Mar 06 '22 17:03 Nomis101

As far as I can see ffmpeg supports the "-vf deshake", can this be considered?

Thanks

wellloaded avatar May 31 '24 10:05 wellloaded

Would curves be of any use?

Perkolator avatar Oct 10 '24 17:10 Perkolator

This might be a bit complicated to implement, but with FFmpeg 8.0 we could implement the whisper filter (--enable-whisper) to automatically make transcriptions from the audio track into a subtitle track. At least it is working for FFmpeg by e.g. $ ffmpeg -i input.mp4 -vn -af "whisper=model=/whisper.cpp/models/ggml-base.en.bin:language=en:queue=3:destination=output.srt:format=srt" -f null - And then adding the srt file as a subtitle file in HandBrake. The thing that would make it tricky to implement it into HandBrake is the model file that is needed, which is quite big. But maybe for everyone who wants to use this we could make a file chooser to choose the model file from any location.

Nomis101 avatar Aug 21 '25 16:08 Nomis101

Right now there are filters exposed on the "filters" pane.

Image

The first question for this issue is: are all the new filters provided by FFmpeg and listed above able to represented in in this pane in this same way?

That is:

  1. Name of filter
  2. On/off/mode selector
  3. A text box and/or preset selector
  4. Additional "tune" dropdown box

And if not then what additional UI is required?

fulldecent avatar Nov 07 '25 17:11 fulldecent

A new filter UI would be greatly appreciated, but at the moment there isn't any plan or anyone working on it.

galad87 avatar Nov 11 '25 07:11 galad87