简体   繁体   English

Android裁剪并缩小视频大小

[英]Android cropping and decreasing video size

we are going to start an app that captures videos or picks videos from gallery. 我们将启动一个捕获视频或从图库中挑选视频的应用。 The videos will be exactly 30 seconds, so users can crop or trim videos like video editor. 视频将恰好是30秒,因此用户可以裁剪或修剪视频,例如视频编辑器。

At this point, we got 2 main problems. 至此,我们遇到了两个主要问题。 The first one is video size. 第一个是视频大小。 You know the video size could be huge for uploading :) So we need to decrease video size. 您知道上传的视频可能很大:)因此,我们需要减小视频大小。 The other problem is when iOS device captures and uploads video to server, there are some problems when trying to play that video on android app. 另一个问题是,当iOS设备捕获视频并将视频上传到服务器时,尝试在android应用上播放该视频时会出现一些问题。

We have used “ffmpeg” library before for an another project but that library has varous problems like slow compression or library .so file's size. 之前,我们已将“ ffmpeg”库用于另一个项目,但该库存在各种问题,例如压缩缓慢或库.so文件大小。 And also have compatibility issues with sdk 24 (nougat) 并且还存在与SDK 24(牛轧糖)的兼容性问题

Anyone has an experience about that? 有人对此有经验吗? Or any ideas to overcome those problems? 还是有解决这些问题的想法? Thank u all. 谢谢大家

I don't know what problems you have with ffmpeg. 我不知道您对ffmpeg有什么问题。 But it is definetely the best and the fastest library available for video editing,creating etc. Use ffmpeg4android if size is important for you. 但这绝对是可用于视频编辑,创建等的最佳,最快的库。如果大小对您很重要,请使用ffmpeg4android The library is about 6 megabytes and it is a wrapper for ffmpeg and has most usable methods of ffmpeg. 该库大约6兆字节,它是ffmpeg的包装程序,并具有ffmpeg的大多数可用方法。

Please check Android MediaMuxer Api https://developer.android.com/reference/android/media/MediaMuxer.html 请检查Android MediaMuxer Api https://developer.android.com/reference/android/media/MediaMuxer.html

With this you can crop video, change it's frame rate and resolution 有了它,您可以裁剪视频,更改其帧频和分辨率

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM