ni_quadra_split
The ni_quadra_split filter provides the same functionality as the FFmpeg software split filter but it also provides a way to access the 2nd and 3rd decoder outputs. A Netint hardware frame can contain up to 3 outputs. The first one is directly accessible through the hardware frame, the other 2 can only be accessed through ni_quadra_split.
Parameters
The following are the parameters for the ni_quadra_split filter. Output0 corresponds to the default decoder output frame while output1 and output2 are the extra outputs on multi-output decoding. The integer value provided to each parameter corresponds to the number of copies of the specified output to produce. Note that the ni_quadra_split filter does not actually do any processing on the hardware, it simply adds references to output buffers and gives access to the multiple outputs of the decoder.
output0
Specifies number of copies of output 0 to output as HWAVFrame.
| Supported Values | Integers from 0 to 128 |
| Default | 2 |
output1
Specifies number of copies of output 1 to output as HWAVFrame.
| Supported Values | Integers from 0 to 128 |
| Default | 0 |
output2
Specifies number of copies of output 2 to output as HWAVFrame.
| Supported Values | Integers from 0 to 128 |
| Default | 0 |
The following example uses multiple decoder outputs with scaling in the decoder post processor. Note that the decoder scales can only scale down. Using the scalers in the decoder output is an alternative to the 2D Engine which is a shared resource and could affect performance if more heavily used. ni_quadra_split is used to select the 1st, 2nd, and 3rd decoder output for mapping to the 3 encoders. The encoders are located on the same device as the decoder (-enc -1) to avoid all YUV transfers.
ffmpeg -c:v h264_ni_quadra_dec -dec 0 -xcoder-params "out=hw:enableOut1=1:scale1=1280x720:enableOut2=1:scale2=854x480" -i demo_1920x1080p30.h264 -filter_complex '[0:v]ni_quadra_split=1:1:1[out1][out2][out3]' -map '[out1]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=10000000" 1080p.265 -map '[out2]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=4000000" 720p.265 -map '[out3]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=1000000" 480p.265
The following is an example using ni_quadra_split and ni_quadra_scale on Quadra. Ni_quadra_split is used to select 3 copies of output 0 and create new hardware AVFrames that can be used to access this output and feed them to each 2D engine. The ni_quadra_scale filters are collocated on the same hardware as the decoder as are the encoders (-enc -1) to avoid all YUV transfers. Using the below method we can get different scale quality.
ffmpeg -c:v h264_ni_quadra_dec -dec 0 -xcoder-params "out=hw" -i demo_1920x1080p30.h264 -filter_complex '[0:v]ni_quadra_split=3:0:0[out1][in2][in3];[in2]ni_quadra_scale=1280:720[out2];[in3]ni_quadra_scale=854:480[out3]' -map '[out1]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=10000000" 1080p.265 -map '[out2]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=4000000" 720p.265 -map '[out3]' -c:v h265_ni_quadra_enc -enc -1 -xcoder-params "RcEnable=1:vbvBufferSize=3000:bitrate=1000000" 480p.265
Another example using PPU 0/1/2, ni_quadra_split, for generating more than 3 ladders
ffmpeg -c:v h264_ni_quadra_dec -dec 0 -xcoder-params out=hw:lowDelay=1:enableOut1=1:enableOut2=1:scale1=1280x720:scale2=960x540 -i input.list -filter_complex "[0:v]ni_quadra_split=2:1:2[out1][out2][out3][out4][in5];[in5]ni_quadra_scale=640:360[out5]" -map [out1] -xcoder-params gopPresetIdx=9:RcEnable=1:bitrate=5000000:intraPeriod=60 -c:v h264_ni_quadra_enc -enc 0 -f null - -map [out2] -xcoder-params gopPresetIdx=9:RcEnable=1:bitrate=3500000:intraPeriod=60 -c:v h264_ni_quadra_enc -enc 0 -f null - -map [out3] -xcoder-params gopPresetIdx=9:RcEnable=1:bitrate=2000000:intraPeriod=60 -c:v h264_ni_quadra_enc -enc 0 -f null - -map [out4] -xcoder-params gopPresetIdx=9:RcEnable=1:bitrate=1000000:intraPeriod=60 -c:v h264_ni_quadra_enc -enc 0 -f null - -map [out5] -xcoder-params gopPresetIdx=9:RcEnable=1:bitrate=600000:intraPeriod=60 -c:v h264_ni_quadra_enc -enc 0 -f null -