0

I have written an application which triggers an IP Camera to stream it's data (MPEG4) over RTP. This works fine so far - I start to setup and start the stream with the corresponding RTSP commands ( DESCRIBE, SETUP and PLAY ).

While streaming I receive the usual Sender Reports and send my own Receiver Reports - Everything is working fine here.

Now with the application mentioned above, I do NOT read the stream. I have a seperate hardware , which just logs all the stuff going over the Ethernet ( a little bit like Wireshark ). Now when the whole streaming is finished I can download those logs from my hardware and extract data from them.

So what I have then is a logfile with all the data from the RTP stream as raw data.

My question would now is: How do I write this appropriately into a MPEG4 file? I know this is a very broad question and I don't expect to get a step-by-step tutorial. But actually I am a bit overwhelmed and don't know where to start.If I just memcpy all the Payload from the RTP messages sequentially into a MPEG4 file it doesn't work. Now I am also a bit confused by SDP and stuff. Well maybe someone has a link or some help for me..?

Toby
  • 3,815
  • 14
  • 51
  • 67
  • You might be interested in this thread: http://stackoverflow.com/questions/7740265/get-stream-and-save-as-jpeg-image-file-from-ip-camera-using-ffmpeg – nodakai Mar 05 '12 at 13:01

2 Answers2

1

You should first read RFC3016, which describes the RTP format of MPEG-4 stream, then you'll know how to extract MPEG-4 frames from the RTP stream.

ciphor
  • 8,018
  • 11
  • 53
  • 70
0

I actually changed from MPEG4 to H.264 - it actually was a little bit easier to write a video file like this. For H.264 this answer covers it pretty much:

How to process raw UDP packets so that they can be decoded by a decoder filter in a directshow source filter

Community
  • 1
  • 1
Toby
  • 3,815
  • 14
  • 51
  • 67