从RTP有效负载中提取MPEG4 [英] MPEG4 extract from RTP payload

查看:406
本文介绍了从RTP有效负载中提取MPEG4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从rtp有效负载中提取mpeg4,rtsp媒体(视频)的格式为MP4V-ES,但是我无法从有效负载中提取mp4. 当我将提取的文件转储到原始文件中并使用ffmpeg将其转换为.avi或.mpg时,其将无法正常工作.我不知道我在这里想念的是什么. 该代码是用Java编写的. 我想从rtp中提取每个视频帧,并将其保存在文件中或重新传输.

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.

谢谢

问题已更新..... 感谢您的输入,实际上我能够从000001b6中提取字节并将其发送到ffmpeg,但是它抱怨的不是标头信息,然后我用000001b0 00000000和000001B5 00000005构造了标头,并将其发送给ffmpeg但没有运气.您能在这里帮我吗,因为我从RTP得到的是000001b6 [数据],再是000001b6 [数据],我什至还按照'Cipi'来添加000001,但是没有用.我在这里想念东西吗?并且还想知道我是否需要解码/编码,因为从RTP获得的是正确的mpeg4数据,所以我不知道为什么要解码它,我可以将其保存为文件并用quicktime或VLC打开,应该向右显示一帧.

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.

推荐答案

另请参见

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.

更新:您可能需要在会话描述符中查找B0B5.为了让您知道要查找的位置,下面是MPEG-4 RTSP/SDP响应的示例:

Update: You might need to look for B0 and B5 in your session descriptor. So that you know where to look for, here is an example of MPEG-4 RTSP/SDP response:

RTSP/1.0 200 OK
CSeq: 2
Content-Base: rtsp://192.168.0.57/webcam/
Content-Type: application/sdp
Content-Length: 320

v=0
o=- 1 1 IN IP4 127.0.0.1
s=Test
a=type:broadcast
t=0 0
c=IN IP4 0.0.0.0
m=video 0 RTP/AVP 96
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1;config=000001B003000001B509000001000000012000C488BA9850584121463F
a=control:track0
m=audio 0 RTP/AVP 97
a=rtpmap:97 AMR/8000/1
a=fmtp:97
a=control:track1

这篇关于从RTP有效负载中提取MPEG4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆