Flickering noise

Any filter listed in the MLT Framework documentation, yes. Not all FFmpeg filters have MLT wrappers. And some are specifically black-listed because they modify the frame rate, which would break the MLT engine.

Note that frei0r and a few other goodies are in the MLT Framework list, too.

Apologies, I may have misinterpreted your question. If you were asking which of the three filters are the best for fixing this video clip, that is unfortunately difficult to say.

Those three filters tackle deblocking in different ways. They each specialize for a different kind of source. Deblocking isn’t a set-it-and-forget-it type of thing and there are no optimized generic settings. It takes a quick test, usually with several parameter sets, to match the filter to the specific type of artefact produced by the camera.

Wish I had a faster solution for you, but I don’t. This is where filter UIs would be very helpful.

HandBrake has an implementation of HQDN3D and NLMeans that is different than the FFmpeg implementation. Maybe try those and see if they offer better results.

Actually, thinking on it some more, NLMeans might be halfway graceful at handling this issue.

http://ffmpeg.org/ffmpeg-all.html#nlmeans-1
https://mltframework.org/plugins/FilterAvfilter-nlmeans/

Most recent beta doesn’t strip those filters out

How hard is it to implement default filter view to allow editing of what is set in MLT? Say for

   <filter id="filter_fspp" >
      <property name="mlt_service">avfilter.fspp</property>
      <property name="av.quality">4</property>
      <property name="av.qp">10</property>
       <property name="disable">1</property>
   </filter>

just have an input field for “av.quality” and “av.qp”, etc?

This is very cool!

It’s pretty straight-forward, especially if using another filter as a start point then customizing it.

If you’re on Windows, look in this folder:

C:\Program Files\Shotcut\share\shotcut\qml\filters\vaguedenoiser

Copy the vaguedenosier folder to a new filter name like fspp then customize the two files inside it.

It is Shotcut.app/Contents/Resources/shotcut/qml/filters/vaguedenoiser on MacOS.

There are two compiled files if the folder. How do I compile qml?

I think deblocking is helping some with my couch noise.

Here is original noise

pp filter applied

<filter id="0_pp" >
  <property name="mlt_service">avfilter.pp</property>
   <property name="av.subfilters">ac</property>
 <property name="disable">0</property>
</filter>

PP7

<filter id="0_pp7" >
  <property name="mlt_service">avfilter.pp7</property>
  <property name="av.qp">20</property>
  <property name="av.mode">1</property>
   <property name="disable">0</property>

SPP

<filter id="0_spp" >
  <property name="mlt_service">avfilter.spp</property>
   <property name="av.quality">5</property>
  <property name="av.qp">10</property>
  <property name="av.mode">hard</property>
  <property name="disable">0</property>

FSPP

<filter id="0_fspp">
  <property name="mlt_service">avfilter.fspp</property>
  <property name="av.quality">4</property>
  <property name="av.qp">10</property>
  <property name="av.strength">5</property>
  <property name="disable">0</property>
</filter>

My money are on FSPP at this point :wink:

Still even with FSPP there are those large color blocks noticeable on the couch. Any idea what fspp parameter to tweak to get rid of them?

Shotcut compiles it automatically when restarted.

To my eye, that couch is looking pretty good, or at least complementary to everything else in the scene. Are the blocks more noticeable during playback?

I don’t have an FSPP recommendation because the settings are so tightly bound to the source… I would have to play with it same as you. However, there is another filter called deband that dithers flat color areas, which might create the illusion of more detail.

Nice work!

They are, but I think I figured out how to get rid of the flicker.

The “magic” is FSPP + HQDN3D :joy:

FSPP settings higher than 5/8/8 or 5/10/5 range don’t do much apart from washing out picture. Wavelet didn’t work out on that noise neither. However, HQDN3D Temporal 10% got rid of the temporal flicker. Yey!

Frame doesn’t do justice, but I am pretty happy with

<filter id="0_fspp">
  <property name="mlt_service">avfilter.fspp</property>
  <property name="av.quality">5</property>
  <property name="av.qp">8</property>
  <property name="av.strength">8</property>
  <property name="disable">0</property>
</filter>
<filter id="0_hqdn" >
  <property name="version">0.1</property>
  <property name="mlt_service">frei0r.hqdn3d</property>
  <property name="0">0.15</property>
  <property name="1">0.1</property>
  <property name="disable">0</property>
</filter>

In fact it is pretty magical :smile:

Now, before I kick it up a notch with the same problem on 1080i material, what deinterlacer Shotcut uses by default before any other filter?

On 1080i should I use
<profile progressive="0" ... frame_rate_num="30000" frame_rate_den="1001" colorspace="709"/>

and then bring in some deinterlacing filter say yadif and then fspp, etc and render as progressive=1?

Why yadif_cuda is not supported by MLTframework?

Export tab > Advanced > Deinterlacer > [choices]

You should not have to add your own deinterlace filter. I’m pretty sure Shotcut deinterlaces the frame before handing it to the first filter in the chain, then re-interlaces for export if required. I don’t mess with interlaced any more than I absolutely have to, so I could be wrong, but that’s the best I recall.

I am pretty sure Export Tab deinterlacer is applied after frame goes thru filters.

Here is 1080i material I applied same fspp+hqdn3d to combat similar flicker


Interlacing is pretty visible.

I am wondering if fspp would work on interlaced material?

If not, I am thinking to bring in yadif and deal with the flickering noise same as on 1080p60. In that case do I set progressive=“1” in

<profile progressive="1" ... frame_rate_num="30000" frame_rate_den="1001" colorspace="709"/>
and treat timeline as progressive?

That wouldn’t make any sense. Why deinterlace at the end of the pipeline right before re-interlacing it again for export? Also, most filters don’t work on interlaced material.

Is this in the preview window or final export? The preview window is controlled from the menu by Settings > Deinterlacer > One Field or Linear Blend. Neither will look as good as YADIF and will be visible during preview.

If you do bring in YADIF, what about deinterlacing with ffmpeg and bwdif prior to bringing the clip into Shotcut just to make life easy?

The image that I uploaded is Export Frame on
<profile progressive=“0” … frame_rate_num=“30000” frame_rate_den=“1001” colorspace=“709”/>

Setting in MLT
<profile progressive=“1” … frame_rate_num=“30000” frame_rate_den=“1001” colorspace=“709”/>
brings in some deinterlacer built into mltframework. What deinterlacer is it?

For the preview window, it is whatever is defined by menu > Settings > Deinterlacer. So, one field or linear blend.

For final export, it is whatever is defined by Export > Advanced > Video tab > Deinterlacer.

For Export Frame… I have no idea. :rofl:

I don’t believe this is accurate because in my opinion Export Frame being interlaced when MLT is progressive=“0” proves that export deinterlacer is applied at the end. When MLT is progressive=“1” some internal deinterlacer is applied and whatever is set in Export > Advanced > Video tab > Deinterlacer is irrelevant since timeline is Progressive.

Anyway, I think I might have figured out how to deal with the same flickering noise on 1080i material.

As I thought denoisers were tripping because they cannot deal with interlaced material, so most important and first thing to do with 1080i is to deinterlace. It could be done simply by importing 1080i material into 1080p MLT or setting progressive=“1” in profile in MLT.

Then the same FSPP+HQDN3D “magic”. :joy:

FSPP with same settings work on 1080i too

<filter id="0_fspp">
  <property name="mlt_service">avfilter.fspp</property>
  <property name="av.quality">5</property>
  <property name="av.qp">8</property>
  <property name="av.strength">8</property>
  <property name="disable">0</property>
</filter>

However HQDN3D on 1080i is more sensitive to temporal setting and creates ghost artifacts above 6% and I have to sacrifice more with 20% spatial

<filter id="0_hqdn" >
  <property name="version">0.1</property>
  <property name="mlt_service">frei0r.hqdn3d</property>
  <property name="0">0.2</property>
  <property name="1">0.06</property>
  <property name="disable">0</property>
</filter>

Overall it is harder with 1080i and I don’t know how to combat this artifact

that doesn’t show in Export Frame

Is 1080i at 29.97 is really 1/4 of information vs. 1080p60?

On another note… fspp slows export about 5 times.

How do I make it faster?

My CPU is utilized 50% and from experience this 50% CPU utilization on 2 threads per core processors is ffmpeg filters thing. I don’t know enough about mltframework relationship with ffmpeg, thus the question - can I make mltframework thread more somehow?

I’m not following the logic. If a deinterlacer was applied at the end, the exported video would be progressive by virtue of being deinterlaced. If a deinterlacer was applied at the end and immediately re-interlaced to meet the output format requirement, the export just did busywork to get back where it already was.

Correct, which means Shotcut uses an internal deinterlacer before handing the frame to the filters. Best I recall (my memory is sketchy on this), Shotcut doesn’t actually re-interlace (separate the fields). It just sets the flags to signal that the content is interlaced.

Shotcut should be doing this internally automatically.

This isn’t necessary to invoke the deinterlacer. All this will do is leave the export format progressive, as opposed to flag it as interlaced for the export.

Technically, half. 1080i is 60 fields per second, which is half a frame, therefore half the information.

Yeah, these are heavy filters and they don’t thread well. MLT is just a wrapper and can’t generally control threading. MLT just hands off to FFmpeg and then FFmpeg does whatever it does at native speed. Are you noticing a command-line FFmpeg transcode going faster than Shotcut UI?

I haven’t tried that nor do I think plain FFmpeg would go faster. My memory is sketchy on this but I have this preconception from years ago that FFmpeg filters or at least some FFmpeg filters just don’t load CPU fully. I was just hoping that over years (over a decade already actually) things got better and it is just my prejudice :wink:

Looking at my notes on [commercial] Red Giant Denoiser that trips on this noise in the first place… fspp+hqdn3d is at least 3-5 to 10 times faster! :+1:

Technically 60 fields are from different frames, so… depending on deinterlacing it could be between 1/2 and 1/4 of the information. That is why I am so curious about Shotcut’s internal deinterlacer that we have misunderstanding about.

I believe when 1080i is brought into 1080p timeline/mlt some internal de-interlacer is applied prior to any other filter and then material is progressive and Export > Advanced > Video tab > Deinterlacer has no effect. Look at this post

The question is what is that

deinterlace=deinterlace,avdeinterlace

When mlt is progressive=“0”, I believe, based on clearly interlaced Export Frame that I uploaded earlier that included my filters and all, that Export > Advanced > Video tab > Deinterlacer is applied AFTER all filters and before feeding now progressive frame to the encoder.

Do I, may be, explaining the difference more clearly?

In my experience with “my couch noise” there is a big difference between when I have interlaced mlt vs. exactly the same mlt with progressive=“1” in mlt profile.