Skip to content
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

Closed
vincentkelleher opened this issue Jan 26, 2022 · 13 comments · Fixed by #278
Closed

CompletableFuture doesn't raise exceptions for runtime errors #276

vincentkelleher opened this issue Jan 26, 2022 · 13 comments · Fixed by #278

Comments

@vincentkelleher
Copy link

Description

Errors happening after FFMpeg's startup don't raise exceptions.
FFMpeg startup errors are raised correctly.

Steps to reproduce

  1. Run an Nginx server with nginx-rtmp-module installed (such as the alfg/nginx-rtmp docker image)
  2. 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
  3. 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();
    }
}
  1. 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

@kokorin
Copy link
Owner

kokorin commented Jan 26, 2022

Is an exception thrown if ffmpeg executed synchronously with execute() method?

@vincentkelleher
Copy link
Author

No exception with execute() either 😐

2022-01-26 17:39:23.051 WARN --- [ main] c.github.kokorin.jaffree.ffmpeg.FFmpeg : ProgressListener isn't set, progress won't be reported
2022-01-26 17:39:23.059 INFO --- [ main] c.g.k.jaffree.process.ProcessHandler : Command constructed:
ffmpeg -loglevel level+info -i rtmp://localhost:1935/proxy/source -n -f flv -c:a copy -c:v copy -map 0:a -map 0:v rtmp://localhost:1935/proxy/target
2022-01-26 17:39:23.062 INFO --- [ main] c.g.k.jaffree.process.ProcessHandler : Starting process: ffmpeg
2022-01-26 17:39:23.096 INFO --- [ main] c.g.k.jaffree.process.ProcessHandler : Waiting for process to finish
2022-01-26 17:39:23.267 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
2022-01-26 17:39:23.268 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] built with Apple clang version 12.0.0 (clang-1200.0.32.29)
2022-01-26 17:39:23.269 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
2022-01-26 17:39:23.271 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavutil 56. 70.100 / 56. 70.100
2022-01-26 17:39:23.271 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavcodec 58.134.100 / 58.134.100
2022-01-26 17:39:23.272 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavformat 58. 76.100 / 58. 76.100
2022-01-26 17:39:23.272 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavdevice 58. 13.100 / 58. 13.100
2022-01-26 17:39:23.273 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavfilter 7.110.100 / 7.110.100
2022-01-26 17:39:23.273 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libavresample 4. 0. 0 / 4. 0. 0
2022-01-26 17:39:23.274 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libswscale 5. 9.100 / 5. 9.100
2022-01-26 17:39:23.274 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libswresample 3. 9.100 / 3. 9.100
2022-01-26 17:39:23.897 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] libpostproc 55. 9.100 / 55. 9.100
2022-01-26 17:39:23.898 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Input #0, flv, from 'rtmp://localhost:1935/proxy/source':
2022-01-26 17:39:23.898 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Metadata:
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] |RtmpSampleAccess: true
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Server : NGINX RTMP (github.com/arut/nginx-rtmp-module)
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] displayWidth : 1920
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] displayHeight : 1080
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] fps : 25
2022-01-26 17:39:23.899 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] profile :
2022-01-26 17:39:23.900 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] level :
2022-01-26 17:39:23.900 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Duration: 00:00:00.00, start: 4927.033000, bitrate: N/A
2022-01-26 17:39:23.900 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:0: Audio: mp3, 44100 Hz, mono, fltp, 64 kb/s
2022-01-26 17:39:23.907 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:1: Video: flv1, yuv420p, 1920x1080, 199 kb/s, 25 fps, 25 tbr, 1k tbn
2022-01-26 17:39:23.907 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Output #0, flv, to 'rtmp://localhost:1935/proxy/target':
2022-01-26 17:39:23.907 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Metadata:
2022-01-26 17:39:23.908 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] |RtmpSampleAccess: true
2022-01-26 17:39:23.908 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Server : NGINX RTMP (github.com/arut/nginx-rtmp-module)
2022-01-26 17:39:23.908 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] displayWidth : 1920
2022-01-26 17:39:23.908 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] displayHeight : 1080
2022-01-26 17:39:23.909 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] fps : 25
2022-01-26 17:39:23.909 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] profile :
2022-01-26 17:39:23.909 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] level :
2022-01-26 17:39:23.909 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] encoder : Lavf58.76.100
2022-01-26 17:39:23.909 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:0: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, mono, fltp, 64 kb/s
2022-01-26 17:39:23.910 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:1: Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 1920x1080, q=2-31, 199 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
2022-01-26 17:39:23.910 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream mapping:
2022-01-26 17:39:23.910 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:0 -> #0:0 (copy)
2022-01-26 17:39:23.910 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Stream #0:1 -> #0:1 (copy)
2022-01-26 17:39:23.911 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Press [q] to stop, [?] for help
2022-01-26 17:39:24.419 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 0 fps=0.0 q=-1.0 size= 0kB time=00:00:00.00 bitrate=N/A speed=N/A
2022-01-26 17:39:24.922 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 73 fps=0.0 q=-1.0 size= 539kB time=00:00:03.07 bitrate=1436.4kbits/s speed=6.05x
2022-01-26 17:39:25.433 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 111 fps=109 q=-1.0 size= 879kB time=00:00:04.62 bitrate=1556.7kbits/s speed=4.56x
2022-01-26 17:39:25.935 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 156 fps=102 q=-1.0 size= 1174kB time=00:00:06.42 bitrate=1496.5kbits/s speed=4.21x
2022-01-26 17:39:26.441 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 201 fps= 99 q=-1.0 size= 1524kB time=00:00:08.22 bitrate=1517.1kbits/s speed=4.06x
2022-01-26 17:39:26.952 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 245 fps= 97 q=-1.0 size= 1881kB time=00:00:09.97 bitrate=1544.2kbits/s speed=3.94x
2022-01-26 17:39:27.450 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 289 fps= 95 q=-1.0 size= 2234kB time=00:00:11.72 bitrate=1560.4kbits/s speed=3.86x
2022-01-26 17:39:27.952 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 333 fps= 94 q=-1.0 size= 2529kB time=00:00:13.50 bitrate=1534.0kbits/s speed=3.81x
2022-01-26 17:39:28.455 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 378 fps= 93 q=-1.0 size= 2875kB time=00:00:15.27 bitrate=1542.0kbits/s speed=3.78x
2022-01-26 17:39:28.959 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 422 fps= 93 q=-1.0 size= 3228kB time=00:00:17.03 bitrate=1552.7kbits/s speed=3.75x
2022-01-26 17:39:29.468 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 465 fps= 92 q=-1.0 size= 3522kB time=00:00:18.78 bitrate=1536.0kbits/s speed=3.72x
2022-01-26 17:39:29.968 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 510 fps= 92 q=-1.0 size= 3867kB time=00:00:20.55 bitrate=1541.1kbits/s speed= 3.7x
2022-01-26 17:39:30.472 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 553 fps= 91 q=-1.0 size= 4227kB time=00:00:22.30 bitrate=1552.0kbits/s speed=3.68x
2022-01-26 17:39:30.984 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 597 fps= 91 q=-1.0 size= 4521kB time=00:00:24.03 bitrate=1541.1kbits/s speed=3.66x
2022-01-26 17:39:31.477 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 635 fps= 90 q=-1.0 size= 4801kB time=00:00:25.57 bitrate=1537.8kbits/s speed=3.62x
2022-01-26 17:39:31.980 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 676 fps= 89 q=-1.0 size= 5137kB time=00:00:27.22 bitrate=1546.0kbits/s speed= 3.6x
2022-01-26 17:39:32.485 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 708 fps= 88 q=-1.0 size= 5345kB time=00:00:28.50 bitrate=1536.3kbits/s speed=3.53x
2022-01-26 17:39:32.995 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 747 fps= 87 q=-1.0 size= 5676kB time=00:00:30.06 bitrate=1546.4kbits/s speed=3.51x
2022-01-26 17:39:33.496 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 787 fps= 87 q=-1.0 size= 5961kB time=00:00:31.66 bitrate=1542.3kbits/s speed=3.48x
2022-01-26 17:39:34.005 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 832 fps= 87 q=-1.0 size= 6313kB time=00:00:33.43 bitrate=1547.0kbits/s speed=3.49x
2022-01-26 17:39:34.464 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 877 fps= 87 q=-1.0 size= 6617kB time=00:00:35.23 bitrate=1538.6kbits/s speed=3.49x
2022-01-26 17:39:34.465 ERROR --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [error] rtmp://localhost:1935/proxy/source: Input/output error
2022-01-26 17:39:34.465 WARN --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [flv @ 0x7fd209812e00] [warning] Failed to update header with correct duration.
2022-01-26 17:39:34.465 WARN --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [flv @ 0x7fd209812e00] [warning] Failed to update header with correct filesize.
2022-01-26 17:39:34.465 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 897 fps= 85 q=-1.0 Lsize= 6788kB time=00:00:36.03 bitrate=1543.3kbits/s speed=3.41x
2022-01-26 17:39:34.467 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] video:6471kB audio:282kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.533828%
2022-01-26 17:39:34.468 INFO --- [ main] c.g.k.jaffree.process.ProcessHandler : Process has finished with status: 0
2022-01-26 17:39:34.468 WARN --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : One or more errors appeared during ffmpeg execution, ignoring since result is available

@kokorin
Copy link
Owner

kokorin commented Jan 26, 2022

Probably it happens because ffmpeg exits without error:

[ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] video:6471kB audio:282kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.533828%
[ main] c.g.k.jaffree.process.ProcessHandler : Process has finished with status: 0
[StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : One or more errors appeared during ffmpeg execution, ignoring since result is available

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 FFmpegResult. What are your thoughts on that?

@vincentkelleher
Copy link
Author

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 FFmpegResult but that means you can have multiple behaviours when an issue occurs (raise an exception or have a failed result) and, in that case, can we really say it's an error ?

@kokorin
Copy link
Owner

kokorin commented Jan 27, 2022

FFmpeg prints result message only with 0 exit status. So there if exit status is added to FFmpegResult it will always be 0.

@kokorin
Copy link
Owner

kokorin commented Jan 28, 2022

I have came to an idea that it could be possible to include error messages (if any) to FFmpegResult. But to be honest I'm not sure if it will be useful.

@vincentkelleher
Copy link
Author

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 FFmpegResult can be interesting if it's not too much hassle 😊

@kokorin
Copy link
Owner

kokorin commented Jan 28, 2022

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 FFmpegResult: it's not in the roadmap, but I will happily review a PR with required changes.

@vincentkelleher
Copy link
Author

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 🙌

@vincentkelleher
Copy link
Author

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 :

-xerror (global)
Stop and exit on error

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.

2022-01-28 17:23:31.537 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 133 fps= 88 q=-1.0 size= 1052kB time=00:00:05.35 bitrate=1609.8kbits/s speed=3.53x
2022-01-28 17:23:32.038 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 158 fps= 78 q=-1.0 size= 1236kB time=00:00:06.31 bitrate=1602.2kbits/s speed=3.12x
2022-01-28 17:23:32.546 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 186 fps= 74 q=-1.0 size= 1430kB time=00:00:07.43 bitrate=1574.8kbits/s speed=2.95x
2022-01-28 17:23:33.051 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 224 fps= 74 q=-1.0 size= 1708kB time=00:00:08.95 bitrate=1561.7kbits/s speed=2.95x
2022-01-28 17:23:33.278 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] frame= 261 fps= 74 q=-1.0 size= 1977kB time=00:00:10.43 bitrate=1551.1kbits/s speed=2.95x
2022-01-28 17:23:33.279 ERROR --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [error] rtmp://localhost:1935/proxy/source: Input/output error
2022-01-28 17:23:33.282 INFO --- [ StdErr] c.g.k.jaffree.ffmpeg.FFmpegResultReader : [info] Conversion failed!
2022-01-28 17:23:33.283 INFO --- [ main] c.g.k.jaffree.process.ProcessHandler : Process has finished with status: 1
2022-01-28 17:23:33.283 WARN --- [ StdErr] c.g.kokorin.jaffree.process.Executor : Interrupting starter thread (main) because of exception: ffmpeg exited with message: [error] rtmp://localhost:1935/proxy/source: Input/output error
2022-01-28 17:23:33.284 WARN --- [ main] c.g.k.jaffree.process.ProcessHandler : Process has been interrupted
2022-01-28 17:23:33.284 INFO --- [ main] c.g.k.jaffree.ffmpeg.FFmpegStopper : Ignoring class java.io.IOException: Stream closed
Exception in thread "main" com.github.kokorin.jaffree.JaffreeException: Failed to execute, was interrupted
at com.github.kokorin.jaffree.process.ProcessHandler.interactWithProcess(ProcessHandler.java:189)
at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:146)
at com.github.kokorin.jaffree.ffmpeg.FFmpeg.execute(FFmpeg.java:400)
at Scratch.main(scratch_1.java:19)
Suppressed: com.github.kokorin.jaffree.JaffreeException: ffmpeg exited with message: [error] rtmp://localhost:1935/proxy/source: Input/output error
at com.github.kokorin.jaffree.ffmpeg.FFmpegResultReader.read(FFmpegResultReader.java:136)
at com.github.kokorin.jaffree.ffmpeg.FFmpegResultReader.read(FFmpegResultReader.java:38)
at com.github.kokorin.jaffree.process.ProcessHandler$1.run(ProcessHandler.java:233)
at com.github.kokorin.jaffree.process.Executor$1.run(Executor.java:83)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.InterruptedException: sleep interrupted
at java.base/java.lang.Thread.sleep(Native Method)
at com.github.kokorin.jaffree.process.ProcessHandler.waitForExecutorToStop(ProcessHandler.java:318)
at com.github.kokorin.jaffree.process.ProcessHandler.interactWithProcess(ProcessHandler.java:182)
... 3 more

Process finished with exit code 1

@kokorin
Copy link
Owner

kokorin commented Jan 28, 2022

I'm really glad it works for you. I would appreciate if you could create a PR with an example in readme.

@vincentkelleher
Copy link
Author

Which branch must I start from ? I can see develop is behind master.
Do I need specific rights to push my branch ?

@kokorin
Copy link
Owner

kokorin commented Jan 31, 2022

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.

vincentkelleher pushed a commit to vincentkelleher/Jaffree that referenced this issue Jan 31, 2022
vincentkelleher pushed a commit to vincentkelleher/Jaffree that referenced this issue Jan 31, 2022
@kokorin kokorin closed this as completed Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants