Re: Recording to Multiple MPEG2 files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Jon E" <JonE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AB41FB24-446F-494A-B89F-D2BE0E4682A8@xxxxxxxxxxxxxxxx
I need to record in MPEG format continuously (as in for weeks or months).
To
be usable, I need to split the recording into smaller blocks (lets say 1/2
hour for the sake of argument). In addition I need to use a hardware MPEG2
encoder.

....
So the only solution is to take the MPEG stream and do my own file writer.
Looking at the MPEG2 samples, they are always 16K big, and at semi-random
the
samples are marked IsSyncPoint(). There are big gaps between some of them
so
I assume at that point we have the start of an 'I' frame - a logical
splittin
point ?

So, am I right in thinking I can start writing to another file at this
point
? If so, what on earth do I do about an initial header so that the file
will
be playable ?


There are three ways of writing out an MPEG file, elementary streams,
transport streams and program streams. The first of these simply the raw
data (one format - e.g. video only). The second is optimised for low
reliability transports (broadcast) and the third for reliable transports
(file). Transport and Program streams contains Elementary streams. This of
course, is probably oversimplified sufficiently to be nearly wrong, but it's
a good start.

In all cases you want to be sure that a file starts AND ends with an IFrame
(because most MPEG configurations will include some backward prediction so
you need a following frame).

The elementary stream is easiest to write out as it is contains exactly what
emerges from the encoder. To split wait till there is an IFrame and write
it to file A, then Write teh same Frame to FileB and continue.

To write Program and Transport streams is more complicated and you will need
to mux the ESes in a stream. They have the advantage that you can have
audio AND video.

You will find the PS and TS standards knocking around the web (can't recall
the numbers offhand) or you can pay for them from one of the standards
bodies. You may find source code for muxers on the oddly named doom9.org or
sourceforge and so on.

Geraint's MPEG parser maybe a useful resource too - (knowing how to unpack
helps to understand how to pack!) www.gdcl.co.uk

Iain


.



Relevant Pages

  • strxnet 0.9.2.8 Released - XTI Library for Linux Fast-STREAMS
    ... of the X/Open Transport Interface or SVID Transport Layer Interface ... The STREAMS module timod is pushed on any Stream ... Corrections for and testing of 64-bit clean compile and test runs on ...
    (comp.os.linux.announce)
  • streams ora-23621 - transport tablespace
    ... I tried to transport a tablespace from one db to another using Streams ... Prev by Date: ...
    (comp.databases.oracle.server)
  • Re: I/O streaming with custom data transport
    ... by decoupling formatting from data buffering and transport to the physical device, which are in turn strategies for the stream object. ... String using some common class-wide functionality of streams and then ...
    (comp.lang.ada)
  • Re: converting .ts and ts mpeg files
    ... Elementary MPEG streams - an audio stream or a video ... Packetized elementary streams - the same as above, ... extension '.pes' or '.mpe'... ... Program streams - much the same as above, ...
    (uk.tech.digital-tv)
  • Re: IWMWriter, 2 audio streams
    ... simultaneously to an attached network sink ??? ... The writer muxes whatever elementary streams you give it ...
    (microsoft.public.windowsmedia.sdk)