-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Description
Description
Errors happening after FFMpeg's startup don't raise exceptions.
FFMpeg startup errors are raised correctly.
Steps to reproduce
- Run an Nginx server with nginx-rtmp-module installed (such as the
alfg/nginx-rtmp
docker image) - Run an FFMpeg process with the following command
ffmpeg -f lavfi -i testsrc=size=1920x1080:rate=25 -f lavfi -i sine=f=1:b=2000 -shortest -f flv rtmp://localhost:1935/proxy/source
- Run the following test class
import com.github.kokorin.jaffree.StreamType;
import com.github.kokorin.jaffree.ffmpeg.FFmpeg;
import com.github.kokorin.jaffree.ffmpeg.UrlInput;
import com.github.kokorin.jaffree.ffmpeg.UrlOutput;
class TestClass {
public static void main(String[] args) {
FFmpeg.atPath()
.addInput(UrlInput.fromUrl("rtmp://localhost:1935/hls/source"))
.addOutput(UrlOutput.toUrl("rtmp://localhost:1935/hls/target")
.setFormat("flv")
.addMap(0, StreamType.AUDIO)
.addMap(0, StreamType.VIDEO)
.setCodec(StreamType.AUDIO, "copy")
.setCodec(StreamType.VIDEO, "copy")
)
.executeAsync()
.toCompletableFuture()
.exceptionally(error -> {
System.err.println("An error has occured");
error.printStackTrace();
return null;
})
.join();
}
}
- Stop the Nginx server
This error message will come up but no exception will be raised.
c.g.k.jaffree.ffmpeg.FFmpegResultReader : [error] rtmp://localhost:1935/hls/source: Input/output error
Expected behavior
An exception should be raised because this issue causes FFMpeg to be stopped.
Logs
c.g.k.jaffree.ffmpeg.FFmpegResultReader : [error] rtmp://localhost:1935/hls/source: Input/output error
Metadata
Metadata
Assignees
Labels
No labels