Optimize Command to Encode HEVC


(Tracy Fang) #1

Hi,
I have tried using beamrtrans to transcode 4K file to HEVC main 10(420p 10-bit depth). My target is to get encoding efficiency above 60fps after all.
The command line I am using:

beamrtrans -i input.mp4 -o test.mp4 -v hevc -vprofile “main 10” -bv 15000
And results:
Statistics: time=681.3sec, size=297.5MB, fps=17.38, frames=11842, bitrate=12629.66kbps

Any options should I add or change?
By the way the CPU of the machine is Xeon Goden 6130, and I have 192G memory (6x32). Also the CPU seems not using fully when progress running, any options to make it more threads (cores) running?


(Beamr Support) #2

Hi Tracy,

Thank you for your question and detailed information on your setup.
Please see our suggestions on improving performance below:

  1. We recommend to use faster HEVC encoding presets, like “-vepr UltraFast” or “-vepr InsaneFast”

  2. To improve CPU utilization by encoder, create encoder configuration file “hevc.cfg” ( specified as “-vas hevc.cfg” in command line) and add following multi-threading settings to it:
    mt.num_threads = 16
    mt.num_wf_lines = 8
    mt.num_frames = 16
    mt.max_frames = 16
    mt.aff_masks[0] = 0x000000000000FFFF

  3. Additionally, you can restrict a number of threads assigned to decoder to better utilize each CPU thread:
    -i “file=./input.mp4;*.decoder.mt.num_threads=8;”

Resulting modified command lines look like this:

Ultra Fast preset:
beamrtrans -i “file=./input.mp4;*.decoder.mt.num_threads=8;” -o test.mp4 -v hevc -vprofile “main 10” -vas hevc.cfg -vb 15000 -vepr UltraFast

Insane Fast preset:
beamrtrans -i “file=./input.mp4;*.decoder.mt.num_threads=8;” -o test.mp4 -v hevc -vprofile “main 10” -vas hevc.cfg -vb 15000 -vepr InsaneFast

Please also note target bitrate is specified by “-vb” parameter.

Please let us know your results with suggested command lines above.

Thank you!


(Tracy Fang) #3

Hello,
I have get improvement on encoding. And I am trying to make the quality of output better.
Thank you for suggestions.
I will update my status if any other problems occurs.

Thanks again.


(Tracy Fang) #4

Hi,

To get better quality of image, I tried to change preset to faster/fast and the multi-threading settings you suggested. However, I only get 16 cores running around 100% and others are around 30-40% (16 or more cores according to my multi-threading setting.)
May I ask the coherent between these parameters as well as the decoder threads number setting?

mt.num_threads = 16
mt.num_wf_lines = 8
mt.num_frames = 16
mt.max_frames = 16
mt.aff_masks[0] = 0x000000000000FFFF

Thank you.


(Beamr Support) #5

Hi Tracy,

This configuration does bind 16 encoding threads (specified as mt.num_threads = 16) to a first 16 CPU threads in system via affinity mask (specified as mt.aff_masks[0] = 0x000000000000FFFF).
mt.aff_masks parameter is a 64-bit value (16-digit in HEX) where each bit
corresponds to a (0-indexed) physical CPU thread. Setting a bit to 1 allows binding encoder
thread to the corresponding CPU thread. The value of 0 (zero) prevents using the
corresponding CPU thread for the encoder tasks.

The rest of mt. settings control the parallelization density and also affect memory consumption:

mt.num_wf_lines = 8 - Number of wave-front lines in one group processed in parallel (8 max)
mt.num_frames = 16 - Number of frames processed in parallel (16 max)
mt.max_frames = 16 - Maximum number of frames allocated for multi-threading (96 max)

Decoder will use the rest unoccupied number of threads that was indicated in command line.
Depending on an input compressed stream format that you’re using, it may be helpful to specify the exact number of threads for decoder.

Thank you!


(Tracy Fang) #6

Hello,
I have found this article http://media2.beamrvideo.com/pdf/Beamr_Intel_NAB_2017_PR.pdf.
And it shows we can get real time live on Xeon E3-1585 by encoding HEVC 4K HDR stream. May I ask the detail about the command of this test and what kind of quality of the result video (bitrate? and I think live means fps at 60) ?
Thank you very much!


(Beamr Support) #7

Hi Tracy,

Please note this article and demo is related to a separate product - Beamr 5 Encoder SDK, while your question is about Beamr Transcoder product.

On a single Xeon E3-1585 Beamr 5 did provide 4Kp30 10 bit real time encoding, additionally using Intel GPU acceleration.
From that moment Beamr 5 developments went far ahead in direction of increasing software-only encoding performance efficiency.
Nowadays similar performance can be achieved by encoder sample application fastest preset, using only CPU.

In regards to Transcoder, as we suggested earlier, we expect following command line (using fastest encoder preset) to provide real-time 4Kp60 10 bit transcoding on your 16-core Xeon Gold 6130 CPU:

Insane Fast preset:
beamrtrans -i “file=./input.mp4;.decoder.mt.num_threads=8;” -o test.mp4 -v hevc -vprofile “main 10” -vas hevc.cfg -vb 15000 -vepr InsaneFast*

Thank you!


(Tracy Fang) #8

Hi,

I will carry on testing on Beamr Transcoder.
And how can I get Beamr 5 Encoder SDK? I need to do related test which can produce quality encoded video(equivalent to preset slower) and the encoding speed can reach the live requirement of 4Kp60.

Thank you.


(Beamr Support) #9

Hi Tracy,

Thank you for your interest in Beamr 5 Encoder SDK.

We have a specific form you can fill to request more information about Beamr products.
You’re welcome to submit your request for Beamr 5 Encoder SDK here:
https://go.beamr.com/info

Thank you!