这是我的代码
private void executeAudioVideo() {
File moviesDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES);
String filePrefix = "audio_video";
String fileExtn = ".mp4";
youtubeURL = "https://www.youtube.com/embed/oEKyXKL25FU";
videoPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/video.mp4";
File dest = new File(moviesDir, filePrefix + fileExtn);
int fileNo = 0;
while (dest.exists()) {
fileNo++;
dest = new File(moviesDir, filePrefix + fileNo + fileExtn);
}
filePath = dest.getAbsolutePath();
String[] command = new String[]{"-y", "-i", videoPath, "-i", youtubeURL, "-filter_complex", "[0:a][1:a]amerge=inputs=2[a]", "-map", "0:v", "-map", "[a]", "-c:v", "copy", "-c:a", "libvorbis", "-ac", "2", "-shortest", filePath};
Toast.makeText(this, filePath, Toast.LENGTH_SHORT).show();
execFFmpegBinary(command);
}