[Live-devel] mpeg2transportstreamfromessource

Jeff Shanab jshanab at smartwire.com
Wed Dec 14 11:06:48 PST 2011



From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Wednesday, December 14, 2011 12:35 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] mpeg2transportstreamfromessource

OK. I may be set for version 4 :(

>>Sorry. It was in response to the possibility of setting the mpegVersion to 5.

WTF is that supposed to mean?  If you want people to help you, you're going to have to learn to write coherently.


My current arch has "subscribers" some subscribers restream, some write to disk, this one is gonna HTTP live stream and the next will be RTMP. I would rather only do the descriteFraming once.

Ditto.


But if I do pas the data in full frames, will it still work?

Yes, probably, provided that the receivers can decode this OK.  (A Transport Stream is just that - a container for 'transporting' data, in any form.)

However, you will need to prepend each H.264 frame with 0x00 0x00 0x00 0x01 (if those 4 bytes are not already there).

>> all NALs have the frame headers (avcodec would not decode them without it)


I may have no choice, I do need to know when each GOP starts. I was hoping that the beginning of payload plus the first 4 bytes of payload could give me that.
Looking at the bytes I do see 00 00 01 EO in a good exported .ts stream and I do not see that in the bad one. Almost like the H264 stream is inside a MPEG4 stream???

Perhaps you're not looking at a proper H.264-in-Transport-Stream file?  If you want to see a good one, look at
            http://www.live555.com/liveMedia/public/h264-in-mp2t/
(BTW, the file there ("bipbop-gear1-all.ts"), along with its index file, can also be used to test HTTP LIve Streaming.)

>> that is exactly the "good" file I was comparing and it is obvious now that it has PES headers and mine does not.


How about this

ESSource->MPEG2TransportStreamMultiplexor->MPEG2TransportStreamFromPESsource->mySink

Instead of

ESSource->MPEG2TransportStreamFromESsource->mySink

Is that what is needed?

No!  Note that "MPEG2TransportStreamFromPESSource" is a subclass of "MPEG2TransportStreamMultiplexor".

I've already told you what you need to do: Feed your encoded H.264 data directly to a "MPEG2TransportStreamFromESSource", by calling "MPEG2TransportStreamFromESSource::addNewVideoSource()", with "mpegVersion" == 5.

(Also, make sure that your H.264 data source generates proper presentation times for each generated frame - by setting "fPresentationTime" properly.)

But, as I noted above, you may need to prepend each H.264 frame with 0x00 0x00 0x00 0x01 before feeding it to the "MPEG2TransportStreamFromESSource"

(Sigh...  You're much too 'high maintenance' for my taste :-)

>>Ross. I did all that was instructed before the first email to the list. I thought I explained the problem clearly that the .ts resulting file was not playable. I continued to work on it, guessing at options finally discovering that the PES headers are not in there.  Sorry if I was not clear in that first email. Just getting nervous as my deadline approaches. :)

Thanks for confirming my initial code was the correct architecture. I will debug and check the fPresentationTime variable.

Is there anything that can cause MPEG2TransportStreamFromESSource to disable the PES headers?


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

________________________________
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2012.0.1890 / Virus Database: 2108/4680 - Release Date: 12/14/11
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111214/b60309fe/attachment.html>


More information about the live-devel mailing list