正在显示
1 个修改的文件
包含
9 行增加
和
3 行删除
| @@ -1322,12 +1322,18 @@ int srs_write_h264_ipb_frame(Context* context, | @@ -1322,12 +1322,18 @@ int srs_write_h264_ipb_frame(Context* context, | ||
| 1322 | 1322 | ||
| 1323 | // 5bits, 7.3.1 NAL unit syntax, | 1323 | // 5bits, 7.3.1 NAL unit syntax, |
| 1324 | // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. | 1324 | // H.264-AVC-ISO_IEC_14496-10.pdf, page 44. |
| 1325 | - // 7: SPS, 8: PPS, 5: I Frame, 1: P Frame | ||
| 1326 | - SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(frame[0] & 0x1f); | 1325 | + // 5: I Frame, 1: P/B Frame |
| 1326 | + // @remark for rtmp, we only need to send the I/P/B frames to server, | ||
| 1327 | + // the aud is used for server to remux stream to annexb. | ||
| 1328 | + // TODO: FIXME: we must group NALUs between AUD to a frame. | ||
| 1329 | + SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f); | ||
| 1330 | + if (nut != SrsAvcNaluTypeIDR && nut != SrsAvcNaluTypeNonIDR) { | ||
| 1331 | + return ret; | ||
| 1332 | + } | ||
| 1327 | 1333 | ||
| 1328 | // for IDR frame, the frame is keyframe. | 1334 | // for IDR frame, the frame is keyframe. |
| 1329 | SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame; | 1335 | SrsCodecVideoAVCFrame frame_type = SrsCodecVideoAVCFrameInterFrame; |
| 1330 | - if (nal_unit_type == SrsAvcNaluTypeIDR) { | 1336 | + if (nut == SrsAvcNaluTypeIDR) { |
| 1331 | frame_type = SrsCodecVideoAVCFrameKeyFrame; | 1337 | frame_type = SrsCodecVideoAVCFrameKeyFrame; |
| 1332 | } | 1338 | } |
| 1333 | 1339 |
-
请 注册 或 登录 后发表评论