Add overlays to video on Android [closed]

笑着哭i 提交于 2019-12-03 21:20:53

Provided you're playing the video using a VideoView or similar, you can overlay any View (e.g. TextView, ImageView) using a RelativeLayout. For example, to show a text on the top right corner of the video:

<RelativeLayout
    android:id="@+id/playerLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

        <VideoView
            android:id="@+id/videoPlayer"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/videoText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_margin="3dp"
            android:text="@string/player_text" />

</RelativeLayout>

As @rbarriuso said, ffmpeg4Android is able to meet your requirement. There is also a guide to install both library and demo in both Android Studio and Eclipse. Following, there are also the watermark command which may satisfy you.

Hope it can help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!