drawtext

How to use ffmpeg to add a text to avi video?

折月煮酒 提交于 2019-12-03 14:06:56
问题 I am trying to put a simple text on the bottom of video using ffmpeg on Ubuntu 12.04 . I tried this which is suggested in several places: ffmpeg -i input.avi -vf drawtext="fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text='Text to write':fontsize=20:fontcolor=black:x=100:y=100" output.avi But I get this error each time: ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers built on Jun 12 2012 16:37:58 with gcc 4.6.3 *** THIS PROGRAM IS

Python PIL bytes to Image

ぃ、小莉子 提交于 2019-12-03 06:38:43
问题 import PIL from PIL import Image from PIL import ImageDraw from PIL import ImageFont import urllib.request with urllib.request.urlopen('http://pastebin.ca/raw/2311595') as in_file: hex_data = in_file.read() print(hex_data) img = Image.frombuffer('RGB', (320,240), hex_data) #i have tried fromstring draw = ImageDraw.Draw(img) font = ImageFont.truetype("arial.ttf",14) draw.text((0, 220),"This is a test11",(255,255,0),font=font) draw = ImageDraw.Draw(img) img.save("a_test.jpg") i m trying to

Android canvas drawText y-position of text

こ雲淡風輕ζ 提交于 2019-12-03 04:25:48
I'm using a Canvas to create a Drawable with some background and some text. The drawable is used as a compound drawable inside an EditText. The text is drawn via drawText() on the canvas, but I do have an issue with the y-position of the drawn text in some cases. In those cases parts of some characters are cut off (see image links). Characters without positioning issue: http://i50.tinypic.com/zkpu1l.jpg Characters with positioning issue, text contains 'g', 'j', 'q', etc.: http://i45.tinypic.com/vrqxja.jpg You can find a code snippet to reproduce the issue below. Does any expert know how to

How to use ffmpeg to add a text to avi video?

情到浓时终转凉″ 提交于 2019-12-03 03:59:33
I am trying to put a simple text on the bottom of video using ffmpeg on Ubuntu 12.04 . I tried this which is suggested in several places: ffmpeg -i input.avi -vf drawtext="fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text='Text to write':fontsize=20:fontcolor=black:x=100:y=100" output.avi But I get this error each time: ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers built on Jun 12 2012 16:37:58 with gcc 4.6.3 *** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release.

Android: Text not visible on writing using drawText()

时光怂恿深爱的人放手 提交于 2019-12-02 13:18:33
问题 @Override protected void onDraw(Canvas canvas) { //Note:I do not want to use the canvas object from this function param //If i do so its working , But i would like to understand why the following is not working Canvas c =new Canvas(); Paint paint = new Paint(); paint.setStyle(Paint.Style.FILL); paint.setAntiAlias(true); paint.setColor(Color.WHITE); c.drawText("HELLO CANVAS",200,300,paint); } MORE CODE public class graphicProj extends Activity { private Canvas canvas; @Override public void

Set VerticalAlignment in DrawText

纵饮孤独 提交于 2019-12-01 18:00:21
I'm using DrawText to draw FormattedText on Visual Layer. Now I'm using the code below to define the formatted text and I'm able to set the TextAlignment to Center . But what about the VerticalAlignment ? As you can see in the image below the center of the text is not on the centerpoint which is shown with a red dot here. The part where I'm defining the FormattedText : var ft = new FormattedText("A", CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight, new Typeface("Verdana"), 36, Brushes.Yellow); ft.TextAlignment = TextAlignment.Center; The part where I'm drawing the text: var

Set VerticalAlignment in DrawText

£可爱£侵袭症+ 提交于 2019-12-01 16:30:31
问题 I'm using DrawText to draw FormattedText on Visual Layer. Now I'm using the code below to define the formatted text and I'm able to set the TextAlignment to Center . But what about the VerticalAlignment ? As you can see in the image below the center of the text is not on the centerpoint which is shown with a red dot here. The part where I'm defining the FormattedText : var ft = new FormattedText("A", CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight, new Typeface("Verdana"), 36,

Drawing unicode text on listbox canvas is too slow

 ̄綄美尐妖づ 提交于 2019-12-01 06:00:34
I am trying to display news from a RSS in a listbox using the following format as shown in the image below. The application on the screenshot has been developed in firemonkey by styling the listbox. I need to display the same in my VCL application. The requirements of this layout are: The news title should be bold text The short description should be located at bottom and it should be wrapped if it doesn't fit in a single line(as shown in the image); font-style should be normal There should be an image for each news item My code so far: procedure TfrmDatePicker.ListBox1DrawItem(Control:

Drawing unicode text on listbox canvas is too slow

自闭症网瘾萝莉.ら 提交于 2019-12-01 03:54:12
问题 I am trying to display news from a RSS in a listbox using the following format as shown in the image below. The application on the screenshot has been developed in firemonkey by styling the listbox. I need to display the same in my VCL application. The requirements of this layout are: The news title should be bold text The short description should be located at bottom and it should be wrapped if it doesn't fit in a single line(as shown in the image); font-style should be normal There should

ffmpeg single quote in drawtext

£可爱£侵袭症+ 提交于 2019-11-30 07:12:09
问题 I haven't been able to get ffmpeg's drawtext video filter to draw apostrophes/single quotes when they are in drawtext's "text=" parameter, even when I escape them. Double quotes work fine, and apostrophes in text loaded from a file (e.g. textfile="example.txt") work fine. Is this a bug? e.g. ffmpeg -i test.mpg -vf drawtext="apostrophes don't print" ... ffmpeg -i test.mpg -vf drawtext="even when they\'re escaped" ... 回答1: Special character escapes are like violence: if they're not solving your