【发布时间】:2015-05-12 16:04:03
【问题描述】:
我正在尝试在 Android 应用程序内的 mp4 视频之上添加叠加图像/文本。 大多数解决方案都指向 FFmpeg(或 appunits AndroidFFmpeg),但不稳定且维护起来非常复杂。 有没有使用 Android SDK 的本地方法来做到这一点? (MediaCodec?MediaMuxer?)
谢谢你, 奥利
【问题讨论】:
标签: android video ffmpeg overlay media
我正在尝试在 Android 应用程序内的 mp4 视频之上添加叠加图像/文本。 大多数解决方案都指向 FFmpeg(或 appunits AndroidFFmpeg),但不稳定且维护起来非常复杂。 有没有使用 Android SDK 的本地方法来做到这一点? (MediaCodec?MediaMuxer?)
谢谢你, 奥利
【问题讨论】:
标签: android video ffmpeg overlay media
有两种方法可以理解您的问题:
使用内置的VideoView。您可能需要将 textView /imageView 包装在一个额外的布局中以将其推到前面:
<VideoView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/videoView"
android:background="#00000000"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text"/>
</LinearLayout>
更新:正如this answer 中所指出的,ExtractMpegFramesTest 可能对您来说很有趣
【讨论】: