-
Notifications
You must be signed in to change notification settings - Fork 3k
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
how to encode and output file from anime4k? #9589
Comments
|
thank you for reply,but when i use |
See manual. windows does not support now. |
thank you, it seems that I can only wait until later to add support for Win |
If your ffmpeg is built with the corresponding options, you can use the |
more detial? |
I compiled the latest ffmpeg commit with libplacebo filter, but i'm getting this error when trying to add it to my command
|
Thank you @haasn , this is what ended up working for me, just had to explicitly add the format on both ends, also i don't know if this is the correct way to apply multiple shaders |
That's a bit wasteful, it would be much better to That said, to make it significantly less wasteful, you could add |
Can you upscale video by this command successfully? There's something wrong when I use the command. the error in cmd: |
check if your local build support vulkan |
Supported hardware device types: |
So, obviously no. |
Can I use "cuda" instead of "vulkan"?
|
My ffmpeg(v5.0) build doesn't support vulkan, how to solve the problem or if there's anyway else to achieve outputting videos from Anime4K? And I also have a question about |
With a standard Linux installation of GLSL for MPV, here's the full command I used to render the output. It works like a charm. IIRC this should be using the same shaders as mpv input.mp4 --no-sub --glsl-shaders="~/.config/mpv/shaders/Anime4K_Clamp_Highlights.glsl:~/.config/mpv/shaders/Anime4K_Restore_CNN_VL.glsl:~/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~/.config/mpv/shaders/Anime4K_AutoDownscalePre_x2.glsl:~/.config/mpv/shaders/Anime4K_AutoDownscalePre_x4.glsl:~/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_M.glsl" -vf=gpu="w=3840:h=2160" --o=output.mkv Edit: this should be easier to read. mpv input.mp4 \
--no-sub \
--glsl-shaders="\
~/.config/mpv/shaders/Anime4K_Clamp_Highlights.glsl:\
~/.config/mpv/shaders/Anime4K_Restore_CNN_VL.glsl:\
~/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:\
~/.config/mpv/shaders/Anime4K_AutoDownscalePre_x2.glsl:\
~/.config/mpv/shaders/Anime4K_AutoDownscalePre_x4.glsl:\
~/.config/mpv/shaders/Anime4K_Upscale_CNN_x2_M.glsl" \
-vf=gpu="w=1216:h=2160" \
--o=output.mkv |
@k4yt3x There's a mistake in your last command, the width should be 3840, not 1216 |
That's for the specific video I'm processing. Just do the calculations and change it to whatever you need it to be. |
现在在windows上不能使用--vf=gpu的话是不是就无法保存anime4k放大的视频了?Windows在运行下面的命令时候总是会报错: |
it's |
Because there is no implement in windows. #9589 (comment)
No, it's vf not vo. It's clear in the doc and previous comments. |
I encoded video using this command: I got output file 1440p resolution, but it looks shaders are not applied - output file looks same as input. It just scaled file. Did anyone find way to encode video with Anime4K shaders? Platform: Windows |
FFmpeg with |
Already tried all ways from this thread, still getting errors. |
Is that 1650 in a laptop or desktop? What you have said is.. I have errors and this is my model of graphics card... If you have a laptop with integrated and dedicated graphics. This might be a solution to your problem. IDK https://www.reddit.com/r/vulkan/comments/qsthqq/enable_vulkan_for_gtx_1650_laptop/ |
Sorry for not providng more info the script i use was: i am using the latest version of ffmpeg |
@Sanaan01 If you're using a prebuilt ffmpeg binary, try looking for an older release from a month ago. Much easier than building it yourself - though I do have documentation on building ffmpeg and mpv yourself if needed. |
Okay will try that when I downloaded ffmpeg i just used the latest release @FarisR99 march 20th build is fine i presume |
Thank you both for your time it works now I assume I should use CPU encoder to give better quality right? |
I don't see a noticeable difference in quality, so I just use GPU. |
Does anyone know how to make this work on an Apple Silicon Mac with Videotoolbox? |
Is it common for file size to be reduced drastically like a 40gb 1080p remuc of a silent voice went to 6gb when its converted to 4K |
Completely depends on the encoder and encoder settings, but this is definitely possible. NVENC on a 1650 uses the older architecture (cant remember the names) and isn't as good as 20 series+, but use whatever produces a video where you don't notice obvious artifacts |
Yea it went speed 0.2x took a while left it on overnight. |
I don't have an apple silicon Mac to try so I can only suggest options based on documentation that I have read. Try this for h264 Or maybe this for h265 The 50 can be 0 - 100 where 0 is the worst and 100 is the best. Try out different numbers with small video clips and compare quality to find the best number for your use case. |
@ryandash thanks for the suggestions! Unfortunately, I don't think Apple Silicon Mac supports vulkan. This is the error I got:
ffmpeg -hwaccels:
Is it possible to apply the shaders without using vulkan? Edit: I've also tried
|
@Tama47 If you use MPV instead of ffmpeg, OpenGL rendering is an option (provided it's compiled with the required libraries). But I don't know if it'll work on your setup. |
Can anyone help me?
|
Do you have the same issues with just w=3840:h=2160? I do not know what device you are using for playback but can the device play other local 8k content? 8k can be pretty demanding especially because you are encoding your video with h.265 and not h.264. Are you using Bluetooth audio? IDK what player you are using but depending on the device and player, bluetooth audio sync could be an issue. Reconnecting the Bluetooth device may fix that. |
@FarisR99 What would the commands be for mpv? I would also like to give it a try. |
@Tama47 I forgot that the OpenGL implementation was only added as part of the MR adding support for vf=gpu to Windows, followed by my own commit to allow selecting the api as an argument My fork of mpv is public which has these changes merged into master, but a few additional tweaks like respecting |
I got a question to ask does a higher cq value mean more compressed or less compressed and does it mean that your getting higher quality?
And what about cpu encoding I don't see a way to change the values on that script? |
Recent versions of libplacebo have required Vulkan versions incompatible with lavu Vulkan hwcontexts. While this is expected to change eventually, breaking vf_libplacebo every time there is such a transition period is obviously undesired behavior, as the following sea of bug reports shows. This commit adds a fallback path for init_vulkan failures which simply creates an internal device if there was no user-supplied Vulkan hwaccel. Useful when no interop with lavu vulkan hwframes is needed or desired, and makes using this filter easier inside certain applications. Fixes: haasn/libplacebo#170 Fixes: mpv-player/mpv#9589 (comment) Fixes: mpv-player/mpv#11363 Fixes: mpv-player/mpv#11685 (comment) Closes: https://code.videolan.org/videolan/libplacebo/-/issues/270
Hello everyone, |
Please stop, I don't want to see random video files in the wild ruined by your meme sharpening filter |
Thank you, you're really a lifesaver |
I'm trying with ffmpeg but I'm crashing with out of memory error, my GPU is an 1650 with 4GB of VRAM |
Ffmpeg runs out of VRAM on my 12GB 6700XT even without shaders so I think it's just an Ffmpeg/libplacebo bug, probably need 16GB VRAM or something to not crash (some files worked fine though). |
I see, someone reported the problem? I'm not sure if I have the right to report memory issue with a 4GB card |
I created an ticket in ffmpeg bug report site: https://trac.ffmpeg.org/ticket/10665 |
I don't have an account there but this is what it looks like for me: https://i.imgur.com/nDQ1DQe.png Doing just 1080p->1440p: |
I have no problem playing anime4k video via mpv, and I have no problem playing it via command line, but I want to output the video to 1080p, how should I achieve that?
command
mpv input.mkv --no-sub --vo=gpu --glsl-shaders="
/shaders/Anime4K_Clamp_Highlights.glsl;/shaders/Anime4K_Restore_CNN_VL.glsl;/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;/shaders/Anime4K_Restore_CNN_M.glsl;/shaders/Anime4K_AutoDownscalePre_x2.glsl;/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"it work and play as well
but command
mpv input.mkv --no-sub --vo=gpu --glsl-shaders="
/shaders/Anime4K_Clamp_Highlights.glsl;/shaders/Anime4K_Restore_CNN_VL.glsl;/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;/shaders/Anime4K_Restore_CNN_M.glsl;/shaders/Anime4K_AutoDownscalePre_x2.glsl;/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl" -vf scale=1440:1080 --o=output.mkvNo effect,
how can i set the Resolution to 1080p and output the anime4k video?
The text was updated successfully, but these errors were encountered: