Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto crop inaccurate #296

Closed
Rayman24365 opened this issue Feb 9, 2022 · 5 comments
Closed

Auto crop inaccurate #296

Rayman24365 opened this issue Feb 9, 2022 · 5 comments

Comments

@Rayman24365
Copy link

Fastflix detected the auto crop to 48 pixels top and bottom.
VidCoder detected auto crop to 42 pixels top and bottom.
Encoded both and Vidcoder was correct as with crop at 42 pixels I had zero black pixels on top and bottom.
Possibly the auto crop detection is inaccurate.

@cdgriffith
Copy link
Owner

You can increase accuracy at the expense of a bit more time taken when loading videos by going to Settings and changing "Crop Detect Points"

It works by using ffmpeg "cropdetect" at different points in the video (up to the number specified in settings) and will use the one that detects the most possible to crop.

I am not sure how filter itself works, or how other tools do theirs so I cannot really comment on accuracy of the algorithms chosen beyond that.

@Rayman24365
Copy link
Author

Well, should anyone ever ask you this again, I think I found the answer. It's indeed not FastFlix but ffmpeg related as you stated.
Ffmpeg likes to stick to multiples of 16 because codecs (used to) prefer that for lower overhead. Nowadays it doesn't matter.
So the actual crop was 42 like I discovered, but FastFlix is bullied by ffmpeg to use 48 (16x3) to stick to that old adaggio.

If I understand it correctly ffmpeg CAN be told to not use multiples of 16 pixels but can use 4 or even 2 (just has to be even for compatibility sake), but it defaults to a 16 pixels multiple for cropping.
So until (perhaps) this is resolved in FastFlix I will have to use Vidcoder, or any other tool, to confirm the actual crop.
A pixel is a pixel!

@cdgriffith
Copy link
Owner

Ah, thanks for that heads up. I will change the cropdetect to round to 2 instead of 16!

@Rayman24365
Copy link
Author

Excellent, glad I could contribute to this gem!

cdgriffith added a commit that referenced this issue Feb 11, 2022
cdgriffith added a commit that referenced this issue Mar 5, 2022
* Adding #163 audio matching in profiles (thanks to bmcassagne)
* Adding #261 Advanced settings are currently not saved on Profiles (thanks to georgesaumen)
* Fixing #296 low quality auto-crop due to high rounding, increasing accuracy from 16 to 2 pixels (thanks to Rayman24365)
cdgriffith added a commit that referenced this issue Mar 11, 2022
* Adding #164 audio matching in profiles (thanks to bmcassagne)
* Adding #261 Advanced settings are currently not saved on Profiles (thanks to georgesaumen)
* Adding HDR10 support, svtav1-params, scene detection, and crf option for SVT AV1
* Adding max colors and stats mode to GIF
* Adding OpenCL support for Remove HDR to speed it up
* Changing FFmpeg download to look for latest master GPL builds
* Fixing #296 low quality auto-crop due to high rounding, increasing accuracy from 16 to 2 pixels (thanks to Rayman24365)
* Fixing concat builder behavior to work smoother
* Fixing thumbnail generation for concat images
@cdgriffith
Copy link
Owner

Lowered the window to 2 pixels instead of 16, thanks for bringing this to my attention! https://github.com/cdgriffith/FastFlix/releases/tag/4.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants