ios – How to cancel/terminate an ongoing process of FFmpeg

I am using FFmpeg to process some videos using Obj-C. I am canceling the process using the below code :

-(void) cancelFFmpegProcessing {
    [MobileFFmpegConfig setStatisticsDelegate:self]; 
    [MobileFFmpegConfig setLogDelegate:self];
    [MobileFFmpeg cancel];
}

But if I cancel using this code , the process still exist in thread and runs untill the process is complete. Now my question is how to terminate all the task/process with a proper code/steps.

I want to cancel the ffmpeg process properly.

Read more here: Source link