Comments (6)
Hey @JosephM101, it's true that the current version only supports hardware acceleration with CUDA. I think it would make sense to include acceleration for AMD GPUs as well, however I'm unable to test this myself as I don't have an AMD GPU. In case you'd like to look into this issue yourself, I'd be glad to accept a PR. The current CUDA acceleration support is done by adding the required FFmpeg options in the download configuration class:
Vividl/Vividl/Model/DownloadConfigurations.cs
Lines 24 to 31 in ecd29c6
Adding AMD GPU support should work equivalently.
from vividl.
I went through the FFmpeg documentation and found arguments to enable AMD acceleration, and I played around with them a bit to figure out how to get it to work. I found that calling -hwaccel auto
and -vcodec h264_amf
yielded speedy results, with my laptop encoding a 1080p H.264 video at up to 3x the speed.
I set an additional parameter (-quality quality
) since not passing this resulted in a fairly iffy output. It slowed down the encode a very slight bit, but the output was considerably better compared to not passing it, so I figured it was a worthy change.
With the arguments combined, I ended up with a final command that looked similar to the following:
ffmpeg -hwaccel auto -i "video_raw.mp4" -vcodec h264_amf -quality quality "video_amd.mp4"
Here's a code snippet I wrote based on the config code that you provided me and the arguments I found to work the best:
if (Settings.Default.FFmpegAmdAcceleration && download.GetExt() == "mp4")
{
// Example command that enabled AMD acceleration:
// ffmpeg -hwaccel auto -i "raw_video.mp4" -vcodec h264_amf -quality quality "amd_video.mp4"
options = options ?? new OptionSet();
// Use AMD-based H.264 encoder for MP4
options.PostprocessorArgs = "ffmpeg:-vcodec h264_amf -quality quality";
// Add another post-processor option for input file args
options.AddCustomOption("--postprocessor-args", "ffmpeg_i1:-hwaccel auto");
}
I will do some more testing once I get the time, such as testing the above code snippet. I'm thinking about cloning the source code and making the additions/changes myself to see if the solution works. However, if it's possible for you to provide me with source code containing the necessary baseline changes (adding the settings/GUI options) so that all I have to do is mess with the OptionSet()
arguments to see what works best, that would be great in terms of time and hassle on my end, although I completely understand if that kind of request is unreasonable.
I will follow-up with more findings once I get the chance to do some more testing. Thank you for reaching out to me!
from vividl.
Hey @JosephM101, thanks for investigating this.
I'm thinking about cloning the source code and making the additions/changes myself to see if the solution works.
Would greatly appreciate this!
if it's possible for you to provide me with source code containing the necessary baseline changes (adding the settings/GUI options) so that all I have to do is mess with the OptionSet() arguments to see what works best
Sure, I made some initial changes for the integration in 67c3730. Most importantly, I changed the FFmpegCudaAcceleration
boolean flag to an enum (HwAccelMode
) to support more than two options. The settings change is already integrated into the UI. To build the modified version, checkout the branch https://github.com/Bluegrams/Vividl/tree/dev/hwaccel.
To add your changes, please replicate this branch to your forked repository, modify it there, then open a pull request back to this repo once you have a working solution.
Let me know if anything is unclear!
from vividl.
I have cloned the branch in GitHub desktop, but upon opening the solution in Visual Studio, the code is riddled with errors saying things can't be found.
I have tried restarting Visual Studio and rebuilding the NuGet package cache, but that has fixed nothing.
I'm using Visual Studio 2022 at the moment. I'm hoping you can tell me what version you use, and how you have set up your dev environment, so that I can replicate the environment in a VM.
EDIT: My apologies. I was completely overlooking the fact that my NuGet environment was set for a different dev environment. I reset the variables and it is now compiling. However, I do get the occasional error that stops building, but it works after cleaning & rebuilding the solution:
from vividl.
There appears to be an issue with the code you've provided. I went into Settings to attempt to change the encoder format, and noticed I was getting an error on conversion. The reason is that when changing what encoder is used, the change is not saved. Upon opening Settings, the drop-down selection is empty.
When opening the Settings window, this error appears in the output:
System.Windows.Data Error: 40 : BindingExpression path error: 'HardwareAcceleration' property not found on 'object' ''Settings' ...
EDIT: I fixed the issue. It was just a typo in SettingsWindow.xml
.
from vividl.
I went the extra mile and added (experimental) Intel QSV support, as well as the option to enable it. I don't have any devices to test this on at the moment, but given that AMD AMF and Intel QSV are within the same ballpark as far as supported codecs, it should just work on Intel iGPUs about the same.
I have also made the pull request with both the AMD and QSV changes. Let me know if anything is unclear. I'm currently investigating an issue where running the same FFmpeg command from the terminal yields better performance than Vividl. Not sure if it's a threading thing.
from vividl.
Related Issues (20)
- Prevent vividl from crashing HOT 1
- Videos won't export to wav.
- error while downloading any video
- How do I specify the video quality? HOT 1
- Proxy configuration HOT 1
- vividl preferences/settings are not being kept when vividl is updated
- Warning Message Due to Missing ffprobe File
- vividl crash log
- Add ability to download a whole channel
- Minor Portable Issue
- Error Crash
- Incomplete Video Downloads and Lack of Disk Space Error Handling
- Vividl fails to download videos possibly because the filenames are invalid in Windows HOT 2
- Direct Share & URL Protocol
- Auto-import is adding duplicate videos
- Add batch downloading and automatic detection and addition of and automatic paste url addresses of the clipboard without clicking paste button
- Add the "extract audio" option to reduce the size of the downloaded file and automatically extract the audio track from dailymotion videos
- Exit, hibernate, shutdown after downloads finsih
- Add m3u8 support with new awesome rare powerful downloaders engines to compensate possible censorship or bugs of yt-dlp HOT 1
- How to add the current time to the default file name HOT 1
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 vividl.