-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding emoji with moviepy #507
Comments
Not unless you use a specific emoji font. You can also load your emojis as images using ImageClip. |
I was never actually able to get this to work. I think there is an underlying issue with ffmpeg which prevents emojis from being supported. |
Wondering if this worked for anyone now? |
Anyone found a solution to this? or is it a problem forever to be forgotten and lost :((( |
MS Word displays emojis with font 'Segoe-UI-Emoji'. When I set the font of my clip to this, it was able to display the emoji's but not with colours. For example: |
Thanks for this! |
For those who are still finding solutions to add colorful emoji to video, here is a demo. The prequistes:
The solution:
The code to mix-in an emoji to a video: def make_emoji_image(emoji, font_path, font_size):
emoji_font = ImageFont.truetype(font_path, font_size)
text_size = emoji_font.getsize(emoji.strip())
image = Image.new("RGBA", text_size, (0, 0, 0, 0))
with Pilmoji(image) as pilmoji:
pilmoji.text((0, 0), emoji.strip(), (0, 0, 0), emoji_font)
return np.array(image)
video_clip = VideoFileClip("/path/to/your/video")
emoji_clip = ImageClip(make_emoji_image("😜", "/path/to/your/emoji/font", 48), duration=10).set_start(0)
result = CompositeVideoClip([video_clip, emoji_clip])
result.write_videofile("/path/to/output") |
The solution of @kaka1909 works fine, but not for apple emojis :( . I tried to just use the apple emoji font from https://github.com/samuelngs/apple-emoji-linux but it did not work. It raises an "OSError: invalid pixel size". Anyone trying to work with apple emojis ? |
this worked.. was ready to jump |
Hi,
I was wondering if it was possible to add emoji characters with TextClip. For example, rendering something like this: 😅😂😂😂 on top of a video.
I tried adding a text clip with the proper unicode characters, but they show up as question marks.
Thanks in advance for your help
The text was updated successfully, but these errors were encountered: