arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.52k stars 603 forks source link

FFmpeg is not canceling using FFMpeg.cancel and with FFmpeg.cancel(exeID); it working behind the scene #1024

Open qasimali09 opened 3 months ago

qasimali09 commented 3 months ago

Description Closing the session using FFmpegKit.cancel(sessionId) does not close the session.

Expected behavior Session should be closed.

Current behavior Working well in iOS simulator but not in real iOS device

To Reproduce Create a session with the command -i input.mp4 -c:a copy -c:v h264_videotoolbox -vf scale=width:height -b:v bitrate output.mp4 Cancel it using FFmpegKit.cancel(sessionId) or FFmpegKit.cancel()

Environment

gregoireLem commented 2 months ago

Same, I used this hack to globally kill all ffmpeg process : FFmpegKit.execute("-t 0")

tanersener commented 1 week ago

We updated our iOS test app to check this scenario, and our tests didn’t show any issues with the cancel() method. We also tested it on real devices.

You can run our tests by using the following command in the Concurrent Execution tab of the iOS test app.

NSString* ffmpegCommand = [NSString stringWithFormat:@"-y -i %@ -c:a copy -c:v h264_videotoolbox -vf scale=300:300 %@", inputVideo, videoFile];

tanersener commented 1 week ago

Btw, we ran our tests in 6.0.

gregoireLem commented 1 week ago

I'm pretty sure in iOS 18, network session are not killed with the ffmpeg session. Whether via http or SRT socket, the connection stays up after the cancel is called