Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android record square video and concat

Is there a way to record square (640x640) videos and concat them in Android? I looked up in the Internet and found some solutions. The solution seems to be "ffmpeg". However, to use ffmpeg I need to dive into NDK and build ffmpeg from its sources. Is there a solution by only using the Android SDK?

My basic needs are:

  • Record multiple videos (square format)
  • Resize captured videos (i.e. 480x480 to 640x640)
  • Concat captured videos
  • Rotate final video (clockwise 90)
  • Final output will be in mp4 or mpg format
like image 290
faruk.kuscan Avatar asked Feb 25 '15 20:02

faruk.kuscan


1 Answers

Is there a solution by only using the Android SDK?

Not really.

Your primary video recording option is MediaRecorder, and it supports exactly nothing of what you list. For example, there is no requirement for any Android device to support taking square videos.

You are also welcome to use the camera preview stuff to assemble your own videos from individual frames. Vine does this, AFAIK. There, you could perhaps use existing Bitmap facilities to handle the cropping, resizing, and rotating. 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).

like image 77
CommonsWare Avatar answered Sep 21 '22 01:09

CommonsWare