Android SDK中剪切/修剪视频文件视频文件、Android、SDK

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

有什么办法来削减对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)

阅读全文

相关推荐

最新文章