Jump to content

Enable AMD gpu for FFmpeg?

Go to solution Solved by WereCatf,
2 hours ago, Electronics Wizardy said:

shoudl be decoder=dxva2(ithink, try it)

You use "-hwaccel yourdecoderhere" or "-hwaccel auto" nowadays.

2 hours ago, Electronics Wizardy said:

x264 encoding

x264 is the specific software for encoding, H.264 is the codec; x264 outputs H.264. Not the same thing, you can't output x264.

 

3 hours ago, huyuc0ng said:

I think h264_amf works with amd gpu?

Yes, it is. You'd use it as follows:

ffmpeg -hwaccel auto -i video.mp4 -c:v h264_amf output\%05d.jpg

Do notice that I added "-hwaccel auto" there since that speeds up the decoding-process as well. It helps to use H/W-accel for both decoding and encoding.

 

EDIT: Forgot to mention that you can check all the various h264_amd - specific settings with:

ffmpeg -h encoder=h264_amf

EDIT2: I am more awake now and actually read what the OP wrote. You can't output JPG-files with a H.264-encoder, so h264_amf isn't useful in this scenario in the first place.

 

I am working on a project that required transcoding bunch of h264 videos into jpeg. I did a test on my own 1050ti gpu, the testing video is 1080p at about 2.5Mbit/s.

ffmpeg -i video.mp4 -c:v h264_nvenc output\%05d.jpg

The result is about 90 to 100 fps.

 

And now I need to build a server with AMD gpu (considering rx470, 480, 580)

The videos would be uploaded from users, not longer then 15 seconds (450frames)

I did a little searching, I think h264_amf works with amd gpu? But I dont have a amd gpu on my hand.

So let me know how to enable, and how fast RX480 can be.

Thanks

Link to comment
https://linustechtips.com/topic/1084630-enable-amd-gpu-for-ffmpeg/
Share on other sites

Link to post
Share on other sites

I have done some testing with amf vs nvenc vs x264 and quicksync.

 

AMF has awful quality, id stay away if you can, nvenc is much better.

 

on my 480 i could get to around 4.5x realtime on 1080p, and about 6x realtime on my vega 56. You need  to use the hardware decoder to do this also. Quality of all the amf encoders I tested from a r9 270, r9 290x, rx 480 and vega 56 were about the same.

 

 

Link to post
Share on other sites

3 minutes ago, Electronics Wizardy said:

I have done some testing with amf vs nvenc vs x264 and quicksync.

 

AMF has awful quality, id stay away if you can, nvenc is much better.

 

on my 480 i could get to around 4.5x realtime on 1080p, and about 6x realtime on my vega 56. You need  to use the hardware decoder to do this also. Quality of all the amf encoders I tested from a r9 270, r9 290x, rx 480 and vega 56 were about the same.

 

 

So how to use hardware decoder on AMD gpu? Is that nvenc also available on AMD?

Link to post
Share on other sites

2 hours ago, Electronics Wizardy said:

shoudl be decoder=dxva2(ithink, try it)

You use "-hwaccel yourdecoderhere" or "-hwaccel auto" nowadays.

2 hours ago, Electronics Wizardy said:

x264 encoding

x264 is the specific software for encoding, H.264 is the codec; x264 outputs H.264. Not the same thing, you can't output x264.

 

3 hours ago, huyuc0ng said:

I think h264_amf works with amd gpu?

Yes, it is. You'd use it as follows:

ffmpeg -hwaccel auto -i video.mp4 -c:v h264_amf output\%05d.jpg

Do notice that I added "-hwaccel auto" there since that speeds up the decoding-process as well. It helps to use H/W-accel for both decoding and encoding.

 

EDIT: Forgot to mention that you can check all the various h264_amd - specific settings with:

ffmpeg -h encoder=h264_amf

EDIT2: I am more awake now and actually read what the OP wrote. You can't output JPG-files with a H.264-encoder, so h264_amf isn't useful in this scenario in the first place.

 

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×