The encoder supports input commands simulating dynamic events, like dynamic bitrate and key frame insertion. This feature is enabled when a command file is referenced in the configuration file.
[INPUT]
CmdFile = <path>
Each line of the file defines one frame identifier followed by one or more commands applying to this frame. Syntax:
<frame number>: <command>[, <command>]*
Where <command> is one of the following:
| Command | Description |
|---|---|
| SC | Scene Change. |
| LT | Set next encoded picture as long-term reference picture. |
| UseLT | Use the long-term reference picture. |
| Skip | Skip picture. |
| KF | Key-frame (restarting a new GOP with IDR). |
| GopLen=<length> | Change the GOP length. |
| NumB=<numB> | Change the number of consecutive B-frames. |
| FreqIDR=<freqIDR> | Frequency of Intra Decoding Refresh insertion. |
| BR=<Kbits/s> | Change the target bit rate. |
| BR.MaxBR= |
BR.MaxBR=[<targetBitRate in Kbits/s>;<maxBitRate in Kbits/s>] Change the target bit rate and the maximum bit rate. |
| Fps=<frames/s> | Change the frame rate. The new frame rate is immediately applied in the
rate controller. Note: Signaling of the new frame
rate in the SPS is done at the next IDR insertion. If you need to
insert it at the same frame, you can force a key frame insertion
(KF).
|
| IPDelta=<deltaQP> | Change delta QP between I and P-frames. |
| PBDelta=<deltaQP> | Change delta QP between P and B-frames. |
| Input=<fileName> | Select the input to be encoded. |
| LF.BetaOffset=<offset> | Change Loop Filter beta offset. |
| LF.TcOffset=<offset> | Change Loop Filter Tc offset. |
| RP | Recovery point: Start a new GDR frame. |
| QPChromaOffsets= |
QPChromaOffsets=[<Qp1Offset>;<Qp2Offset>] Change Qp chroma offset for current picture and the following in display order. Qp1Offset corresponds to Cb chroma offset and Qp2Offset corresponds to Cr chroma offset for AVC/HEVC/VVC. |
| AutoQP=<(flag)> | Activate or deactivate AUTO_QP mode of QPCtrlMode parameter. QPCtrlMode must be set to LOAD_QP or any type using QPTable, to enable switching between the two modes. To activate AUTO_QP at the beginning, write 0: AutoQP=(true) in a command file. AutoQP takes precedence over QPTable. |
| CostMode=<(flag)> | Activate or deactivate CostMode option. |
| QPBounds=[<min>;<max>] | Change minimum and maximum QP for all frame types. |
|
QPBounds.(IPB)= [<min>;<max>] |
Change minimum and maximum QP for specified type (I, P or B). |
| QPOffset=<QPOffset> | Add an offset to the current QP. Only available when RateCtrlMode is set to CONST_QP. |
| HDRIndex=<hdrIndex> | Select High Dynamic Range index. |
| AutoQPValues= |
AutoQPValues=(<Activate(boolean)>;<D0>;<T0>;<D1>;< T1>;<D2>;<T2>;<D3>;<T3>;<D4>;<T4>;<D5>;<T5>;<D6>) Enable and configure Auto QP values: Threshold QP and delta QP. Threshold QP (T0 to T5) and delta QP (D0 to D6) values describe which delta QP is applied to each of the 7 intervals described by the 6 thresholds. For example, D0 is applied to the frame complexities in the range [0, T0), D1 is applied to the range [T0, T1) and so on. A delta QP is added directly to the current slice QP, therefore, to decrease/increase the latter, it is sufficient to indicate a negative/positive QP. A range is selected depending on the image complexity which normally resides in the order of thousands. Their values should be ascending (for example, T0 < T1 < …). |
| MaxPictureSize= |
MaxPictureSize[.(IPB)]=<MaxPictureSize value in Kbits> Change the value of MaxPictureSize for all or specific frame types. The MaxPictureSize value is applied when the encoder receives the frame buffer. When there is reordering, a shift can be noticed. MaxPictureSize cannot be enabled or disabled dynamically. Also to change the value dynamically, the parameter MaxPictureSize must be defined in the configuration file. |
Example Command File:
2: LF.BetaOffset=3
3: QPChromaOffsets=[4;5]
5: SC
5: NumB=1
10: KF, QP=16
15: NumB=2, LF.TcOffset=5
16: QPOffset=3
19: GopLen=6, BR=10
20: QP=35, QPOffset=0
22: Fps=5
24: CostMode=(true)
26: QPBounds.P=[23;36]
28: QPBounds=[38;51]
30: SpatialNRF=(true;3;6)
35: AutoQPValues=(true;-10;256;-3;1000;-1;2500;0;5001;1;7001;2;9001;3)
45: AutoQPValues=(false)