Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Question: How to cancel a session completely #33

@nooitaf

Description

@nooitaf

I'm trying to cancel a running rtmp session on android started with FFprobeKit.executeAsync(), but for some reason it doesn't completely close the connection even tho the session says it's completed. I get a callback and it seems like it ended, but it doesn't. Also canceled sessions seem to stick around after they get canceled. Is there a way to remove them?

This is what i do to cancel all running sessions...

List<Session> sessions = FFmpegKitConfig.getSessions();
for (int i = 0; i < sessions.size(); i++) {
  Session session = sessions.get(i);
  FFmpegKit.cancel(session.getSessionId());
}

Also tried FFmpegKit.cancel() but i get the same result

From the first session (that doesn't stop) i get this when i cancel it which looks like its done..

Exiting normally, received signal 2.
, state=COMPLETED, returnCode=255, failStackTrace='null'}

But my rtmp server still thinks there is a connection and when i try to start a new one i get this instantly..

[rtmp @ 0x7e2d0fcf80] Server error: Stream already publishing
rtmp://10.0.0.200/live/android: Operation not permitted
, state=COMPLETED, returnCode=1, failStackTrace='null'}

When i start multiple sessions i get all tries listed as sessions from getSessions() with completed state and they never seem to go away.

I'm very new to android and java so maybe i'm just missing something simple, or this is just normal, but it doesn't seem right.
Is there maybe another way to just force kill all ffmpeg processes?

Metadata

Metadata

Assignees

Labels

androidAffect Android platformbugSomething isn't workingfixed-in-v4.5Fixed in release v4.5libraryAffects the libraryv4.4Affects v4.4 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions