leafo / gifine

Quickly record and edit gifs and videos of your desktop
285 stars 14 forks source link

recording doesnt stop when stop button is pressed, ffmpeg needs to be killed manually #2

Open digitalcreature opened 7 years ago

digitalcreature commented 7 years ago

On Ubuntu 16.04. After clicking Stop Recording, ffmpeg continues to count up frames in terminal, persisting even after closing the application. The process is completely detached from job control and it's parent process, requiring manual SIGKILL'n. Heres a snapshot of the process tree: image

leafo commented 7 years ago

Here's the line of code that attempts to quit the ffmpeg process: https://github.com/leafo/gifine/blob/master/gifine/load_window.moon#L92

Here's the kill method for GIO: https://developer.gnome.org/gio/unstable/GSubprocess.html#g-subprocess-force-exit

I'm not sure why it wouldn't stop. What version of ffmpeg do you have?

mine is:

ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
leafo commented 7 years ago

Also can you run it from the console and see if there's a lua runtime error that's happening

digitalcreature commented 7 years ago

image my ffmpeg seems to be an older version; which is strange considering i just ran apt upgrade (come on ubuntu main update yer packages..) lua doesn't seem to be causing any issues; ill try updating ffmpeg

osa1 commented 7 years ago

FWIW I have ffmpeg version 3.1.5 and I'm having the same problem.

LiamDawe commented 7 years ago

Also seeing this issue: ffmpeg version 3.0.5-0ubuntu0.16.10.1

LiamDawe commented 7 years ago

One thing I did notice, was that it did kill ffmpeg when I exported a gif, the only time it actually did it.

koyal13 commented 7 years ago

@LiamDawe Same situation to me. When gifine try to exports on gif you can see how tmp dir increase with frames that shouldn't be there becouse record have stopped but process don't do it... It's a terrible memory issue! ffmpeg version 2.8.10-0ubuntu0.16.04.1

leafo commented 7 years ago

Before the program shows the frame editor window it waits for the process it spawned for ffmpeg to terminate. Is it possible that your ffmpeg command is actually a shell script that executes ffmpeg in the background? That's my only guess.

You can do a quick check with file $(which ffmpeg).

In any case, I added a patch that sends a q to stdin, which is how ffmpeg asks to be terminated from recording. So maybe that's better than sending a kill signal to the process. Please give it another shot to see if it works.

You can install the latest code again with the same command you used to install:

luarocks install --server=http://luarocks.org/dev gifine
flamendless commented 7 years ago

I had the same problem. It is still recording after i pressed/clicked the stop recording. I just recently installed it on ubuntu 16.04