H264 流高度不正确 [8 像素高]
我使用 RTSP 协议从网络摄像机获取 h264 流。我根据答案[http://stackoverflow.com/questions/6394874/fetching-the-dimensions-of-a-h264video-stream]解析h264 seq_parameter_data
,对于某些网络摄像机,高度值比实际高度正好大 8 个像素
。
为什么会发生这种情况?以及如何修复它?
PS: 在我的搜索中,我发现......也许这可能是我的问题。
“MPEG2 和 MPEG4 要求帧大小为 16 像素的倍数 因为宏块是 16x16 像素”每个 MPEG2 视频都已编码 因为 1080 实际上有 1088 行编码,因为 1080 不是均匀的 除以16。行业标准是设置最后8行 框为黑色。然后,显示设备预计会丢弃 最后 8 个像素并且不显示它们” 答案 6
I get h264 stream
from an ip camera using RTSP protocol. I parse h264 seq_parameter_data
based on the answer [http://stackoverflow.com/questions/6394874/fetching-the-dimensions-of-a-h264video-stream], and for some ip cameras, the height value is exactly 8 pixels bigger
than the real height.
Why it may happen? And how to fix it?
PS:
In my search, i found that... Maybe this might be my problem.
"MPEG2 and MPEG4 require frame sizes to be multiples of 16 pixels
because macroblocks are 16x16 pixels" Every MPEG2 video ever encoded
as 1080 actually has 1088 lines encoded because 1080 is not evenly
divided by 16. The industry standard is to set the last 8 lines of the
frame to black. Then, the display device is expected to throw away the
last 8 pixels and not display them"
Answer 6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
框架高度可能由 16 px 块的数量(例如 1088 像素)+
frame_crop_*_offset
值表示,将其调整到正确的高度(例如 1080 像素)。而且你错过了裁剪。The frame height is likely to be indicated by amount of 16 px blocks (e.g. 1088 pixels) +
frame_crop_*_offset
values adjust it to correct height (e.g. 1080 pixels). And you are missing the cropping.