Problem Description
Hardware device: Apeax Orin NX
System version: 5.1.1
Module: Orin NX 16G
Procedure:
- Generate a YUV file (for reference only; any 1080p file will work)
# Generate file
nvidia@miivii-tegra:/usr/src/jetson_multimedia_api/samples/15_multivideo_encode$
sudo ffmpeg -f lavfi -i testsrc=size=1920x1080:rate=30:duration=10 -pix_fmt yuv420p -y ../07_video_convert/video420.yuv0
2.Enter the NVIDIA video encoding API and modify multivideo_encode_main.cpp
bash
cd /usr/src/jetson_multimedia_api/samples/15_multivideo_encode
Add code to record the encoding completion time in multivideo_encode_main.cpp.
The modified file is as follows:
multivideo_encode_main.txt (35.1 KB)
sudo make
3.Run 8-channel 1080p video encoding to check if it meets the specified parameter of 1080p 30FPS.
Run the following command:
nvidia@miivii-tegra:/usr/src/jetson_multimedia_api/samples/15_multivideo_encode$
sudo ./multivideo_encode num_files 8 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test1.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test2.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test3.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test4.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test5.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test6.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test7.h265 \
…/07_video_convert/video420.yuv0 1920 1080 H265 test8.h265 \
Abnormal Phenomenon
Under 8-channel 1080p30 H.265 encoding, the encoding delay becomes greater than the frame interval.
The output can be seen in the log
nvidia@miivii-tegra:/usr/src/jetson_multimedia_api/samples/15_multivideo_encode$ sudo ./multivideo_encode num_files 8 ../07_video_convert/video420.yuv0 1920 1080 H265 test1.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test2.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test3.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test4.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test5.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test6.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test7.h265 ../07_video_convert/video420.yuv0 1920 1080 H265 test8.h265 \
>
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: H265 : Profile : 1
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 846000
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
NvVideo: bBlitMode is set to TRUE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: H265 : Profile : 1
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 846000
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: bBlitMode is set to TRUE
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: H265 : Profile : 1
Opening in BLOCKING MODE
NVMEDIA: Need to set EMC bandwidth : 846000
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
NvVideo: bBlitMode is set to TRUE
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 846000
NvVideo: bBlitMode is set to TRUE
通道 4 帧 6 编码间隔: 39ms
通道 6 帧 3 编码间隔: 46ms
通道 0 帧 22 编码间隔: 35ms
通道 3 帧 18 编码间隔: 39ms
通道 2 帧 10 编码间隔: 39ms
通道 4 帧 7 编码间隔: 45ms
通道 0 帧 23 编码间隔: 35ms
通道 6 帧 4 编码间隔: 59ms
通道 3 帧 19 编码间隔: 39ms
通道 2 帧 11 编码间隔: 43ms
通道 4 帧 8 编码间隔: 43ms
通道 6 帧 5 编码间隔: 44ms
通道 1 帧 25 编码间隔: 35ms
通道 3 帧 20 编码间隔: 37ms
通道 2 帧 12 编码间隔: 38ms
通道 4 帧 9 编码间隔: 42ms
通道 3 帧 21 编码间隔: 37ms
通道 2 帧 13 编码间隔: 35ms
通道 7 帧 5 编码间隔: 35ms
通道 2 帧 14 编码间隔: 35ms
通道 6 帧 8 编码间隔: 35ms
通道 7 帧 6 编码间隔: 35ms
通道 1 帧 30 编码间隔: 34ms
通道 7 帧 8 编码间隔: 34ms
通道 0 帧 30 编码间隔: 36ms
通道 3 帧 25 编码间隔: 35ms
通道 5 帧 21 编码间隔: 35ms
通道 4 帧 14 编码间隔: 35ms
通道 2 帧 17 编码间隔: 35ms
通道 6 帧 11 编码间隔: 35ms
通道 1 帧 31 编码间隔: 36ms
通道 7 帧 9 编码间隔: 36ms
通道 0 帧 31 编码间隔: 36ms
通道 3 帧 26 编码间隔: 36ms
通道 5 帧 22 编码间隔: 35ms
通道 4 帧 15 编码间隔: 36ms
通道 2 帧 18 编码间隔: 36ms
通道 6 帧 12 编码间隔: 36ms
通道 1 帧 32 编码间隔: 34ms
通道 7 帧 10 编码间隔: 34ms
通道 3 帧 30 编码间隔: 34ms
通道 5 帧 26 编码间隔: 34ms
通道 4 帧 19 编码间隔: 35ms
通道 2 帧 22 编码间隔: 35ms
通道 6 帧 16 编码间隔: 35ms
通道 1 帧 36 编码间隔: 34ms
通道 7 帧 14 编码间隔: 35ms
通道 0 帧 36 编码间隔: 34ms
通道 3 帧 31 编码间隔: 35ms
通道 5 帧 27 编码间隔: 35ms
通道 4 帧 20 编码间隔: 35ms
通道 2 帧 23 编码间隔: 35ms
通道 6 帧 17 编码间隔: 35ms
通道 1 帧 37 编码间隔: 34ms
通道 7 帧 15 编码间隔: 35ms
通道 0 帧 37 编码间隔: 34ms
通道 5 帧 30 编码间隔: 35ms
通道 4 帧 23 编码间隔: 34ms
通道 2 帧 26 编码间隔: 34ms
通道 6 帧 20 编码间隔: 35ms
通道 1 帧 40 编码间隔: 35ms
通道 7 帧 18 编码间隔: 35ms
通道 0 帧 40 编码间隔: 34ms
通道 3 帧 35 编码间隔: 35ms
通道 5 帧 31 编码间隔: 34ms
通道 4 帧 24 编码间隔: 34ms
通道 2 帧 27 编码间隔: 34ms
通道 6 帧 21 编码间隔: 34ms
通道 1 帧 41 编码间隔: 34ms
通道 7 帧 19 编码间隔: 35ms
通道 0 帧 41 编码间隔: 34ms
通道 3 帧 36 编码间隔: 35ms
通道 2 帧 30 编码间隔: 34ms
通道 6 帧 24 编码间隔: 35ms
通道 1 帧 44 编码间隔: 34ms
通道 7 帧 22 编码间隔: 35ms
通道 0 帧 44 编码间隔: 34ms
通道 3 帧 39 编码间隔: 34ms
通道 5 帧 35 编码间隔: 35ms
通道 4 帧 28 编码间隔: 35ms
通道 2 帧 31 编码间隔: 35ms
通道 6 帧 25 编码间隔: 35ms
通道 1 帧 45 编码间隔: 34ms
.................................
..................................
Could not read complete frame from input file
File read complete.
Could not read complete frame from input file
File read complete.
通道 3 帧 286 编码间隔: 34ms
通道 6 帧 272 编码间隔: 34ms
通道 4 帧 275 编码间隔: 34ms
通道 2 帧 278 编码间隔: 34ms
通道 5 帧 282 编码间隔: 34ms
通道 7 帧 270 编码间隔: 34ms
通道 3 帧 287 编码间隔: 35ms
通道 6 帧 273 编码间隔: 34ms
通道 4 帧 276 编码间隔: 34ms
通道 5 帧 283 编码间隔: 34ms
通道 7 帧 271 编码间隔: 34ms
Could not read complete frame from input file
File read complete.
通道 5 帧 286 编码间隔: 34ms
通道 7 帧 274 编码间隔: 34ms
通道 6 帧 277 编码间隔: 34ms
通道 4 帧 280 编码间隔: 34ms
通道 2 帧 283 编码间隔: 34ms
通道 5 帧 287 编码间隔: 35ms
通道 7 帧 275 编码间隔: 34ms
通道 6 帧 278 编码间隔: 34ms
通道 4 帧 281 编码间隔: 34ms
通道 2 帧 284 编码间隔: 34ms
Got 0 size buffer in capture
通道 4 帧 282 编码间隔: 35ms
通道 2 帧 285 编码间隔: 35ms
Got 0 size buffer in capture
Could not read complete frame from input file
File read complete.
Instance 1 executed successfully.
Instance 0 executed successfully.
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
Instance 3 executed successfully.
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
Could not read complete frame from input file
File read complete.
Instance 5 executed successfully.
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
Instance 2 executed successfully.
Got 0 size buffer in capture
Got 0 size buffer in capture
Instance 4 executed successfully.
Got 0 size buffer in capture
Instance 6 executed successfully.
Instance 7 executed successfully.
App run was successful
Other Attempts:
-
sudo jetson_clocks>>> Still encountered frames taking longer than 33ms. -
Reduced the bitrate from
bitrate = 4 * 1024 * 1024to1 * 1024 * 1024(4M to 1M) and 2M >>> The problem persisted.
Points of Inquiry
-
Is calculating the encoding completion time frame by frame in this manner correct?
-
How can the parameter of 8-channel 1080p 30fps H.265 video encoding be achieved?
Additional note: Verifying the parameters does not necessarily require YUV files. I just want to confirm whether this device can achieve the processing speed for 8-channel H.265 encoding at 1080p 30FPS.