-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompletableFuture doesn't raise exceptions for runtime errors #276
Comments
Is an exception thrown if ffmpeg executed synchronously with |
No exception with
|
Probably it happens because ffmpeg exits without error:
Probably it is so because it was able to connect to input and output. If it can't connect exit status is not 0. And I'm not sure if an exception should be thrown in that situation because a user will lost |
Indeed, that seems to be the case. I didn't think FFMpeg could stop correctly after that type of error 🤔 IMHO a solution could be to add the exit status of the process in |
FFmpeg prints result message only with 0 exit status. So there if exit status is added to |
I have came to an idea that it could be possible to include error messages (if any) to |
It would be interesting to know if there are other cases where this can occur but anyway it seems to occur when the input/output of a stream becomes unavailable. Including the error messages in the |
Often an error appears in ffmpeg output message when input file contains something that ffmpeg can't read. Most often it happens with corrupted files (not correctly finalized). But ffmpeg can still read such "bad" files and produce output. Regarding adding error messages to |
Perfect 👍 I'm going to discuss this with my team to see what they think of it. Thanks for your quick responses and your help 🙌 |
I've found an easy solution ! 🥳 I've stumbled upon this FFMpeg argument while working on how to reproduce the error in Jaffree's tests :
This works perfectly 👍 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()
.addArgument("-xerror")
.addInput(UrlInput.fromUrl("rtmp://localhost:1935/proxy/source"))
.addOutput(UrlOutput.toUrl("rtmp://localhost:1935/proxy/target")
.setFormat("flv")
.addMap(0, StreamType.AUDIO)
.addMap(0, StreamType.VIDEO)
.setCodec(StreamType.AUDIO, "copy")
.setCodec(StreamType.VIDEO, "copy")
)
.execute();
}
} Which produces these logs.
|
I'm really glad it works for you. I would appreciate if you could create a PR with an example in readme. |
Which branch must I start from ? I can see |
You could create a branch from develop branch. Usually with GitHub one creates a branch in own fork project. When it's done, PR could be created. |
Description
Errors happening after FFMpeg's startup don't raise exceptions.
FFMpeg startup errors are raised correctly.
Steps to reproduce
alfg/nginx-rtmp
docker image)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
This error message will come up but no exception will be raised.
Expected behavior
An exception should be raised because this issue causes FFMpeg to be stopped.
Logs
The text was updated successfully, but these errors were encountered: