0

How can i get a pcm mp4 with FFmpegFrameRecorder?I see it suppout pcm format.I try like below:

mFrameRecorder = new FFmpegFrameRecorder(mVideo, videoWidth, videoHeight, 1);
    mFrameRecorder.setFormat("mp4");
    mFrameRecorder.setSampleRate(sampleAudioRateInHz);
    mFrameRecorder.setFrameRate(frameRate);
    // Use H264
    mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);
    mFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_PCM_S16LE);
    // See: https://trac.ffmpeg.org/wiki/Encode/H.264#crf
    /*
     * The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn't technically lossless.
     * The range is exponential, so increasing the CRF value +6 is roughly half the bitrate while -6 is roughly twice the bitrate. General usage is to choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value and if it looks bad then choose a lower value.
     */
    mFrameRecorder.setVideoOption("crf", "28");
    mFrameRecorder.setVideoOption("preset", "superfast");
    mFrameRecorder.setVideoOption("tune", "zerolatency");

but it crashed with error msg :

library "/system/lib/libdl.so" ("/system/lib/libdl.so") needed or dlopened by "/system/lib/libnativeloader.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.github.crazyorr.ffmpegrecorder-2/lib/arm:/data/app/com.github.crazyorr.ffmpegrecorder-2/base.apk!/lib/armeabi", permitted_paths="/data:/mnt/expand:/data/data/com.github.crazyorr.ffmpegrecorder"]
DoubleCui
  • 49
  • 1
  • 1
  • 9
  • Since MP4 file is a container for MPEG's own codecs (h264, aac, mp3) it's not possible to use outsider formats. In `.setFormat`, use either AVI or FLV since those containers do support the PCM format. – VC.One Mar 10 '17 at 18:53
  • I just want to get this format.Is there have any good idea ? – DoubleCui Mar 13 '17 at 10:17

0 Answers0