MPEG4 Instance from RTP Payload

I am trying to extract mpeg4 from rtp payload, rtsp media (video) format is MP4V-ES, but I cannot extract mp4 from the payload. when I dump the extract to a raw file and use ffmpeg to convert it to .avi or .mpg it doesn't work. I don't know what I am missing here. the code is written in java. I want to extract each video frame from rtp and save it to file or re-upload.

thank

Question UPDATED ..... Thanks for the input, actually I can extract bytes from 000001b6 and send it to ffmpeg, but it complains about header information and then I built a header with 000001b0 00000000 and 000001B5 00000005 and sent it to ffmpeg, but no luck. can you help me because what I get from RTP is 000001b6 [data] and again 000001b6 [data] I even followed Cipi to just add 000001 but didn't work. I missed something! and also want to know if i need to decode / encode like what i get from RTP is actual mpeg4 data, then i dont know why decrypt it, can i just save it to file and open with QuickTime or VLC and it will show one frame on the right.

+2


source to share


1 answer


The MPEG-4 video RTP payload is described in RTP Payload Format for MPEG-4 Audio / Visual Streams .

See also How to handle raw UDP packets so that they can be decoded with the decoder filter in the original directshow filter for a brief description of the steps to recover an MPEG-4 video stream.



Refresh . You may have to search B0

and B5

descriptor session. To let you know where to look, here is a sample MPEG-4 RTSP / SDP answer:

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

      

+1


source







All Articles