Android SDK中剪切/修剪视频文件 [英] Android sdk cut/trim video file

查看:782
本文介绍了Android SDK中剪切/修剪视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来削减对Android的视频(MP4或3GP),喜欢使用只有最后5秒的电影......在iPhone上,这是可能的使用AVAssetExportSession,但在Android上我还没有发现任何类似,只是也许一些参考的ffmpeg库,它看起来很复杂。有没有更简单的方式来做到这一点?

Is there any way to cut a video (mp4 or 3gp) on android, like use only the last 5 seconds of the movie... on iphone this is possible using the AVAssetExportSession but on android I haven't found anything similar, just maybe some references to ffmpeg library which seems complicated. Is there any easier way to do it?

推荐答案

您可以与我的 mp4parser 库做到这一点。看看它到底是什么顾名思义ShortenExample。 由于库无法重新连接code中的视频只能在切断I帧的视频。因此,在时间点,你可以做一个切口都相当粗糙。

You can do this with my mp4parser library. Have a look at the ShortenExample it does exactly what the name suggests. Since the library cannot re-encode the video it can only cut the video at I-frames. So the points in time where you can make a cut are quite coarse.

在Android 4.1,你可以通过媒体codeC API,它可能是一个选项,访问硬件codeCS(但我没有看到那个还没有任何例子)

On Android 4.1 you can access the hardware codecs via MediaCodec API which could be an option (but I haven't seen any example of that yet)

这篇关于Android SDK中剪切/修剪视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆