...
Code Block | ||
---|---|---|
| ||
decoder_priority=OPENH264,FF |
7. Restart WCS.
Lowering multithreaded encoding threshold
By default, multithreaded encoding is enabled for 720p and higher profiles. Sometimes it is necessary to lower this threshold to encode 480p streams also in two and more threads
Code Block | ||
---|---|---|
| ||
video_encoder_second_thread_threshold=408950 |
Reducing memory allocations for decoding
To reduce memory allocations for decoding, since build 5.2.559 the ability to use buffer pools for decoded pictures is added. The feature can be enabled with the following parameter
Code Block | ||
---|---|---|
| ||
decoder_buffer_pool=true |
In this case, a pool of buffers will be allocated for every incoming picture resolution. When buffer is not needed any more, it is not deleted, but returned to pool. To get memory usage information, statistic collection should be enabled with the following parameter
Code Block | ||
---|---|---|
| ||
decoder_buffer_pool_stats=true |
Statistic is available by the following query (JSON format only)
Code Block | ||||
---|---|---|---|---|
| ||||
curl -s 'http://localhost:8081/?action=stat&format=json&groups=decoder_buffer_pool_stats' |
and grouped by pools
Code Block | ||||
---|---|---|---|---|
| ||||
{
"decoder_buffer_pool_stats": {
"decoder_buffer_pool_info": {
"decoder_buffer_pool_info_pools": {
"3072x1536": {
"decoder_buffer_pool_width": 3072,
"decoder_buffer_pool_height": 1536,
"decoder_buffer_pool_size_bytes": 84934656,
"decoder_buffer_pool_leased": 6,
"decoder_buffer_pool_allocated": 12
},
"1280x720": {
"decoder_buffer_pool_width": 1280,
"decoder_buffer_pool_height": 720,
"decoder_buffer_pool_size_bytes": 688584704,
"decoder_buffer_pool_leased": 0,
"decoder_buffer_pool_allocated": 3605
}
},
"decoder_buffer_pool_total_size_bytes": 773519360
}
}
} |
Where
- decoder_buffer_pool_total_size_bytes - total memory size allocated to all the pools in bytes
- decoder_buffer_pool_width - pool picture width
- decoder_buffer_pool_height - pool picture height
- decoder_buffer_pool_size_bytes - memory size allocated to the pool in bytes
- decoder_buffer_pool_leased - buffers used count in the pool
- decoder_buffer_pool_allocated - buffers allocated ciunt in the pool
The memory allocated to buffers unused can be freed by /debug/decoder/shrink_buffer_provider_pools REST API query
Freeing the memory allocated to buffers unused
REST query should be HTTP/HTTPS POST request as follows:
- HTTP: http://test.flashphoner.com:8081/rest-api/debug/decoder/shrink_buffer_provider_pools
- HTTPS: https://test.flashphoner.com:8444/rest-api/debug/decoder/shrink_buffer_provider_pools
Where:
- test.flashphoner.com - WCS server address
- 8081 - standard REST / HTTP port of WCS server
- 8444 - standard HTTPS port
- rest-api - URL mandatory part
- /cdn/profile/print - REST query used
REST queries should be sent to Edge server.
REST query | Response states | Description |
---|---|---|
/debug/decoder/shrink_buffer_provider_pools | 200 – OK 500 – Internal Server Error | Shrink decoding buffer pools |
Stream transcoding by two or more profiles with the same video parameters
...