FFAStrans hardware configuration

Questions and answers on how to get the most out of FFAStrans
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: FFAStrans hardware configuration

Post by emcodem »

@veks
for decoding how about that? https://devblogs.nvidia.com/nvidia-ffmp ... ing-guide/

What you should know about decoding on Intel/AMD/Nvidia cards is that you can of course only decode a few configurations of each codec, e.g. little britrate, certain levels etc... and much more interesting is that due to its restrictions (it's a chip), it sometimes delivers defective video (decoding errors) while software decoders would not have any problems with it. So from my experience you can only use the decoders for a workflow where the input video was created by a controlled set of encoders that always deliver the exact same output.

Also, when you do benchmarking and post results, please make sure that you invested all efforts to make sure nothing was disturbing, e.g. when you benchmark encoding, make sure that there is no filtering at all done, e.g. feed the encoder with the exact same resolution, fps, pixel format, color etc... as you encode. Otherwise the speed and result is influenced by factors that are different for every user and the benchmark does not help at all.

To be honest, i gave up to try to play with NVENC/NVDEC because i wanted it for a generic workflow: any file format in, encode proxy using NVENC. But last year it looked like NVENC has lots of issues with the different input formats so my conclusio was that it is too much work to test and correct all the possible issues with wrong color space etc... Additionally i would like to be able to just switch the encoder from NVENC to quicksync but then quicksync has it's own special errors when using different input formats.

You seem to be very keen on this topic, if you keep it up and want to help, please know:
What would really be the key for ffastrans to support at least nvidia encoding would be the solution for all encoder related problems that can occur with any possible input format.
emcodem, wrapping since 2009 you got the rhyme?
veks
Posts: 84
Joined: Fri Oct 25, 2019 6:51 am

Re: FFAStrans hardware configuration

Post by veks »

emcodem wrote: Tue Mar 03, 2020 8:53 pm @veks
for decoding how about that? https://devblogs.nvidia.com/nvidia-ffmp ... ing-guide/

What you should know about decoding on Intel/AMD/Nvidia cards is that you can of course only decode a few configurations of each codec, e.g. little britrate, certain levels etc... and much more interesting is that due to its restrictions (it's a chip), it sometimes delivers defective video (decoding errors) while software decoders would not have any problems with it. So from my experience you can only use the decoders for a workflow where the input video was created by a controlled set of encoders that always deliver the exact same output. Maybe i should ask Nvidia about that topic because they really advertise ffmpeg currently.

Also, when you do benchmarking and post results, please make sure that you invested all efforts to make sure nothing was disturbing, e.g. when you benchmark encoding, make sure that there is no filtering at all done, e.g. feed the encoder with the exact same resolution, fps, pixel format, color etc... as you encode. Otherwise the speed and result is influenced by factors that are different for every user and the benchmark does not help at all.
Typically one concentrates on a single topic for benchmarking, either decoding, filtering or encoding. Combined tests are typically not called benchbark but more kind of a blog.
Yeah, in our scenario where we have same type of live stream as an input (decoding) and same output (multiprofile encoding) GPU is a way to go for sure.
As for FFAStrans, maybe only encoding part could be done via GPU to have fast transcoding of many videos coming in.

But for sure, some answers from NVIDIA would be great ;)
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFAStrans hardware configuration

Post by momocampo »

Hello guys,

It is true Veks, I already tried to use decode and encode with gpu (h264_cuvid and h264_nvenc) and it is quite good. Unfortunately for me, we don't need to decode h264 or 265 here, so I didn't dig far...
For now, I trust CPU and wait some gpu evolutions.
;)
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: FFAStrans hardware configuration

Post by Ghtais »

Perhaps one way to go is to have a check box in the H264 processor node to have the choice to use GPU or not.
In adobe media encoder you can choose between CPU or GPU for example.
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFAStrans hardware configuration

Post by momocampo »

Hi Ghtais,

I'm not sure it's a good idea because :
1-> Just some users can use gpu encoder because it is only available on specific Nvidia Cards.
2-> If you have the specific nvidia card, you just need to use h264_nvenc instead of libx264 inside custom ffmpeg and that's all. Not sure we need to create something specific.
;)
B.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: FFAStrans hardware configuration

Post by emcodem »

Ghtais wrote: Wed Mar 04, 2020 1:34 pm Perhaps one way to go is to have a check box in the H264 processor node to have the choice to use GPU or not.
In adobe media encoder you can choose between CPU or GPU for example.
It is not a matter of putting some checkbox somewhere. All the profile configuration and such for the hardware encoders are different than for the software encoders and have their own logics and restrictions. Additionally we have detected 2 other major problems:
1) as mentioned the hardware encoders are picky about the input format and ffmpeg does not yet apply the needed filters automatically, so it is not yet possible to provide a "generic" encoding node as any other encoding node that we have right now. This would lead to inconsistent behaviour which is something we want to avoid. I already mentioned, we dont have any experience with delivery formats in the team yet, we would need someone to come up with a sophisticated list about all the flaws that need to be worked around when using the Nvidia encoder with different input formats (e.g. which formats need special pix_format conversion).

2) we would need another or additional resource controlling as the current resource control looks at the CPU utilisation only

Until we solved all the problems, you can just use the custom ffmpeg node :-)
emcodem, wrapping since 2009 you got the rhyme?
veks
Posts: 84
Joined: Fri Oct 25, 2019 6:51 am

Re: FFAStrans hardware configuration

Post by veks »

Not sure if OBS Studio community can help with this?
https://obsproject.com/download
As OBS Studio has support for all of that about hardware encoding.
As their source code is available on GitHub, might check how they do it?
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: FFAStrans hardware configuration

Post by emcodem »

veks wrote: Wed Mar 04, 2020 2:13 pm Not sure if OBS Studio community can help with this?
Nice approach to peek to some other existing tools but unfortuantely OBS does not seem to utilize ffmpeg.exe at all.
To be honest i don't think it will help a lot to peek at other tools, unless there was some tool that had a very similar approach than ffastrans does. Somehow i feel we just need to invest the needed engineering resources ;-)

But again, the number of users for this feature would be pretty small compared to the needed engineering efforts and we don't have lots of resources available in general. Additionally, before we start utilizing other Hardware than CPU, we would need to re-engineer the resource management anyways so no need to concentrate on the encoding part currently.
emcodem, wrapping since 2009 you got the rhyme?
veks
Posts: 84
Joined: Fri Oct 25, 2019 6:51 am

Re: FFAStrans hardware configuration

Post by veks »

emcodem wrote: Wed Mar 04, 2020 3:33 pm
veks wrote: Wed Mar 04, 2020 2:13 pm Not sure if OBS Studio community can help with this?
Nice approach to peek to some other existing tools but unfortuantely OBS does not seem to utilize ffmpeg.exe at all.
To be honest i don't think it will help a lot to peek at other tools, unless there was some tool that had a very similar approach than ffastrans does. Somehow i feel we just need to invest the needed engineering resources ;-)

But again, the number of users for this feature would be pretty small compared to the needed engineering efforts and we don't have lots of resources available in general. Additionally, before we start utilizing other Hardware than CPU, we would need to re-engineer the resource management anyways so no need to concentrate on the encoding part currently.
Of course :) I understand, somewhere in future.
We all know that FFAStrans has huge potential, step by step.

OBS Studio at least for recording and other "recording" output can use FFMpeg if selected - http://prntscr.com/rbudob
Also, you can use it's built-in Custom FFMpeg settings via recording tab to stream also via FFMpeg settings via let's say UDP like this http://prntscr.com/rbueqc
As for setting a Video Encoder, you can choose any of these depending on what hardware you have: http://prntscr.com/rbug9b
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: FFAStrans hardware configuration

Post by emcodem »

veks wrote: Thu Mar 05, 2020 7:32 am OBS Studio at least for recording and other "recording" output can use FFMpeg if selected
Yeah, they seem to use the ffmpeg (libav*) libraries natively instead of using ffmpeg.exe. That is something we will never do with ffastrans, it would require far too much development and maintainance efforts...
Even if OBS would drive ffmpeg.exe instead of Libavcodec, they don't seem to support the "any format on input" usecase which is what we need.
emcodem, wrapping since 2009 you got the rhyme?
Post Reply