[Live-devel] Problem using MPEG1or2VideoStreamDiscreteFramer

Ross Finlayson finlayson at live555.com
Sun Sep 9 17:13:24 PDT 2012


Dmitri,

> I implemented my own MPEG-2 device source based on your device source sample
> and the event trigger mechanism. I use MPEG1or2VideoStreamDiscreteFramer as a
> filter because I get the data from my source as individual frames (I-, P- and
> B-pictures). That works quite well.

First, I assume that you are feeding the output from your "MPEG1or2VideoStreamDiscreteFramer" into a "MPEG1or2VideoRTPSink" (which implements the RFC 2250 RTP payload format for MPEG-1 or 2 video).  I don't know why Wireshark claims to be reporting bad RTP packets; perhaps Wireshark is in error?  FYI, the (4-byte) video special header at the front of the RTP packet is set on line 144 of "MPEG1or2VideoRTPSink.cpp".


> But I have problems with the understanding when and how to inject Sequence
> headers. My source provides I-frames which have a sequence header in front of
> each of them.

This is good.


> If I remove the sequence headers – the I-picture starts now with a picture
> start marker – then everything seems to be ok – except for the very first
> I-frame which starts the streaming. It must still contain the sequence header.
> Otherwise the stream cannot be replayed. With that the very first I-frame
> gets the picture type 0 (forbidden) as mentioned above.

This suggests to me that Wireshark is in error (assuming, of course, that you are feeding your "MPEG1or2VideoStreamDiscreteFramer" into a "MPEG1or2VideoRTPSink", and not something else (like a "SimpleRTPSink")).


> Additionally the MPEG1or2VideoStreamDiscreteFramer has the parameter vshPeriod.
> I used the default of 5 and stripped all Sequence headers off from the
> I-pictures except the very first one to provide that information to the framer
> at all. But when inspecting the stream I could see the sequence header just
> ones (with the very first I-frame). Shouldn’t it be injected regularly
> with the vshPeriod of the discrete framer.

Yes, it should.  The "vshPeriod" parameter specifies the *maximum* time period until a (the most recently seen) Video Sequence Header will be reinserted in the output stream.  However, if your I-frames all begin with Video Sequence Headers, then this should be irrelevant (assuming that your I-frames occur more frequently than once every 5 seconds).

One other thing that you should check: Make sure that you are setting "fPresentationTime" properly in your input source class (i.e., your class that's based upon the "DeviceSource" code).


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/20120909/0a524f00/attachment.html>


More information about the live-devel mailing list