Comments (4)
I have an example of using ffmpeg's libplacebo filter here, relevant snippet:
ffmpeg -y -init_hw_device vulkan -i images/anime/mountain_adventurer.webp -vf 'crop=128:128:y=128,format=yuv420p,gblur=0.625,hwupload,libplacebo=w=128:h=128:custom_shader_path=$?,hwdownload,format=yuv420p,scale=256:256:flags=neighbor' $@
($?
and $@
are replaced by the shader path and the output filename respectively.)
So you need to specify a vulkan device with -init_hw_device
, you need to do hwupload
first, you need to do hwdownload
after libplacebo
, and you may need to specify an appropriate format
before and/or after. Also you put libplacebo=custom_shader_path=
twice in your command.
Is it using the upscaling algorithm in libplacebo first, before applying anime4k? How can I achieve my original goal that only use anime4k to upscale?
If your output resolution (libplacebo's w
and h
parameters) is 2x the input resolution and you apply a shader that does a 2x upscale, then the shader should be doing all of the upscaling.
from anime4k.
I have an example of using ffmpeg's libplacebo filter here, relevant snippet:
ffmpeg -y -init_hw_device vulkan -i images/anime/mountain_adventurer.webp -vf 'crop=128:128:y=128,format=yuv420p,gblur=0.625,hwupload,libplacebo=w=128:h=128:custom_shader_path=$?,hwdownload,format=yuv420p,scale=256:256:flags=neighbor' $@
(
$?
and$@
are replaced by the shader path and the output filename respectively.)So you need to specify a vulkan device with
-init_hw_device
, you need to dohwupload
first, you need to dohwdownload
afterlibplacebo
, and you may need to specify an appropriateformat
before and/or after. Also you putlibplacebo=custom_shader_path=
twice in your command.Is it using the upscaling algorithm in libplacebo first, before applying anime4k? How can I achieve my original goal that only use anime4k to upscale?
If your output resolution (libplacebo's
w
andh
parameters) is 2x the input resolution and you apply a shader that does a 2x upscale, then the shader should be doing all of the upscaling.
thanks a lot for your answering!
if i don't use -init_hw_device vulkan
, 'hwpoload' and 'hwdownload' these three options for transcoding, I noticed some GPU usage. Does this mean shaders are being used for processing?
from anime4k.
Seeing GPU usage is a good sign but you should compare the output to the input to ensure that the shaders are working, you should also see that the output resolution is 2x the input resolution.
from anime4k.
Thank you for the reply, but I am still not clear about the specific functions of hwupload and hwdownload. The information I could find only provides simple descriptions of their roles. If I don't add these options, why would the GPU still be occupied? Does this mean adding or not adding these parameters does not affect shader invocation? Or does ffmpeg automatically upload streams to VRAM for processing when handling video and audio streams? If so, what is the significance of manually specifying upload and download?
Also, I noticed that if I directly remove hwdownload, there are still no issues. Does this mean hwdownload is unnecessary?
from anime4k.
Related Issues (20)
- MPV always opens with Anime4K enabled. HOT 1
- Cant figure out setup on android HOT 3
- Setting up on Android MPV player?
- GAN models vs Shaders? HOT 1
- How to train the model on custom dataset? HOT 1
- S and M size for 4x upscalers? HOT 1
- Best chain of shaders for highest quality and upscaling HOT 9
- Requesting Deleted Shader (GAN X2 UL) HOT 2
- How to use Anime4K GLSL for Bitmap HOT 1
- Black and white shaders HOT 5
- How to train/load S/M/L CNN models in tensorflow? HOT 33
- Load the shaders in Android media3 (Exoplayer) HOT 2
- Can be install on a Plex server ? HOT 3
- Anime4k CNN input type HOT 1
- How do I use this outside of realtime video playback? HOT 7
- Anime4k training HOT 1
- Complete tutorial how to train Anime4K on my own dataset? HOT 1
- Upscale filter no longer working - unsure why HOT 8
- [Q] How do I apply Anime4k GLSL filters on images? HOT 4
- How do I convert glsl to hlsl? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anime4k.