PHZ76/RtspServer

播放h265视频遇到的现象

lqian opened this issue · 8 comments

lqian commented

大牛这项目太牛了。在使用中遇到一个现象,写入H265包到session,发现用VLC 3.0.12可以播放,VLC 2.2.2也可以播放,用ffmpeg播放后台一直打印这样的错误信息, 不能看到画面。如果是播放H264视频,则ffmpeg, vlc均正常。请问大神,应该从那方面入手解决这个现象。

rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 15 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 15 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 15 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 19 times
[rtsp @ 000001ba01fa8a00] Illegal temporal ID in RTP/HEVC packet0
Last message repeated 15 times

PHZ76 commented

你好,可以贴下调用的代码我看看吗

lqian commented

非常感谢up主。
从嵌入式硬件拿到的是一个NALU整包,代码直接push到session,很简单,dump设备流保持到一个h265文件,供up主参考
链接: https://pan.baidu.com/s/1XiW4wZZsuTtkNTgW6ysUqg 提取码: v5yh

void XopRtspServer::writeVideoPackage(unsigned char * buffer, int size, int64_t pts)
{
videoFrame.type = 0;
videoFrame.size = size;
videoFrame.timestamp = xop::H264Source::GetTimestamp();
videoFrame.buffer.reset(new uint8_t[size]);
memcpy(videoFrame.buffer.get(), buffer, size);
server->PushFrame(session_id, xop::channel_0, videoFrame);
}

PHZ76 commented

有使用 H265Source 吗

lqian commented

有使用 H265Source 吗
根据编码不同设置了不同的source。代码片段如下:
session = xop::MediaSession::CreateNew(channel);
if (encodingType == E_MI_VENC_MODTYPE_H264E)
{
session->AddSource(xop::channel_0, xop::H264Source::CreateNew());
}
else if (encodingType == E_MI_VENC_MODTYPE_H265E)
{
session->AddSource(xop::channel_0, xop::H265Source::CreateNew());
}
else
{
code = ERR_XOP_UNSUPPORT_MEDIA;
return;
}

我也遇到了这个问题,有解决掉吗

把nalu帧的分隔符去掉好了

解决了吗 咋解啊