[Libav-user] Drawtext filter X and Y position configured by metadata
Jonathan Woolcock
Jonathan.Woolcock at sea.co.uk
Tue Nov 10 17:52:45 CET 2015
Hi,
I am having problems creating a drawtext filter graph using avfilter_graph_create_filter.
I want to set the x and y position of the text from values stored in metadata.
This approach works for the text, but not for x and y.
The code I am using is a follows:
// Create the text filter
String ^font = Path::Combine(AppDomain::CurrentDomain->BaseDirectory, "DejaVuSansMono-Bold.ttf");
font = font->Replace('\\', '/');
ostringstream oss2;
oss2 << "fontfile='" << marshal_as<string>(font) << "':"
"borderw=1:"
"fontsize=16:"
"text='%{metadata:overlay}':"
"bordercolor=white:"
"x='%{metadata:xpos}':"
"y=(12):";
AVFilterContext *drawText;
error = avfilter_graph_create_filter(&drawText, drawTextFilter, nullptr, oss2.str().c_str(), nullptr, filterGraph);
The error message I get is.
Setting 'width' to value '100'
Setting 'height' to value '100'
Setting 'pix_fmt' to value '3'
Setting 'time_base' to value '1/1000'
w:100 h:100 pixfmt:bgr24 tb:1/1000 fr:0/1 sar:1/1 sws_param:
Setting 'fontfile' to value 'DejaVuSansMono-Bold.ttf'
Setting 'borderw' to value '1'
Setting 'fontsize' to value '16'
Setting 'text' to value '%{metadata:overlay}'
Setting 'bordercolor' to value 'white'
Setting 'x' to value '%{metadata:xpos}'
Setting 'y' to value '%{metadata:ypos}'
query_formats: 3 queried, 2 merged, 0 already done, 0 delayed
Undefined constant or missing '(' in '%{metadata:xpos}'
Failed to configure input pad on (null)
I have tried various other combinations... none of the following work.
* "x=('%{metadata:xpos}'):"
* "x=('%{metadata\\:xpos}'):"
* "x=(%{metadata:xpos}):"
Any assistance would be appreciated.
Thanks in advance
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151110/e3c8d377/attachment.html>
More information about the Libav-user
mailing list