<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle21
        {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:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:914634096;
        mso-list-type:hybrid;
        mso-list-template-ids:-1460632002 134807553 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am having problems creating a drawtext filter graph using avfilter_graph_create_filter.<o:p></o:p></p>
<p class="MsoNormal">I want to set the x and y position of the text from values stored in metadata.
<o:p></o:p></p>
<p class="MsoNormal">This approach works for the text, but not for x and y.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The code I am using is a follows:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#888888;mso-fareast-language:EN-GB">        // Create the text filter</span><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">        String ^font = Path::Combine(AppDomain::CurrentDomain->BaseDirectory,
<span style="background:#FFF0F0">"DejaVuSansMono-Bold.ttf"</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">        font = font->Replace(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0044DD;mso-fareast-language:EN-GB">'\\'</span><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0044DD;mso-fareast-language:EN-GB">'/'</span><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">        ostringstream oss2;   
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">        oss2 <<
<span style="background:#FFF0F0">"fontfile='"</span> << marshal_as<string>(font) <<
<span style="background:#FFF0F0">"':"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"borderw=1:"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"fontsize=16:"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"text='%{metadata:overlay}':"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"bordercolor=white:"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"x='%{metadata:xpos}':"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<span style="background:#FFF0F0">"y=(12):"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">              
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">        AVFilterContext *drawText;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt;line-height:12.2pt"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB">  error = avfilter_graph_create_filter(&drawText, drawTextFilter, nullptr, oss2.str().c_str(),
 nullptr, filterGraph);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#333333;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal">The error message I get is.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Setting 'width' to value '100'<o:p></o:p></p>
<p class="MsoNormal">Setting 'height' to value '100'<o:p></o:p></p>
<p class="MsoNormal">Setting 'pix_fmt' to value '3'<o:p></o:p></p>
<p class="MsoNormal">Setting 'time_base' to value '1/1000'<o:p></o:p></p>
<p class="MsoNormal">w:100 h:100 pixfmt:bgr24 tb:1/1000 fr:0/1 sar:1/1 sws_param:<o:p></o:p></p>
<p class="MsoNormal">Setting 'fontfile' to value 'DejaVuSansMono-Bold.ttf'<o:p></o:p></p>
<p class="MsoNormal">Setting 'borderw' to value '1'<o:p></o:p></p>
<p class="MsoNormal">Setting 'fontsize' to value '16'<o:p></o:p></p>
<p class="MsoNormal">Setting 'text' to value '%{metadata:overlay}'<o:p></o:p></p>
<p class="MsoNormal">Setting 'bordercolor' to value 'white'<o:p></o:p></p>
<p class="MsoNormal">Setting 'x' to value '%{metadata:xpos}'<o:p></o:p></p>
<p class="MsoNormal">Setting 'y' to value '%{metadata:ypos}'<o:p></o:p></p>
<p class="MsoNormal">query_formats: 3 queried, 2 merged, 0 already done, 0 delayed<o:p></o:p></p>
<p class="MsoNormal"><b>Undefined constant or missing '(' in '%{metadata:xpos}'<o:p></o:p></b></p>
<p class="MsoNormal"><b>Failed to configure input pad on (null)<o:p></o:p></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have tried various other combinations… none of the following work.<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]>"x=('%{metadata:xpos}'):"<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]>"x=('%{metadata\\:xpos}'):"<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]> "x=(%{metadata:xpos}):"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any assistance would be appreciated.<o:p></o:p></p>
<p class="MsoNormal">Thanks in advance<o:p></o:p></p>
<p class="MsoNormal">Jonathan<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br clear="both">
Disclaimer: <BR>
<BR>
This email has been scanned for all known viruses by the MessageLabs Email Security System.<BR>
<BR>
The contents of this email (including any attachments) are intended for the use of the mail addressee(s) shown, hence is private and in addition may include commercially sensitive information. If you are not the intended recipient of this email any disclosure, copying, distribution or use of its contents is strictly prohibited. You should notify the sender immediately and then delete it (including any attachments) from your system.<BR>
<BR>
The information contained in or attached to this message may also be subject to the export control laws and regulations of the United Kingdom and the United States. This specifically includes, but is not limited to, the Arms Export Control Act (22 U.S.C. 2751-2794) and the International Traffic in Arms Regulation (22 C.F.R 120-130) as well as the Export Administration Act (50 U.S.C. App. 2401-2420), the Export Administration Regulation (15 C.F.R. 730-774) and the UK Export Control Act 2002.<BR>
<BR>
Please help out the environment by only printing this e-mail if absolutely necessary - Thank you. <BR>
<BR>
SEA is the brand name of Systems Engineering & Assessment Ltd (registered office: Beckington Castle, 17 Castle Corner, Beckington, Frome, Somerset, BA11 6TA, UK - company number 02302168) and its wholly owned subsidiary J+S Limited (registered office: Riverside Road, Pottington Business Park, Barnstaple, Devon, EX31 1LY &#x02013; company number 03753462)<BR>
</body>
</html>