-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
In my Android test application FFmpegFrameRecorder work properly when i pass File in conctructor, but when i pass OutputStream, app crashes and in Logcat i can see only com.github.crazyorr.ffmpegrecorder A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 29234 (Thread-266)
Code, where i init my frame recorder:
String recordedTime = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File file = CameraHelper.getOutputMediaFile(recordedTime, CameraHelper.MEDIA_TYPE_VIDEO);
FileOutputStream fos = new FileOutputStream(file);
mFrameRecorder = new FFmpegFrameRecorder(fos, videoWidth, videoHeight, 1);
mFrameRecorder.setFormat("mp4");
mFrameRecorder.setSampleRate(sampleAudioRateInHz);
mFrameRecorder.setFrameRate(frameRate);
mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
mFrameRecorder.setVideoOption("crf", "28");
mFrameRecorder.setVideoOption("preset", "superfast");
mFrameRecorder.setVideoOption("tune", "zerolatency");
Gradle:
compile(group: 'org.bytedeco', name: 'javacv-platform', version: '1.3.2') {
exclude group: 'org.bytedeco.javacpp-presets'
}
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-arm'
Before that i use FFmpegFrameRecorder via just passing file in constructor, but in my app i need possibility to write video from camera using OutputStream.
Please help, maybe i understand something wrong