[Live-devel] saving incoming RTP A/V stream as MPEG-2 transport stream

Markus Schumann markuss at sonicfoundry.com
Thu Apr 18 12:33:38 PDT 2013


Ross,

> Grumble.  What's happening here is not infinite recursion, but 'lots of' recursion - caused by the fact that some of your input frames (H.264, presumably) are so ridiculously large.

The frames are indent bigger - the camera is HD with a decent bitrate.
I changed the stack size to 8 MB byte and your software finishes without stack overflow.
You are working recursively though a larger buffer slicing a TS packet off one at a time resulting into 4k+ size call stack.

> DO NOT encode your H.264 NAL units to be more than a few 10s of kBytes in size.
Although this is good advice - I am not the one who is encoding - it's the hardware in the camera.


Now I am getting a transport stream file but I can't play in WMP or open it in Sony Vegas.
The TS file looks clean in my TS analyzer.

Thanks
Markus.


From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Thursday, April 18, 2013 1:52 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] saving incoming RTP A/V stream as MPEG-2 transport stream

I tried it and I still get a stack overflow.

Grumble.  What's happening here is not infinite recursion, but 'lots of' recursion - caused by the fact that some of your input frames (H.264, presumably) are so ridiculously large.

Once again: A reminder to everyone who is encoding and streaming H.264 video: DO NOT encode your H.264 NAL units to be more than a few 10s of kBytes in size.

But you can overcome this 'lots of' recursion stack overflow by changing line 83 of "MPEG2TransportStreamMultiplexor.cpp" from
            afterGetting(this);
to
            envir().taskScheduler().scheduleDelayedTask(0, (TaskFunc*)FramedSource::afterGetting, this);

Unfortunately, this will make the code (slightly) less efficient - but I'll make this change in the next release of the software.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130418/0972fc8d/attachment.html>


More information about the live-devel mailing list