I am using
https://github.com/writingminds/ffmpeg-android-java
to run ffmpeg commands on android. I am trying to overlay an image on a video. For some reason, I get the following error when I execute this command.
ffmpeg -i input.mp4 strict -2 -i overlay.jpg -filter_complex [0:v][1:v] overlay=25:25:enable='between(t,0,4)' output.mp4
Output file #0 does not contain any stream
Could anyone help me out? Thanks in advance!
I was facing this same issue and my problem was: I was calling the execute method the wrong way. The string array I was passing was something like this:
final String[] cmd = new String[] { "-i input.mp4 strict -2 -i overlay.jpg -filter_complex [0:v][1:v] overlay=25:25:enable='between(t,0,4)' output.mp4" };
The correct way to create this array, though, is to split the command in separate strings:
final String[] cmd = new String[]{ "-i", "input.mp4", "strict", "-2", "-i", "overlay.jpg",
"-filter_complex", "[0:v][1:v]", "overlay=25:25:enable='between(t,0,4)'", "output.mp4"};
And then call execute:
try {
final FFmpeg ffmpeg = FFmpeg.getInstance(context);
ffmpeg.execute(cmd, new FFmpegExecuteResponseHandler() {
@Override
public void onSuccess(String message) {
}
@Override
public void onProgress(String message) {
}
@Override
public void onFailure(String message) {
}
@Override
public void onStart() {
}
@Override
public void onFinish() {
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
}
I found this solution on a lauffenp's comment on this issue: https://github.com/WritingMinds/ffmpeg-android-java/issues/88
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With