可以在视频中添加文字叠加层吗?

时间:2015-06-15 11:24:11

标签: java android video overlay real-time

我是一名iOS开发人员,我为客户编写了一个应用程序,它是一个健身(Crossfit)计时器应用程序,它会为您拍摄锻炼,并为完成的视频添加实时叠加和重复计数。这是一个相当具有挑战性的项目,我只是想知道在Android上是否可以做同样的事情?

基本上我需要知道的是,是否可以将更改的文本(例如计时器在几秒钟内计数)叠加到录制的视频上?

如果有人写过这样做的应用程序,我会很高兴看到代码片段,因为Java不是我的强项!

谢谢!

2 个答案:

答案 0 :(得分:1)

  1. 如果您只想在视频上显示文字而不是将其添加到视频文件中,使用FrameLayout非常简单:
  2. <?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>
    

    和文字将显示在视频上。

    1. 如果要将文本添加到原始视频文件中,则不会那么简单。您需要外部工具来处理此问题,例如FFMPEG。此链接为您提供有关此主题的更多信息:How to add text on video recording?How to embed text while recording video in Android?

答案 1 :(得分:0)

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.

相关问题