720P H.264 video decoding performance
Yesterday I got two test H.264 ES stream files from one of my colleague.
One was encoded by Main Profile, the other was encoded by Baseline Profile.
Weired thing is decoding the Main Profiled file seems much more fast than the Baseline Profiled file.
To release his concerns, today I did some more tests.
First, I double checked with these files together with one another High Profile file.
Here is the test result:
Profile | Instance | FPS | CPU | GPU |
HP | 1 | 629.63575 | <10% | 50% ~ 60% |
HP | 4 | 854.59665 | 40% ~ 50% | 80% |
Main | 1 | 1064.62068 | 20% ~ 30% | 67% |
Main | 4 | 1257.23482 | 40% ~ 50% | 90% ~ 93% |
Baseline | 1 | 740.99021 | <10% | 46% ~ 48% |
Baseline | 4 | 1241.61537 | 30% ~ 50% | 80% ~ 83% |
*CPU usage: max usage on a single core
*GPU usage: max usage of GPU’s bitstream space
According to test result, the Baseline & Main Profile video decoding efficiency seems really strange.
So I checked these test video streams:
Test video sequence bit stream file:
- 720p HP: 720p-lakeside-forest.264 (Standard test sequence)
- 720p Main: 720p-dec-main.264 . Recorded video from one of Kedacom product, A regular moving video, and clearly a rag.
- 720p Baseline: 720p-vid2-baseline.264 .Recorded video from one of Kedacom product, a regular moving video.
Then, I decided to transcode the Baseline profile video(720p-vid2-baseline.264) to a Main Profile video stream, and run one more test for Main Profile H.264 video decoding which will be using a same YUV video sequence with the previous Baseline Profile video decoding test.
Since the H.264 profile setting’s in MSDK is not open for set(but can be set by an indirect way), I ported a x264 to the current test framework(added a new encoder library base on x264).
Finally, I got two more files:
720p-vid2-baseline-still-baseline.264, which major encode setting was “baseline” + “veryfast”, “zerolatency”
Command: ./kdvcodec_msdkenc h264 -i 720p-baseline.yuv -o s.264 -w 1280 -h 720 -b 2000 -f 30 -hw -vaapi -u speed -loop 1 -run 1 -test 0 -cache 500
720p-vid2-baseline-to-main.264, which major encode setting was “ main” + “veryfast”, “zerolatency” profile Main, level 5.2
Command: ./kdvcodec_msdkenc h264 -i 720p-baseline.yuv -o s.264 -w 1280 -h 720 -b 2000 -f 30 -hw -vaapi -u speed -loop 1 -run 1 -test 2 -cache 500
Now run one more test:
Profile | Instance | FPS | CPU | GPU |
Baseline | 1 | 721.26709 | 20% ~ 30% | 67% |
Baseline | 4 | 1218.01066 | 40% ~ 50% | 90% ~ 93% |
Main | 1 | 620.54006 | <10% | 46% ~ 48% |
Main | 4 | 1136.95245 | 30% ~ 50% | 80% ~ 83% |
Conclusion:
- Decoding a ragged video will cost less than decoding a normal video.
- Decoding a Baseline profile video can be more efficiency than decoding a Main Profile by given an even circumstance.
兄弟,请问您是否有科达最新的SDK开发包?如果有的话可否发给我一份。如果没有能不能以其它方式获取视频裸流?请指点一二,我现在对科达无语中……
我不是在监控产线的。但据我所知,科达SDK开发包你可以直接问客服要,如果是涉及保密的一类SDK的话,必须要以公司的名义申请,并签相应的保密协议。