I am writing a client application which receives live MPEG-4 video
over RTP, decodes the MPEG-4 and displays it.
After receiving and parsing the RTP packets, I need to extract the
payload (MPEG-4 encoded data) and write it to a .MP4 file.
After I parse the RTP packets do I need to do any restructuring with
the buffer I've received over RTP (i.e. creating Frames or some such
thing), before I write it to a .mp4 file? Or is it sufficient if I
just open a file with .mp4 extension and write all the incoming RTP
Payload Data into it?
Thanks in advance.
Regards,
Treadstone.
> After I parse the RTP packets do I need to do any
> restructuring with the buffer I've received over RTP
> (i.e. creating Frames or some such thing), before I write
> it to a .mp4 file? Or is it sufficient if I just open a
> file with .mp4 extension and write all the incoming RTP
> Payload Data into it?
An MP4 file is not an "MPEG-4 file", since there is no such
thing (well, it depends). If you write the raw data you will
get a raw MPEG-4 video elementary stream, which may or not
be understood by some applications (some applications can
read an MPEG-4.10/AVC - aka H.264 - ES and probably also an
MPEG-4.2/(A)SP one, at least as long as all the headers are
there), but an elementary stream is not even close to an MP4
file, which is a structured container that uses the ISO Base
File Format syntax. If you want to create an MP4 file you
need an MP4 muxer, either in a third-party filter, a
third-party library or you can write your own based on the
MPEG-4.12 specs.
http://www.chiariglione.org/mpeg/technologies/mp04-ff/index.htm
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm