[Live-devel] Making ProxyServerMediaSubsession stream to multicast addresses
Jan Ekholm
jan.ekholm at d-pointer.com
Tue May 20 00:01:09 PDT 2014
On 19 maj 2014, at 23:50, Ross Finlayson <finlayson at live555.com> wrote:
>> Here I only try to get the original stream to work through the replicator. Based on the testReplicator example
>> all streams must be through a replicator, it's not possible to have one stream use the replicator and one
>> stream use the normal way.
>
> That's correct. Only one object can be reading from a "FramedSource". (Otherwise, you'll see the "attempting to read more than once at the same time!" error message.) That's the whole reason why I developed the "StreamReplicator" class: To make it possible for data from a "FramedSource" to be delivered to more than one object.
It was a bit unclear that the StreamReplicator must be a central part of the source-filter-sink chain,
instead of just "hooking in" to some part.
However, as soon as I add the StreamReplicator the video starts to stutter. I leave it out, the stream
is fine. I don't actually do anything secondary yet, just trying to get the main stream working through
it. To me it looks like frames get rendered like: 1 2 3 4 5 3 4 5 6 7 5 6 7 8 ... The stutter is not
consistent though and does not happen every time I test, but it's there. The stutter happens with:
m_replicator = StreamReplicator::createNew( envir(), m_subsession->readSource(), False );
H264VideoStreamDiscreteFramer * framer = H264VideoStreamDiscreteFramer::createNew( envir(), m_replicator->createStreamReplica() );
if ( ! m_subsession->sink->startPlaying( *framer, ... ) {
Simply changing that to:
H264VideoStreamDiscreteFramer * framer = H264VideoStreamDiscreteFramer::createNew( envir(), m_subsession->readSource() );
if ( ! m_subsession->sink->startPlaying( *framer, ... ) {
to remove StreamReplicator from the equation and there is no stutter anymore. Switching where the replicator is like this:
H264VideoStreamDiscreteFramer * framer = H264VideoStreamDiscreteFramer::createNew( envir(), m_subsession->readSource() );
m_replicator = StreamReplicator::createNew( envir(), framer, False );
if ( ! m_subsession->sink->startPlaying( *m_replicator->createStreamReplica(), ... ) {
means no video is delivered at all anymore. So the replicator does something fishy, it's not a 1:1 pass through and
duplicator.
--
Jan Ekholm
jan.ekholm at d-pointer.com
More information about the live-devel
mailing list