Is it possible to add a text overlay to videos?

4.5k views Asked by At

I am an iOS developer and I have written an app for a client, it is a fitness (Crossfit) timer app, it films you on your workout and adds real time overlays and rep counts to the finished video. It was a fairly challenging project to complete and I was just wondering if the same thing would be possible on Android?

Essentially what I need to know is, is it possible to overlay text that changes (e.g a timer counting up in seconds) onto a recorded video?

If anyone has written an app that does this I would be grateful to see code snippets as Java is not my forte!

Thanks!

2

There are 2 answers

0
Palejandro On
  1. If you want to just display text over video and not add it into video file, it's really easy using FrameLayout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <VideoView
        android:id="@+id/VideoView"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

    <TextView
        android:text="TEXT"
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</FrameLayout>

and text will be displayed over video.

  1. If you want to add text into original video file, it will not be that simple. You need external tools to handle this, for example FFMPEG. this links give you more info about this topic: How to add text on video recording? and How to embed text while recording video in Android?
1
Anatch On

Yes it is possible, I have followed this tutorial and it is pretty efficient : http://www.wowza.com/forums/content.php?432-How-to-add-graphic-overlays-to-live-streams-with-Wowza-Transcoder That is for live stream and for videos you can use those softwares: Openshot or Kdenlive.