<html><head><meta http-equiv="Content-Type" content="text/html charset=big5"><base href="x-msg://2228/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div lang="ZH-TW" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="">I'm trying to use live555 to stream H.264 video which is encoded by x264 and the video source is webcam.<o:p></o:p></span></div><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; "> </span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; ">I’ve tried <o:p></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt 18pt; font-size: 12pt; font-family: 細明體; text-indent: -18pt; "><span lang="EN-US" style="font-family: Calibri, sans-serif; "><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">          </span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; ">Write my own FramedSource subclass based on DeviceSource<o:p></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt 18pt; font-size: 12pt; font-family: 細明體; text-indent: -18pt; "><span lang="EN-US" style="font-family: Calibri, sans-serif; "><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">          </span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; ">Use my own FramedSource, H264VideoStreamFramer and H264VideoRTPSink to stream by RTP.<o:p></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt 18pt; font-size: 12pt; font-family: 細明體; text-indent: -18pt; "><span lang="EN-US" style="font-family: Calibri, sans-serif; "><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">          </span></span></span><span lang="EN-US" style="font-family: Calibri, sans-serif; ">Use my own FramedSource, H264VideoStreamFramer, MPEG2TransportStreamFromESSource and BasicUDPSink to MPEG2TS stream by UDP.<o:p></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; ">In the RTP case, it works fine.</span></pre></div></div></blockquote><div><br></div>You should continue to use H.264/RTP streaming whenever possible.  It is more efficient than streaming Transport Stream data (over either RTP or UDP).  Also, streaming over raw UDP (i.e., without RTP framing) is discouraged, because - without RTP - you miss out on several benefits, including support for reordering out-of-order packets, and RTCP statistics.</div><div><br></div><div>Nonetheless...</div><div><br><blockquote type="cite"><div lang="ZH-TW" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; "><o:p></o:p></span></pre><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; ">However, in the UDP case, it got broken image by VLC player often.</span></pre></div></div></blockquote><div><br></div>One thing that I would check is the size of the (Transport Stream) payload that gets delivered to your "BasicUDPSink".  When streaming Transport Stream data, this *must* be a multiple of the 188-byte Transport 'packet size'.  I suggest setting the (otherwise optional) "maxPayloadSize" parameter to "BasicUDPSInk::createNew()" to 1316 (== 7*188).</div><div><br></div><div><br></div><div><blockquote type="cite"><div lang="ZH-TW" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><pre style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 細明體; "><span lang="EN-US" style="font-family: Calibri, sans-serif; ">Therefore, I changed my video frame source from H264VideoStreamFramer to H264VideoStreamDiscreteFramer</span></pre></div></div></blockquote><div><br></div>Note that if your input device delivers discrete H.264 NAL units - i.e., one at a time, then you *must* use a "H264VideoStreamDiscreteFramer".  If your input device delivers a byte stream (containing H.264 NAL units that are separated by 0x00 0x00 0x00 0x01), then you *must* use a "H264VideoStreamFramer" (not a "H264VideoStreamDiscreteFramer").</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>