从 RTP 有效负载中提取 MPEG4
我正在尝试从 rtp 有效负载中提取 mpeg4,rtsp 媒体(视频)的格式是 MP4V-ES 但我无法从有效负载中提取 mp4。 当我将提取物转储到原始文件并使用 ffmpeg 将其转换为 .avi 或 .mpg 时,它不起作用。我不知道我在这里缺少什么。 代码是用java编写的。 我想从 rtp 中提取每个视频帧并将其保存在文件中或重新传输。
谢谢
问题已更新...... 感谢您的输入,实际上我能够从 000001b6 中提取字节并将其发送到 ffmpeg ,但它抱怨没有标头信息,然后我用 000001b0 00000000 和 000001B5 00000005 构造了一个标头并将其发送到 ffmpeg 但没有运气。你能在这里帮助我吗,因为我从 RTP 得到的是 000001b6 [数据] 和 000001b6 [数据] 我什至按照“Cipi”添加 000001 但不起作用。我在这里错过了什么吗?并且还想知道我是否需要解码/编码,因为我从 RTP 获得的是实际的 mpeg4 数据,然后我不知道为什么要解码它,我可以将其保存为文件并使用 Quicktime 或 VLC 打开吗它应该显示正确的一帧。
I'm trying to extract mpeg4 from an rtp payload , format of the rtsp media (video) is MP4V-ES but I'm not able to extract the mp4 from the payload .
when I dump the extract into a raw file and use ffmpeg to convert it into .avi or .mpg its not working. I don't know what I'm missing here.
the code is written in java.
I want to extract each video frame from the rtp and save that in a file or retransmit it.
Thanks
Question UPDATED.....
Thanks for the inputs, actually I'm able to extract bytes from 000001b6 and sent it to ffmpeg , but it complains about not header information and then I constructed a header with 000001b0 00000000 and 000001B5 00000005 and sent that to the ffmpeg but no luck. can you help me here, because what I'm getting from RTP is 000001b6 [data] and again 000001b6 [data] I even followed 'Cipi' to just add 000001 but not working. am I missing something here ! and also want to know whether I need to decode/encode as what I get from the RTP is the actual mpeg4 data right then I don't know why to decode it , can I just save it a file and open with quicktime or VLC and it shoud show one frame right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MPEG-4 视频 RTP 负载在 MPEG-4 音频/视频流的 RTP 负载格式。
另请参阅如何处理原始 UDP 数据包,以便可以通过 directshow 源过滤器中的解码器过滤器对其进行解码,并简要说明重建 MPEG-4 视频流所需的步骤。
更新:您可能需要在会话描述符中查找
B0
和B5
。为了让您知道在哪里查找,以下是 MPEG-4 RTSP/SDP 响应的示例:MPEG-4 Video RTP payload is described in RTP Payload Format for MPEG-4 Audio/Visual Streams.
See also How to process raw UDP packets so that they can be decoded by a decoder filter in a directshow source filter with a brief description of steps you need to reconstruct the MPEG-4 video stream.
Update: You might need to look for
B0
andB5
in your session descriptor. So that you know where to look for, here is an example of MPEG-4 RTSP/SDP response: