<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=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (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:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@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:554439516;
        mso-list-type:hybrid;
        mso-list-template-ids:-1028633904 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;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">ORIGINAL POST --><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">The following pipeline works ok and produces an avi movie file. My development machine is windows 7 and I’m using GStreamer 1.8.2 with your windows pre-built binaries.
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
gst-launch-1.0.exe -e <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
avimux name=mux ! filesink location=C:/myfile.avi <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
sync=true <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
rtpbin latency=6000 name=rtpbin_A <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
udpsrc address="192.168.1.101" port=5018 timeout=0 <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
caps="application/x-rtp,media=video,payload=97,clock-rate=90000,encoding-name=VP8" !
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
rtpbin_A.recv_rtp_sink_0 <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
rtpbin_A. ! rtpvp8depay ! avdec_vp8 output-corrupt=true ! videoconvert ! videorate ! videoscale !
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
capsfilter caps="video/x-raw,height=288,width=352,framerate=30/1" ! <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
avenc_mpeg4 ! queue ! mux. <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
udpsrc address="192.168.1.101" port=5020 timeout=0 <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
caps="application/x-rtp,media=audio,clock-rate=48000,encoding-name=OPUS,payload=96" !
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
rtpbin_A.recv_rtp_sink_1 <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
rtpbin_A. ! rtpopusdepay ! opusdec ! audioconvert ! audiorate ! <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
capsfilter caps="audio/x-raw,format=S16LE,rate=8000,channels=1" ! <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
mulawenc ! queue ! mux.<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%">
<o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">I can use the standard Windows media player to play the resultant avi file. However, there are two problems:<o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%;mso-list:l0 level1 lfo1">
The avi file length is about 5 seconds longer that it should be.<o:p></o:p></li><li class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;line-height:106%;mso-list:l0 level1 lfo1">
When I play the movie, there is about a 5 second delay in the beginning before it starts to play. The first video frame appears frozen during this initial delay.
<o:p></o:p></li></ol>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Once the movie starts to play it is all ok. All the audio and video data is there and the audio and video are in sync.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Can anyone tell me what is causing this extra data in the avi file and the initial play delay, and what changes should be made to the above pipeline to eliminate it? Also, does anyone know of
 an open source avi file chunk viewer? I would like to see what data is actually in the avi file.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Thanks so much for your help,
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Bill <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">UPDATE -><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">I thought maybe the standard Windows media player was responsible for the initial play delay so I tried the following gstreamer playback pipeline:<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">gst-launch-1.0 -e
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">filesrc location=C:/myfile.avi !
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">avidemux name=demux demux. ! queue ! avdec_mpeg4 ! videoconvert ! d3dvideosink
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">demux. ! queue ! mulawdec ! audioconvert ! directsoundsink<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">I get the same playback response as with the Windows media player with the same two issues mentioned above in my initial post! So this play delay appears to be a gstreamer issue.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">I did google searches for avi file reader/viewer/chunk viewer and finally found a useful open source tool at
<a href="http://ffmpeg.org/">http://ffmpeg.org/</a>. They have a win32 command line tool named
<i>ffprobe</i> that reads an avi file and displays a lot of info about what it contains. I looked at my test recording that has the initial play delay. It was decoded without problems. The stream info is correct. The audio and video frames also looked fine.
 The file had 15 frames between key frames for video. I didn’t see anything that looked suspicious or broken. The first key frame came early in the recording – within the first half second.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Help to resolve this would be greatly appreciated!
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Bill <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">UPDATE2 -><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Eventually I realized that the
<i>ffprobe</i> video data shows actual frames being placed into the file from the beginning with timestamps that are increasing correctly. Then I further realized that the videorate element was inserting the same frame over and over again from the beginning
 of the file because the receiver pipeline shown in my original post was started first and the sender side was started after some delay. Finally I did several tests with differing start delays for the sender and for all cases the initial playback delay matched
 the sender start delay! If I start the sender first and then the receiver, there is no problem - only a small playback start delay which can be ignored for my application. Audio and video are in sync and the movie plays out just fine. In my application I may
 not always be able to control which side starts first. <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">So I looked at the videorate element again and discovered it has the skip-to-first property [same for audiorate]. I set skip-to-first=true for both the videorate and audiorate elements in the
 receiver pipeline shown above. I also removed the audioconvert element of the audio leg since it wasn’t really needed. Now there is no more playback delay for video regardless of the sender start delay. However, now the problem is the audio ALWAYS lags the
 video by approximately 5 seconds!! Audio lags video now even when I start the sender side first.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Any suggestions on how to get audio and video back in sync again here? It looks like I need to somehow insert a 5 second delay for the video leg.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Thanks,<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Bill <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</body>
</html>