You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to ask you, if it would be possible to implement a method for video encoding that would have one extra parameter, that would be of data type byte[] and would be the result of encoding. And the method would be of void return type. The method would not create new byte[] instances as it does now, but overwrite the input byte[] which would be the result. Furthermore, a method to calculate the resulting byte[] size would need to be implemented. This would reduce the resulting amount of byte[] instances and thus reduce the Garbage Collector (‘GC’) overhead resulting in increased application performance.
For better understanding please see my code below:
There are constantly new byte[] instances that the GC must remove. And because of real-time video, it produces a large amount of instances.
Why would I like to see the above-mentioned change? So that I can create arrays using ArrayPool and actually just send that given array as a parameter that would be filled with encoded image. This method shouldn't load the GC that much.
Please see the example below to better understand my vision. I would like to achieve something similar to this:
Where do I see the problem?
Unnecessary GC loading. IVideoEncoder doesn't have any such method that would return the size of the resulting byte[] as a result. And EncodeVideo doesn't have a possibility to override the parameter that would be the output byte[], but it keeps creating new byte[] instances. I use VpxVideoEncoder
Many thanks in advance for your reply. And please accept my apologies if the mistake is on my side or if it is not possible to implement the method this way.
Kind regards,
OM
The text was updated successfully, but these errors were encountered:
Dear all,
I would like to ask you, if it would be possible to implement a method for video encoding that would have one extra parameter, that would be of data type byte[] and would be the result of encoding. And the method would be of void return type. The method would not create new byte[] instances as it does now, but overwrite the input byte[] which would be the result. Furthermore, a method to calculate the resulting byte[] size would need to be implemented. This would reduce the resulting amount of byte[] instances and thus reduce the Garbage Collector (‘GC’) overhead resulting in increased application performance.
For better understanding please see my code below:
Why would I like to see the above-mentioned change? So that I can create arrays using ArrayPool and actually just send that given array as a parameter that would be filled with encoded image. This method shouldn't load the GC that much.
Please see the example below to better understand my vision. I would like to achieve something similar to this:
Where do I see the problem?
Unnecessary GC loading. IVideoEncoder doesn't have any such method that would return the size of the resulting byte[] as a result. And EncodeVideo doesn't have a possibility to override the parameter that would be the output byte[], but it keeps creating new byte[] instances. I use VpxVideoEncoder
Many thanks in advance for your reply. And please accept my apologies if the mistake is on my side or if it is not possible to implement the method this way.
Kind regards,
OM
The text was updated successfully, but these errors were encountered: