fifonik / FFMetrics

Visualizes Video Quality Metrics (PSNR, SSIM & VMAF) calculated by ffmpeg.exe
562 stars 22 forks source link

About cropping black edges #117

Closed f10555 closed 1 year ago

f10555 commented 1 year ago

Many source videos have top and bottom black edges, and if I crop the black edges and re-encode them, I want to be able to compare the quality of the two. How should I do this? If there is no ready way to do this, I suggest adding the ability to compare reference videos after cropping.

fifonik commented 1 year ago

Unfortunately, you cannot do it in this program directly right now.

There are million of scenarios for adjusting videos: resize, crop, convert colour range/frame rate, adjust colour/sharpen/saturatio, etc + combinations. I do not have plans to add into the simple video quality metric calculation frontend UIs for all these adjustments. Sorry.

I understand your exact situation and it have some sense. You can do one of the following:

f10555 commented 1 year ago

Thanks for the reply, I am currently using the second method and I like FFMetrics!

f10555 commented 1 year ago

Another request, I've never used avs before, so I wonder if you could please give me a sample .avs file from which I can modify it to my own, many thanks!

fifonik commented 1 year ago
DirectShowSource("ref.mp4")
Crop(offsetX, offsetY, width, heigh)

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/directshowsource.html Other source filters can also be used (this depend on your source file). I'm trying not to use the DirectShowSource filter as it is the most inacurate (but works almost everywhere and no installation required, so use it as starting point)

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/crop.html

f10555 commented 1 year ago

Thank you for your patience:)

I did some research and installed AviSynthPlus_3.7.2_20220317.exe. I created a "ref.mp4" (x.264/AAC), and a "test.avs" file in the same directory.

The content of test.avs is only two lines: DirectShowSource("ref.mp4") Crop(0,94,1280,532)

When I dragged the ref.mp4 directly into FFMetrics, it recognized the video correctly. But when I dragged test.avs into FFMetrics, it didn't seem to work.

Also, I tried to install the plugin and use the FFmpegSource2 filter and again it does not work. Please forgive my complete lack of understanding of the AviSynth system, am I making some basic mistake?

Screenshots: 20230429205145 20230429205403

fifonik commented 1 year ago

I'd exclude FFMetrics for now from experiments and check if the avisynth installed correctly and your script works.

To do this you can install some playes that support avs (MPC-HC or MPC-BE). To check the avisynth installation you can use simple script: http://avisynth.nl/index.php/Version Create the test script, save it and drag it onto the player's window. It should play. If not -- something not right with the avisynth installation. Then drag your script onto player's window. It should play as well. If not -- something not right with your script (I noticed strange quotes used in your avs-script).

FFmetrics should work with avs: image

f10555 commented 1 year ago

Well, I think I understand what you mean, I will spend more time learning Avisynth, thanks again for your help!

I did check and the "strange quotes" should not be a problem, that's just the Chinese font I used in Notepad to read the Chinese content.

Have a great day bro!