<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Handwriting";
        panose-1:3 1 1 1 1 1 1 1 1 1;}
/* 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;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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>Some of you may have seen a cry for help out about a month ago about transcoding and rebroadcasting some Panasonic cameras (If you read FFMpeg devel).  I believe I have isolated the issue down to a specific point that will hopefully allow someone to provide me with the knowledge to write a hack around for my personal use and/or to implement a long term solution that can be written back into the main branch of VLC.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is where I believe the issue lays and I’ll provide supporting documentation at the end.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I view the camera directly in VLC the picture quality is good and I receive very minor disruptions during viewing.  However when I request that the audio be transcoded and then be remuxed to an MPEG-TS that’s when issues start to arise.  Because H.264 and RTP do not carry a DTS and only a time stamp the DTS values for the TS packets must be calculated (guessed?).  I believe occasionally a packet is created with a DTS that is very far into the future (between 80,000 and 400,000 more than the previous packet).  That packet is then appended onto the output chain and processed by the UDP transmission tool.  When the UDP tool realizes that it just got a packet that has a new DTS with a value less than the OLD DTS (the packet right after the future packet) it dumps the output chain and starts over.  This is the cause of my video freezes that can be up to 4 seconds in duration.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I believe the way to hack around this issue (in my case) is to place a check right before a new TS packet is placed on the chain to be sent out.  It would look something like this<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>//psudo code<o:p></o:p></p><p class=MsoNormal>If (new_packet->i_dts > previous_packet->i_dts + 80000) // packet is too far into the future<o:p></o:p></p><p class=MsoNormal>   Return;<o:p></o:p></p><p class=MsoNormal>// else continue with processing to add this packet to the chain<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I believe that I can afford to drop a couple of packets verse having my restreamed image freeze up for a couple of seconds. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If someone could provide some information where I can look to add this in or if you would like access VIA SSH to a machine that is configured to build VLC and has this camera on the network for testing and/or confirmation of the problem please let me know.  I would be happy to provide this information.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Pastebin has </span> a full output log from one restream attempt . (cam5.log)<span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>http://pastebin.com/QqcPVfPB<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Additionally here is a link to Panasonics documentation about how they write their H264 and RTP information to the packets. Pages 250-270 seem to fully document the formats.<o:p></o:p></p><p class=MsoNormal><a href="http://www.getupload.org/en/file/20640/CGI-Common-Ref-Panasonic-Network-camera-ver1-21-pdf.html" target="_blank">http://www.getupload.org/en/file/20640/CGI-Common-Ref-Panasonic-Network-camera-ver1-21-pdf.html</a><o:p></o:p></p><p class=MsoNormal>You have to wait about45 seconds for the ads and then the file will download, sorry it was a free service I found.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is my complete CLI: <o:p></o:p></p><p class=MsoNormal>./cvlc -vvv rtsp://10.0.2.5/MediaInput/h264 --sout='#transcode{acodec=mpga,ab128,channels=1,samplerate=44100}:udp{mux=ts,dst=239.0.0.5:1234}' :ttl=4 :sout-keep --rtsp-tcp --rtp-caching=1200 --rtsp-caching=1800 --sout-udp-caching=900 --rtp-max-misorder=25 --sout-ts-shaping=4000 >cam5.log 2>&1<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Many thanks to a bunch of the people who have been helping me to date in #VideoLan.  Other than that I love VLC, I truly applaud all of the great work and effort that has gone into this product to make it what it is today.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for reading<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Lucida Handwriting"'>Tim Ouellette<o:p></o:p></span></p><p class=MsoNormal>Sr. Systems Engineer<o:p></o:p></p><p class=MsoNormal>Video Dynamics Inc.<o:p></o:p></p><p class=MsoNormal>703.709.8400<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>