I am working on a video recording and sharing application for Android. The specifications of the app are as follows:-
- Recording a 10 second (maximum) video from inside the app (not using the device's camera app)
- No further editing on the video
- Storing the video in a Firebase Cloud Storage (GCS) bucket
- Downloading and playing of the said video by other users
From the research, I did on SO and others sources for this, I have found the following (please correct me if I am wrong):-
The three options and their respective features are:-
1.Ffmpeg
- Capable of achieving the above goal and has extensive answers and explanations on sites like SO, however
- Increases the APK size by 20-30mb (large library)
- Runs the risk of not working properly on certain 64-bit devices
2.MediaRecorder
- Reliable and supported by most devices
- Will store files in .mp4 format (unless converted to h264)
- Easier for playback (no decoding needed)
- Adds the mp4 and 3gp headers
- Increases latency according to this question
3.MediaCodec
- Low level
- Will require MediaCodec, MediaMuxer, and MediaExtractor
- Output in h264 ( without using MediaMuxer for playback )
- Good for video manipulations (though, not required in my use case)
- Not supported by pre 4.3 (API 18) devices
- More difficult to implement and code (my opinion - please correct me if I am wrong)
- Unavailability of extensive information, tutorials, answers or samples (Bigflake.com being the only exception)
After spending days on this, I still can't figure out which approach suits my particular use case. Please elaborate on what I should do for my application. If there's a completely different approach, then I am open to that as well.
My biggest criteria are that the video encoding process be as efficient as possible and the video to be stored in the cloud should have the lowest possible space usage without compromising on the video quality.
Also, I'd be grateful if you could suggest the appropriate format for saving and distributing the video in Firebase Storage, and point me to tutorials or samples of your suggested approach.
Thank you in advance! And sorry for the long read.