Page 1 of 1

ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:10 pm
by JZO
The problem is the following:

I stream an MKV file to my Samsung TV which requires transcoding. In my Windows, a new background process ffmpeg.exe starts and makes a large temp file into the configured temp folder. Some minutes later I stop the playback and exit on the TV, but the transcoding ffmpeg.exe process is still active on my computer and reserves CPU and memory resources. The CPU load is about 30-40% per ffmpeg.exe process with an AMD Phenom X4 3GHz processor.

It could be useful, if an option would exist on the UI which specifies an inactivity-time than the transcoding process would terminate by the Serviio Console.

Currently I need to terminate the ffmpeg.exe process manually with the Windows Task Manager.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:15 pm
by will
Why do you need to termine the process?

If you start a new video from the same device, the old one will be killed.

By keeping the old one active, it allows you to resume a video and not have to re-transcode it.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:24 pm
by JZO
Hi,

If I do not want to start an other movie on my TV and I like to do something else on my computer, the active transcoding process is unnecessary anymore and slow down my computer as long as the transcoding ends. This may takes several minutes, depends on the size of the original content.
Furthermore I have not enough HDD storage to store large 3-4 Gb or more sized temp files. It is absolutely acceptable for me to re-transcoding the content all the time, when I start streaming.

This recommended UI option would be optional of course, but it could be very useful and increase the usability of this really great software.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:29 pm
by will
It shouldn't store lots of tmp files. I think it only stores the last one.

One problem is different devices request files in different chunks, serviio also cannot tell the difference between you stopping and pausing a film.

So for example you pause a film, then at what point should ffmpeg be killed? If it is killed and you then press resume, you will have to wait for ffmpeg to transcode the file upto the point you paused it.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:38 pm
by JZO
Yes, you are right. The pause problem exists in other DLNA Server products too. The applied solution something like this:

There are two options exist on the console UI:

- Terminate transcoding if device request another file
- Terminate transcoding, if the temporary file is not used during (here is a NumericUpDown input control) seconds.

You can enable or disable this options (with a checkbox per setting), so you can avoid the problem of the "pause". You can add a possibility to make decision by the user to control the behavior of the transcoding process. I think these are very useful and user friendly settings.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:46 pm
by will
There have been quite a few requests for this so maybe zip could include it in the next release. But it would be a use with caution option.

Could even have an end all ffmpeg processes now button in the console, that way it can be included in mobile apps and webuis, for those who really want to kill off ffmpeg.

Although I assume this will not be a priority for zip.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:50 pm
by JZO
It will be great! Thank you!

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:51 pm
by Cerberus
its wont be implemented as it breaks to much, if you really want to stop it you can manualy kill the ffmpeg process from the pc running serviio.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 3:52 pm
by will
JZO wrote:It's great! Thank you!


Its up to zip not me! I never said he would do it, just that there have been a lot of requests so maybe it could be looked at again.

Re: ffmpeg termination

PostPosted: Sun Jan 08, 2012 4:08 pm
by Cerberus
if you running under windows just do this

Option 1

1. download and extract the ffmpeg kill.bat from the attached ZIP file
2. Enjoy

kill ffmpeg.zip
(164 Bytes) Downloaded 1912 times


Option 2

1. create FFmpeg kill.bat
2. edit file with notepad.exe
3. add this code
  Code:
taskkill /im ffmpeg.exe

4. save bat file
5. enjoy

if running on linux just do this

1. From command prompt type
  Code:
kill -e -q ffmpeg

Re: ffmpeg termination

PostPosted: Sun May 10, 2015 2:13 pm
by bafu
I would love to see a feature to control the behavior of the transcoding process.
Do you think a future version of Serviio will support this?
JZO wrote:- Terminate transcoding, if the temporary file is not used during (here is a NumericUpDown input control) seconds.