0
phonegap 앱을 개발 중이며 .amr 파일을 .mp3 파일로 변환하는 플러그인을 작성하려고합니다. 나는이 변환을 수행하는 JAVE를 사용하고 있는데이 바탕 화면에 일하고있는 동안이 예외와 안드로이드에 실패phonegap Android 프로젝트에서 sauronsoftware의 Jave 사용
java.io.IOException: Error running exec().
Command: [/data/data/<my_package>/cache/jave-1/ffmpeg, -i, /sdcard/<my_filename>.amr, -vn, -acodec, libmp3lame, -f, mp3, -y, /sdcard/<my_filename>.mp3]
Working Directory: null Enviroment: null
I는 다음과 같이 변환 할 노력하고있어 : 내가 this answer을 발견
private void convert(String input_file, CallbackContext callbackContext){
File input = new File(input_file);
File output = new File(input_file.replace(".amr", ".mp3"));
Encoder encoder = new Encoder();
EncodingAttributes encodingAttributes = new EncodingAttributes();
AudioAttributes audioAttributes = new AudioAttributes();
audioAttributes.setCodec("libmp3lame");
encodingAttributes.setAudioAttributes(audioAttributes);
encodingAttributes.setFormat("mp3");
try{
encoder.encode(input, output, encodingAttributes);
input.delete();
callbackContext.success("finished");
}
catch(Exception e){
callbackContext.error(e.getMessage());
}
}
왜 오류가 발생하는지 이해하지만 대답은 해결책을 제공하지 않습니다. Phonegap 프로젝트에서이 작업을 수행 할 수있는 방법이 있습니까? 플러그인과 함께 ffmpeg 라이브러리를 패키징하고 앱이 플러그인을 호출 할 때 올바른 폴더에 복사해야합니까?
/data/data/<my_package>/cache/jave-1
어떻게하면 ffmpeg를 실행할 수 있습니까? – patrick