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

Sinc filter does not work with videos #248

Open
lextra2 opened this issue Mar 12, 2024 · 5 comments
Open

Sinc filter does not work with videos #248

lextra2 opened this issue Mar 12, 2024 · 5 comments

Comments

@lextra2
Copy link

lextra2 commented Mar 12, 2024

Command used to test:
ffmpeg -y -benchmark -init_hw_device vulkan -i "input" -vf "libplacebo=w=iw*2:h=ih*2:upscaler=sinc" -c:v libx264 -preset ultrafast -qp 0 -g 1 -an test123.mkv

Some comparisons:

Spline36 (Avisynth)
spline36

Sinc (Avisynth) How it is supposed to look
sinc

Bilinear (Avisynth)
bilinear

Sinc (libplacebo) Looks blurrier then Bilinear
placebo_sinc

The same thing happens with gpu-next in MPV: mpv-player/mpv#13672

@Chipcraft
Copy link

Can you provide the same source frame you used, as a reference?

Avisynth is using four taps for Sinc, whereas libplacebo uses three taps however, that is unlikely to cause the difference.
Within libplacebo itself, Sinc is clearly superior to bilinear.

@lextra2
Copy link
Author

lextra2 commented Mar 16, 2024

Can you provide the same source frame you used, as a reference?

mpv-shot0001

Within libplacebo itself, Sinc is clearly superior to bilinear.

I've only included bilinear for sharpness comparison

@Chipcraft
Copy link

Cannot replicate the output with libplacebo e987124 and ffmpeg master ab2173c0a5.

ffmpeg -init_hw_device vulkan -i 313426824-3cc2ca8e-7c87-44b7-978d-e7531ea335e3.png -vf libplacebo=upscaler=sinc:w=iw*2:h=ih*2 -pix_fmt rgb24 Sinc_Out.png

https://nle-chipcraft.com/Git/Sinc_Out.png

@lextra2
Copy link
Author

lextra2 commented Mar 16, 2024

Cannot replicate the output with libplacebo e987124 and ffmpeg master ab2173c0a5.

ffmpeg -init_hw_device vulkan -i 313426824-3cc2ca8e-7c87-44b7-978d-e7531ea335e3.png -vf libplacebo=upscaler=sinc:w=iw*2:h=ih*2 -pix_fmt rgb24 Sinc_Out.png

https://nle-chipcraft.com/Git/Sinc_Out.png

Yeah weird. That works.
And
ffmpeg -loop 1 -init_hw_device vulkan -i input.png -c:v libx264 -qp 0 -t 15 -vf libplacebo=upscaler=sinc:w=iw*2:h=ih*2 -pix_fmt yuv420p test.mp4
works too.

But this code
ffmpeg -init_hw_device vulkan -i input.mkv -vf "libplacebo=w=iw*2:h=ih*2:upscaler=sinc" -c:v libx264 -preset ultrafast -qp 0 -an test567.mkv
does not work.

@lextra2
Copy link
Author

lextra2 commented Mar 16, 2024

Here, try this 30 seconds snippet.
Reference frame is at 0:25.025 (Frame 600)

And this time, encode it as video.

Edit: My guess is it only works with RGB inputs, and YUV fails. Pure speculation. Can't test right now.

@lextra2 lextra2 changed the title Sinc filter does not work Sinc filter does not work with videos Mar 16, 2024
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