<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 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 Light";
        panose-1:2 15 3 2 2 2 4 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:777872186;
        mso-list-type:hybrid;
        mso-list-template-ids:91227788 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%">I have the following recording pipeline [in C code] which runs ok on my windows 7 x86system. The recording captures audio and video from my computer’s mic and camera and creates a movie file.
 The appsrc is running in push mode and the video buffer timestamps are correct. Each video buffer timestamp matches the moment this data has been captured according to the pipeline clock, minus the configured base time. The directsoundsrc element is providing
 the clock for the pipeline. <o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> appsrc is-live=TRUE ! videoconvert ! vp8enc ! queue !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> mux. directsoundsrc device-name="Microphone Array" !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> audioconvert ! audio/x-raw,format=S16LE,rate=8000,channels=1 !<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;text-indent:.5in;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif">opusenc ! queue ! mux. oggmux name=mux !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> filesink location=C:/movie.ogg
<o:p></o:p></span></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 use the following pipeline with the launch tool for playback and all is well. Audio and video are in sync.
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> filesrc location=C:/movie.ogg do-timestamp=TRUE !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> oggdemux name=demux demux. ! queue ! vp8dec ! videoconvert !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> d3dvideosink demux. ! queue ! opusdec ! audioconvert ! directsoundsink
<o:p></o:p></span></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%">The problem occurred when I changed the recording pipeline [in C code] to use different video encoding, no audio encoding [for smallest audio latency], and a different muxer. Notice I kept the
 audio format caps filter the same. Recording runs ok but playback has the audio lagging the video by a small amount [a few seconds] that appears to be constant. Playback using the standard windows media player has the same result.
<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> appsrc is-live=TRUE ! videoconvert ! openh264enc ! h264parse ! queue !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> mux. directsoundsrc device-name="Microphone Array" !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> audio/x-raw,format=S16LE,rate=8000,channels=1 !<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="margin-bottom:8.0pt;mso-add-space:auto;text-indent:.5in;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif">audioconvert ! mux. avimux name=mux !
<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif"> filesink location=C:/movie.avi
<o:p></o:p></span></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%">Here is the playback pipeline [using the launch tool] for the second recording:<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif">filesrc location=C:/movie.avi !
</span>avidemux name=demux demux. !<o:p></o:p></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
video/x-h264,stream-format=byte-stream,alignment=au ! h264parse !<span style="font-family:"Calibri Light",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif">queue ! </span>openh264dec <span style="font-family:"Calibri Light",sans-serif">
! videoconvert ! d3dvideosink demux. !<o:p></o:p></span></p>
<p class="MsoNormalCxSpMiddle" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:.5in;mso-add-space:auto;line-height:106%">
<span style="font-family:"Calibri Light",sans-serif">queue ! audioconvert ! directsoundsink
<o:p></o:p></span></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%">Here are my two questions for the second record pipeline where audio lags video:
<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">
What is causing the audio to lag the video? <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">
What would be the best way to add a fixed latency to the video leg in the recording pipeline so that audio and video are in sync for playback? My customer application requires the standard windows media player for playback so I can’t tweak the playback properties.
<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%">I’m using GStreamer 1.6.4 with your windows pre-built binaries.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:106%">Thank you,<o:p></o:p></p>
<p class="MsoNormal">Bill Salibrici<o:p></o:p></p>
<p class="MsoNormal">Lattice Incorporated<o:p></o:p></p>
<p class="MsoNormal"><a href="http://www.latticeinc.com/"><span style="color:#0563C1">http://www.latticeinc.com/</span></a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>