<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1052316520;
mso-list-type:hybrid;
mso-list-template-ids:-1751493250 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I am using the live555 library in a Linux application that receives a low frame rate MPEG2-TS from a live source one frame at a time. The source is not represented as a file by the OS. To make the interface to the live555 library easier, I opened a pipe and write each frame to it as I receive them. The read end of the pipe is given as the source to a ByteStreamFileSource instance which then feeds an instance of MPEG2TransportStreamFramer, which in turn feeds a BasicUDPSink (unfortunately my requirements do not allow me to use RTP/RTCP, which I would have preferred). This seems to work fairly well with the following exceptions.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]>BasicUDPSink has a default packet size of 1450. MPEG2TransportStreamFramer asks its source (ByteStreamFileSource in this case) for 1450 bytes and then, in afterGettingFrame1, correctly limits the actual packet size to 1316 (7 188-byte TS packets). However, it seems to discard the remaining 134 bytes (or less if less than 1450 bytes were read), which causes sync problems on almost every packet after that and wreaks havoc on the receiving end of the stream. If I change the default packet size in BasicUDPSink to 1316, these problems go away. This discarding of data seems like a bug to me, but I may just be using it incorrectly.<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]>Since data is given to me and thus written to the pipe frame-by-frame, it is very common that a single write to the pipe will not be a multiple of 7 188-byte TS packets (e.g. a frame might be 25192 bytes = 134 188-byte TS packets = 19 UDP packets containing 7 TS packets each + 1 UDP packet containing 1 TS packet). While the MPEG2-TS source continues to produce frames this does not cause any problems. However, when the source is paused/stopped it can cause the event loop to hang indefinitely. This is due to the fact that ByteStreamFileSource::doReadFromFile is trying to read more data than it can receive and thus blocks in the “fFrameSize = fread(fTo, 1, fMaxSize, fFid);” line. A fix that worked for me was to replace that line with “fFrameSize = read(fileno(fFid), fTo, fMaxSize);”. Since I am only working in Linux, this fix may not be cross-platform without some massaging. Again, I consider this a bug because it doesn’t behave the way I think it should, but you may never have intended ByteStreamFileSource to be used with a pipe as a source.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for the great work on this library.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Tyson Wiser<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>