0

I need to determine how can I record video in Android device and encode it in h.264 Baseline profile in mp4 container. I can't find information about this because smartphone manufacturers usually don't show it. All I know is that Sony Z3 encodes all recorded video in H.264 High Profile (L3-L6), HTC One M8 - H.264 Baseline, Samsung Galaxy S3 - partially in High and Baseline.

fadden
  • 51,356
  • 5
  • 116
  • 166
Ruslan Berozov
  • 540
  • 7
  • 16
  • 1
    You can query the CodecProfileLevel information out of http://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html – fadden Mar 04 '16 at 17:09

1 Answers1

1

It helps me: http://writingminds.github.io/ffmpeg-android-java/ I used this ready-made solution because I had problems with compiling ffmpeg libs with Cygwin64 and Android NDK on Windows 7.

Ruslan Berozov
  • 540
  • 7
  • 16
  • am not able to understand hot to use it – venkatesh gowda Aug 18 '16 at 04:18
  • 1
    You must use official [FFmpeg Documentation](https://ffmpeg.org/ffmpeg.html). it is a bit difficult, but there is no alternative. For example: `String[] cmdArray = {"-y", "-i", path, "-map", "0", "-c:v", "libx264", "-profile:v", "baseline", "-level", "3.0", "-preset", "ultrafast", "-b:v", multipliedVideoBitRate, "-bufsize", multipliedVideoBitRate, "-c:a", "copy", "-b:a", AUDIO_BIT_RATE_STRING, output}; ` `try {` `ffmpeg = FFmpeg.getInstance(context);` `ffmpeg.execute(cmdArray, new ExecuteBinaryResponseHandler() { ... }` – Ruslan Berozov Aug 18 '16 at 11:09