简体   繁体   English

Android记录方形视频和concat

[英]Android record square video and concat

Is there a way to record square (640x640) videos and concat them in Android? 有没有办法录制方形(640x640)视频并在Android中连接它们? I looked up in the Internet and found some solutions. 我抬头看了互联网,发现了一些解决方案。 The solution seems to be "ffmpeg". 解决方案似乎是“ffmpeg”。 However, to use ffmpeg I need to dive into NDK and build ffmpeg from its sources. 但是,要使用ffmpeg,我需要深入NDK并从其源代码构建ffmpeg。 Is there a solution by only using the Android SDK? 仅使用Android SDK是否有解决方案?

My basic needs are: 我的基本需求是:

  • Record multiple videos (square format) 录制多个视频(方格式)
  • Resize captured videos (ie 480x480 to 640x640) 调整捕获的视频大小(即480x480到640x640)
  • Concat captured videos Concat捕获了视频
  • Rotate final video (clockwise 90) 旋转最终视频(顺时针90)
  • Final output will be in mp4 or mpg format 最终输出将采用mp4或mpg格式

Is there a solution by only using the Android SDK? 仅使用Android SDK是否有解决方案?

Not really. 并不是的。

Your primary video recording option is MediaRecorder , and it supports exactly nothing of what you list. 您的主要视频录制选项是MediaRecorder ,它完全不支持您列出的内容。 For example, there is no requirement for any Android device to support taking square videos. 例如,不要求任何Android设备支持拍摄方形视频。

You are also welcome to use the camera preview stuff to assemble your own videos from individual frames. 您也可以使用相机预览功能从各个帧中组合您自己的视频。 Vine does this, AFAIK. 藤做到这一点,AFAIK。 There, you could perhaps use existing Bitmap facilities to handle the cropping, resizing, and rotating. 在那里,您可以使用现有的Bitmap工具来处理裁剪,调整大小和旋转。 However, this will be slow, and doing this work in a way that can keep up with a reasonable frame rate will be difficult. 然而,这将是缓慢的,并且以能够保持合理帧速率的方式执行此工作将是困难的。 Also, I do not know if there is a library that can stitch those frames together into a video, or blend in any sort of audio (camera previews are pure images). 此外,我不知道是否有一个库可以将这些帧拼接成一个视频,或者混合在任何类型的音频中(相机预览是纯图像)。

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

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