Git Product home page Git Product logo

Comments (25)

forart avatar forart commented on May 25, 2024 1

...what about hwaccel auto ?

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

Hi, thanks for the suggestion. I will work on this.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

I released an update for you to test.

Press the arrow button in Axiom to update through PowerShell, or download from here
https://github.com/MattMcManis/Axiom/releases

Update


A few issues with Intel QSV:

I'm using the Software decode option -init_hw_device qsv=hw -filter_hw_device hw.
I couldn't get the regular -hwaccel qsv -c:v h264_qsv to work. It gives the error Decoding pixel format '(null)' is not supported.

and

x265 -c:v hevc_qsv gives loading plugin error, but x264 -c:v h264_qsv works.

https://trac.ffmpeg.org/wiki/Hardware/QuickSync


Examples

Works

ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i input.mpg -c:v h264_qsv output.mp4

Doesn't Work

ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i input.mpg -c:v hevc_qsv output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mpg -c:v h264_qsv output.mp4
ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.mpg -c:v hevc_qsv output.mp4

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@forart

I did not know it exists, I will add it in the next update soon.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@forart

For -hwaccel auto, it works when converting mp4mp4, mp4webm, or webmwebm.
It automatically selects dxva2.

But when converting webmmp4 I get the error:

Cannot load cuvidGetDecodeStatus
Failed loading nvcuvid.
Failed setup for format cuda: hwaccel initialisation returned error.
Cannot load cuvidGetDecodeStatus

I'm not able to test it properly with my hardware. I'll add auto option, but leave off as the default so that users don't get hardware errors right out of the box.

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

Hello Matt, thanks for the support.

Everything was fine, only Intel QSV was wrong for me.

This was the result of my tests on one input with 15.1 MB with different HW/A options

  • The result for other options (like cuda, d3d11va , dxva2) was 14.9 MB
  • -hwaccel qsv -c:v h264_qsv works but not same result like others. (output : 62.5 MB !)
  • -init_hw_device qsv=hw -filter_hw_device hw -c:v h264_qsv works but not same result like others. (output : 62.5 MB !)

But -hwaccel qsv -c:v libx264 works fine and result was like others (output : 14.9 MB)

I think should not change the video codec (-c:v) but, just enough to set -hwaccel qsv

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

Thanks for the info, I will change Intel QSV to use -hwaccel qsv -c:v libx264, but it's not able to auto-detect the input codec for all media, so it may have to just be -hwaccel qsv.

I'm planning to split the HW Accel options into 2 menus, decode and transcode.
Take a look at the options in this post #41 (comment), let me know if it looks correct.

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

Thanks, but I don't have enough knowledge to comment on this case :)

from axiom.

forart avatar forart commented on May 25, 2024

@MattMcManis

For -hwaccel auto, it works when converting mp4mp4, mp4webm, or webmwebm.
It automatically selects dxva2.

But when converting webmmp4 I get the error:

Seems an FFMPEG's bug.

Here's an interesting (verbose) discussion about FFMPEG hw encode:
https://emby.media/community/index.php?/topic/10723-gpu-transcoding-intel-quicksync-and-nvidia-nvenc/

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi @forart

I've released an update with some new options:

  • HW Accel Decode and Transcode menus.
  • HW Accel Decode option auto.
  • HW Accel Transcode option AMD AMF for x264/x265.
  • Video Tab has new Sub Tabs, Encoding, Color, Size, to reduce the vertical scrolling height.

These changes could introduce new bugs, you will have to test it out and let me know how it works. Certain HW Accel options may need the required Intel/Nvidia/AMD hardware.
Some HW Accel Transcode codecs are only available for x264/x265.

https://github.com/MattMcManis/Axiom/releases

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

All Transcode options with Decode: CUDA gives an error for me.

Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
Conversion failed!

This is output script for decode CUDA and transcode off or auto that gives error.

-hwaccel cuda -hwaccel_output_format cuda 
-c:v libx264 

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

Can you find the correct options that work and post the script?


https://trac.ffmpeg.org/wiki/HWAccelIntro#NVDECCUVID

Sample decode using CUDA:

ffmpeg -hwaccel cuda -i input output

Full hardware transcode with NVDEC and NVENC:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input -c:v h264_nvenc -preset slow output

I'm not able to test it with my setup, I get the error:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mpg -c:v libx264 output.mp4
Cannot load cuvidGetDecodeStatus
Failed loading nvcuvid.
Failed setup for format cuda: hwaccel initialisation returned error.
Cannot load nvEncodeAPI64.dll

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

I was only able to get the correct result from the below script (no full hardware transcode - by removing -hwaccel_output_format cuda)

-hwaccel cuda
-c:v libx264 

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

I will change it in an update.

Does the Intel QSV work for you?
It uses -hwaccel qsv -hwaccel_output_format qsv.


Info I could find on -hwaccel_output_format:

https://gist.github.com/Brainiarc7/95c9338a737aa36d9bb2931bed379219

-hwaccel_output_format : This option should be used every time you declare the -hwaccel method as vaapi , so that the decode stage takes place entirely in hardware. This option generates decode output directly on VAAPI hardware surfaces, speeding up decode performance significantly.

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

Yes, it works well.

@MattMcManis , I don't know enough about ffmpeg hwaccel, but if you want, I can give you access to my machine (via AnyDesk or etc...) to test different scripts as you wish.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

Thanks, I'll let you know if needed.

I've released an update for hwaccel cuda, and some other improvements, changelog.

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

Run button doesn't show any reaction anymore in v1.8.3-alpha ?!

But script for CUDA is OK now 👍.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

Are you sure? It is working for me. I added support for CMD and PowerShell in the last update.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

If you want to, open a separate Issue for the Run button. I am looking into it, trying to optimize the code and find bugs, but I'm unable to reproduce the error.

Let's keep this thread for HW Accel.

from axiom.

mjebrahimi avatar mjebrahimi commented on May 25, 2024

Of course, I opened a new issue and explained the cause of the problem.

Thanks again for your support on HW Accel.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

I found a problem with Intel QSV.
CRF -crf does not work, only Bit Rate -b:v 1 and 2 Pass works.
CRF ends up setting the lowest default bit rate when used with -c:v h264_qsv.


https://trac.ffmpeg.org/wiki/Hardware/QuickSync

It says "ICQ mode (which is similar to crf mode of x264)" -global_quality 25
But I cannot get it to work. I get the error Selected ratecontrol mode is unsupported.


I've fixed quite a few bugs and added some new features in v1.8.6.0.

from axiom.

MattMcManis avatar MattMcManis commented on May 25, 2024

@mjebrahimi

It looks like none of the HW Accel codecs will work properly with CRF, they all have their own arguments.

I will have to make a system for the CRF slider that automatically converts the values into -rc:v vbr_hq -cq:v values along with bit rate.

https://superuser.com/a/1236387/740888

from axiom.

forart avatar forart commented on May 25, 2024

As posted in the above FastFlix "issue", I found some interesting resouces for qsv encodes/filters:

Hope that helps/inspires !

from axiom.

forart avatar forart commented on May 25, 2024

OK, seems the (greatest ?) hardware accelerated video encoders expert is @Brainiarc7 here.

I believe he could help us to understand better how to create a right commandline for FFMPEG encodings.

from axiom.

Brainiarc7 avatar Brainiarc7 commented on May 25, 2024

from axiom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.