下载
GitHub:
client 端:https://github.com/AmoAmoAmo/Smart_Device_Client
server端:https://github.com/AmoAmoAmo/Smart_Device_Server
另还写了一份macOS版的server,但是目前还有一些问题,有兴趣的去看看吧:https://github.com/AmoAmoAmo/Server_Mac
使用VideoToolbox硬解码H264。
关于这一部分,由于是第一次使用,便不班门弄斧,
在参考文章中列举了不少说得很详细的博客。
关于最终的效果,可以参考第一篇的文章
部分过程
初始化编码器session
- (void)initVideoToolBox {
if (!mDecodeSession) {
// 把SPS和PPS包装成CMVideoFormatDescription
const uint8_t* parameterSetPointers[2] = {mSPS, mPPS};
const size_t parameterSetSizes[2] = {mSPSSize, mPPSSize};