여러 mp4 파일을 하나로 결합해야하는 앱에서 https://github.com/hiteshsondhi88/ffmpeg-android-java을 사용하고 있습니다. 여기 안드로이드에서 FFmpeg로 mp4 파일을 병합 할 수 없습니다.
는 명령을 파일을 추가 할ffmpeg -i concat:"/data/data/com.testapp.app/cache:temp/lds82df9skov65i15k3ct16cik.mp4|/data/data/com.testapp.app/cache:temp/qm5s0utmb8c1gbhch6us2tnilo.mp4" -codec copy /data/data/com.testapp.app/cache:temp/4egqalludvs03tnfleu5dgb6iv.mp4
자바 방법, 동영상 파일 인 배열 잡고 파일 내가
public void appendFiles() {
showProgressDialog();
movieFile = getRandomFile();
StringBuilder b = new StringBuilder();
try {
for (int i = 0; i < movieFiles.size(); i++) {
File f = movieFiles.get(i);
if (!f.exists()) {
continue;
}
if(i != 0){
b.append("|");
}
b.append(f.getPath());
}
final String command = "-i concat:\""+b.toString() + "\" -codec copy " + movieFile.getPath();
try {
ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
@Override
public void onFailure(String s) {
app.log("FAILED with output : " + s);
}
@Override
public void onSuccess(String s) {
app.log("SUCCESS with output : " + s);
createThumbnail();
stopProgressDialog();
startReview();
}
@Override
public void onProgress(String s) {
app.log("Started command : ffmpeg " + command);
}
@Override
public void onStart() {
app.log("Started command : ffmpeg " + command);
}
@Override
public void onFinish() {
app.log("Finished command : ffmpeg " + command);
}
});
}
catch (FFmpegCommandAlreadyRunningException e) {
e.printStackTrace();
}
}
catch (Exception e) {
e.printStackTrace();
}
}
및 getRandomFile()
public File getRandomFile() {
if (captureDir != null) {
if (captureDir.exists()) {
SecureRandom random = new SecureRandom();
File file = new File(captureDir, new BigInteger(130, random).toString(32) + ".mp4");
return file;
}
}
return null;
}
을 결합하려는 것입니다 하지만 그 파일이나 디렉토리에 오류가 나타나지 않습니다.
concat : "/ data/data/com.testapp.app/cache : temp/lds82df9skov65i15k3ct16cik.mp4 | /data/data/com.testapp.app/cache : temp/qm5s0utmb8c1gbhch6us2tnilo.mp4": 해당 파일이나 디렉토리가 없습니다.
어떤 아이디어가 있습니까?
작동하도록 만들었습니까? –