FAQ  •  Register  •  Login

Data stream received for long time after stop command

<<

Citronel

Streaming enthusiast

Posts: 28

Joined: Fri Feb 03, 2012 10:28 pm

Post Fri Feb 03, 2012 11:05 pm

Data stream received for long time after stop command

Hello,

I am having this two problem with Serviio v0.6.2 & EGREAT EGR-R1:
I have DU Meter installed on PC to see my LAN connection transfer.

1) If I play video clips from online source ( stream ) after I stop the clip I see that data still coming to PC for long time.
This is disturbing because if I start to play another online clip/tv I am still receive data and it eat my whole internet download bandwidth ( which is limited on my ADSL ~600Kb )
To stop the data I have to kill fmpeg, sometime I can see 2-3 fmpeg running and receiving huge data that is not played/displayed.

2) I don't know if this is a bug on EGREAT EGR-R1 or serviio but sometime when play online TV I press stop, and stop sing appear on TV but media player get stuck there and I have to reboot it.

thank you
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Feb 04, 2012 12:13 am

Re: Data stream received for long time after stop command

can you enable detailed log, try to play online content and stop it... then wait for a minute and post the log (dont play or browse in the meantime to keep the log short and readable). The FFmpeg process should stop.

What is your OS?
<<

Citronel

Streaming enthusiast

Posts: 28

Joined: Fri Feb 03, 2012 10:28 pm

Post Sat Feb 04, 2012 12:25 am

Re: Data stream received for long time after stop command

OS is XP SP3.

will try this on day light and let you know I already lost 2 nights testing online streaming.

Thank you.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Feb 04, 2012 12:03 pm

Re: Data stream received for long time after stop command

I realized that it's expected behaviour. FFmpeg will run untill the whole file is downloaded even if you stop watching. It'll only stop FFmpeg in the case of live streams.
<<

Citronel

Streaming enthusiast

Posts: 28

Joined: Fri Feb 03, 2012 10:28 pm

Post Sat Feb 04, 2012 1:21 pm

Re: Data stream received for long time after stop command

Ok I understand that but I don't think it is normal, in browser if I close a connection ( stop play from a stream ) then data from that IP it is not received from server till the end of that clip and do not kill my bandwidth.

Any idea why sometime ServiioService.exe it switch from 4-10% CPU at normal stream play to 100% CPU after I quit play or media crash and even if nothing it is played, received and stay that way until I have to kill the service ?

Image Image

thank you
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Sat Feb 04, 2012 5:28 pm

Re: Data stream received for long time after stop command

The reason for this is serviio does not know if you just paused the file and are going to return and start watching again ( if that is the case it would have to start transcoding from begining again and you would have a massive wait period for it to start playing again ) or if you have stopped the file, But there is nothing really serviio can do about that unless the DLNA spec and the renderer makers, start sending some kind of signal to the dlna server to tell it what buttons have been pressed.

you could always create this bat file if you run on windows to kill ffmpeg manually, but thats up to you.

viewtopic.php?f=3&t=4696&p=32122&hilit=kill+ffmpeg#p32122
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

npuser

DLNA master

Posts: 172

Joined: Mon Feb 06, 2012 3:44 am

Location: Michigan

Post Mon Feb 27, 2012 6:36 pm

Re: Data stream received for long time after stop command

I am suffering from this issue as well. I am a trigger happy person and i change online streams too frequently but some reason serviio continue to send streams to renderers. I use 'return' button in the remote control more than 'stop' to return to previous screen or options. I am not sure that would make any different. The bad thing about this that i have noticed is, when the stream is in passive (not watching) but in active (still streaming) state the TV (Sony in this case) stays on standby mode rather than off. On the other hand, when this behavior creeps up the cpu utilization for the ServiioSerrvice itself stays at or around 70-80%, the cpu utilization criteria is meaningless but it is still a basic indicator for the usage.

Only way to stop this by restarting the serviio service. It appears when the redeners send an online stream to stop the serviioservice is not sending stop to ffmpeg to actually stop the stream. Any suggestion or idea?
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Mon Feb 27, 2012 6:48 pm

Re: Data stream received for long time after stop command

As has been explained before, when you press stop serviio will not stop ffmpeg as it doesn't know if you actually pressed stop or just pressed pause because devices do not tell serviio what has actually happened.

If you start a new video on the same renderer, then the previous ffmpeg process will be killed, and a new one started so by starting and stopping lots of steams you will only ever have being processed by ffmpeg at once.

There is a script posted above viewtopic.php?f=3&t=4696&p=32122&hilit=kill+ffmpeg#p32122 which you can use to stop ffmpeg if you want to.

As for the TV staying in standby rather than going off, that is a little odd and shouldn't be related to ffmpeg running as the tv requests the data and serviio either sends the file directly, or the trancodded file which ffmpeg produces, it shouldn't matter to the tv if ffmpeg is still running. Its also up to the tv to request the data, serviio doesn't force feed it the videos. Does it do that with local videos?
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Mon Feb 27, 2012 7:10 pm

Re: Data stream received for long time after stop command

I am suffering from this issue as well. I am a trigger happy person and i change online streams too frequently but some reason serviio continue to send streams to renderers. I use 'return' button in the remote control more than 'stop' to return to previous screen or options. I am not sure that would make any different.

The renderer never tells serviio what buttons has been pressed, so it cant know if you press STOP or actually press PAUSE and intend to return and carry on watching so if serviio stopped transcode job you would come back press play again and stream would drop/crash as the file would no longer be availible.

On the other hand, when this behavior creeps up the cpu utilization for the ServiioSerrvice itself stays at or around 70-80%, the cpu utilization criteria is meaningless but it is still a basic indicator for the usage.

Have you tried this http://wiki.serviio.org/doku.php?id=win_highresources as i have never seen my CPU get up to 70%+ for more than a few seconds, when i did some investiagtion i found these offending services and once turned off my cpu never goes about about 50% even when streaming to 2 TVs at same time.

The bad thing about this that i have noticed is, when the stream is in passive (not watching) but in active (still streaming) state the TV (Sony in this case) stays on standby mode rather than off.

Sorry that make no sense as an LCD/LED is never truely off (unless you pull the plug out) they just go into standby mode, so i dont see what u mean by this.
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

PMI

User avatar

DLNA master

Posts: 156

Joined: Tue Jan 03, 2012 3:32 am

Location: Milwaukee, Wisconsin

Post Mon Feb 27, 2012 10:26 pm

Re: Data stream received for long time after stop command

zip wrote:....FFmpeg will run until the whole file is downloaded even if you stop watching ...
That may be an issue for people with limited BW.

Say you start watching a video, and then stop to let another person use the TV. You decide to go to another set (or your PC, and continue watching... with no explanation, available BW is cut in half!
Peter
Beta Tester Group
Wiki | FAQ

Panasonic Viera TC-L32E3 LCD | Panasonic DMP-BDT210 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Mon Feb 27, 2012 10:57 pm

Re: Data stream received for long time after stop command

PMI wrote:
zip wrote:....FFmpeg will run until the whole file is downloaded even if you stop watching ...
That may be an issue for people with limited BW.

Say you start watching a video, and then stop to let another person use the TV. You decide to go to another set (or your PC, and continue watching... with no explanation, available BW is cut in half!


not really you can use the posted tool to terminate ffmpeg manually in those rare cases. TBH this is another dead topic as this function of serviio will not be changed as its deliberately done that way.
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Sat Mar 03, 2012 10:10 am

Re: Data stream received for long time after stop command

Hi,

This issue is really annoying, particularly when running Serviio on a NAS with limited resources, to access online content.
I ran several tests with my Bravia TV or Sony Bluray as renderers , and it seems ffmpeg process stays alive, even if I turn off renderers!

Aren't there any flow-control signals between renderer and server that would allow to build some logic to terminate ffmpeg when renderer stopped viewing that stream (or at least when switched off)?
I understand the pause/stop issue, but maybe if stream is paused for a certain time, then it could be considered as stopped...
Could process be suspended while renderer is paused?

Another question:
zip wrote:....FFmpeg will run until the whole file is downloaded even if you stop watching ...

I thought it was a stream/buffer: is file really downloaded/stored in full?
How does cleanup happen then?

Thanks!
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Mar 03, 2012 10:50 am

Re: Data stream received for long time after stop command

mpi wrote:I understand the pause/stop issue, but maybe if stream is paused for a certain time, then it could be considered as stopped...
Could process be suspended while renderer is paused?

That probably could be done, to stop the process after paused for some time, but it might still affect some people who really just paused the file. Not a priority ATM.

Another question:
zip wrote:....FFmpeg will run until the whole file is downloaded even if you stop watching ...

I thought it was a stream/buffer: is file really downloaded/stored in full?
How does cleanup happen then?

On Serviio stop/start all the files and on a new transcoding job for the same renderer it deletes the previous file.
<<

mpi

Serviio lover

Posts: 66

Joined: Fri Nov 18, 2011 9:15 pm

Post Sun Mar 04, 2012 5:38 pm

Re: Data stream received for long time after stop command

Hi Zip,

Thanks.
And how about stopping when render is switched-off (no longer responding)?

Best,
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Mar 04, 2012 6:05 pm

Re: Data stream received for long time after stop command

That doesnt work for all devices.
<<

npuser

DLNA master

Posts: 172

Joined: Mon Feb 06, 2012 3:44 am

Location: Michigan

Post Sun Mar 04, 2012 7:24 pm

Re: Data stream received for long time after stop command

I certainly understand why this not a priority ATM. Unless serviio maintains the ffmpeg service spun from a renderer with its corresponding ip address in its internal database as well as keep up with the changes as they occur, I would think it will be tough to kill the correct ffmpeg process. The timeout and kill option discussed above has huge potential to break the legit streams to other renderers, I am not sure that’s the way to go. I now understand the issue exists due to the shortcoming of DLNA specification itself than that of Serviio or any other DLNA products.

This issue is a non-issue when playing local movies, TV Shows or Music as they usually have fix time for the streams. But with addition of online streaming feature in serviio, this issue has a big potential to create a headache for lot of people with limited bandwidth, capped bandwidth plan, serviio server with limited resource etc.. I assume some the online streams could go days and days if the stream is not stop properly; maybe I am wrong on my assumption.

May I suggest an idea to see if can be implemented down the road to fix the issue? How about adding a check box to console to lets say “Show Stop” in video container. When this option is checked, the renderer will show “STOP” as pick in video or online container. When user select the “STOP”, the renderer then sends valid well formed ffmpeg arguments to play the invalid or non-existent video file which will cause the ffmpeg service to crash intentionally hence not sending data stream to the renderer. Approaching this issue from the renderer to instead of serviio server guarantees only ffmpeg spun by the given renderer gets killed other legit streams from other renderers stay intact.

Workaround:
I am no serviio expert or ffmpeg or dlna expert but it appears, the serviio by design adds only valid media into its database by reading “ffmpeg –i” outputs. Meaning, the stream has to be valid when you add it the console for this workaround to actually work.

The method Cerberus mentioned above works but it kills all legit streams as well. Here is how you can kill or let is stop the stream right from the renderer you are currently using.

1.Create a folder called “STOP” then add a 20 seconds video file (eg: STOP.avi) and a thumbnail called Stop.jpg to the folder. Next add this folder to serviio console and marked as “Video”. If or when you want to stop the ffmpeg service for this renderer, you simply go click “STOP” -> STOP.avi. A new ffmpeg process will kick in killing previous process and also this new process with stop as soon as it’s done streaming stop.avi (20 sec).

OR

2. Find a short youtube video, add it to serviio console per youtube single video wiki instruction, and name it “STOP”. If or when you want to stop the stream to a renderer, simply go to that folder and click play “STOP”. The ffmpeg stop the current stream and spun a new stream for the renderer for the length of the youtube video and stop.

OR

3.Find a temporary valid stream (veetle stream), add it to the console, name it “STOP”, and finally add a thumbnail for it (eg: STOP.jpg). Once the veetle stream becomes invalid use it to stop the ffmpeg process by intentionally invoking stream to play that does not exist which causes ffmpeg process to crash. And again doing so, it will only effect current renderer all other active renderers and its corresponding ffmpeg process stays intact.

NPuser
Attachments
Stop.JPG
Stop.JPG (31.83 KiB) Viewed 13250 times
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Mar 04, 2012 9:18 pm

Re: Data stream received for long time after stop command

live online streams do not store the file on filesystem, FFmpeg pushes the content through directly, to avoid unlimited file sizes on the drive. That means FFmpeg will start for each client watching the stream.
<<

npuser

DLNA master

Posts: 172

Joined: Mon Feb 06, 2012 3:44 am

Location: Michigan

Post Tue Mar 06, 2012 1:35 am

Re: Data stream received for long time after stop command

Exactly the point. The short video suggestion above is to spun a new ffmpeg process killing previous ffmpeg stream. I am no way implying that the stream gets downloaded and stored somewhere in the file system.

Here is a scenario:
You are watching sky movie hd in a tv then you decided to take a break. You simply turn the tv off and walk away. Just because you turn tv off does not mean the ffmpeg is not streaming, the ffmpeg is still still streaming data to the tv's original ip address. It just happens at the moment the tv is off. The ffmpeg process will continue to stream until either stream fails, timeout occurs somewhere, or someone turns tv back on and starts whole new stream. If there is no timeout or error with sky hd stream, and the serviio pc is continue to be up, the sky hd stream could go on forever. Now, nothing about the stream other than log is stored in server so running out of the space is not an issue but people with limited bandwidth or capped bw its whole new headach.

So people with limited bw or capped bw, they can try what I suggested above. Like i said it is the way ffmpeg works and has nothing to do with serviio. It may not work but it just a suggestion.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Mar 07, 2012 12:16 pm

Re: Data stream received for long time after stop command

If you're talking about live streams then it's taken care of. This type of playback has the trigger that kills ffmpeg if the tv stops retrieving the content (as you cannot pause a live stream it most likely means the tv's off).

For local files and online VOD content (ie files that have a given file size) FFmpeg runs until the whole file is transcoded.
<<

x2416x

Serviio newbie

Posts: 2

Joined: Wed Nov 14, 2012 6:04 pm

Post Wed Nov 14, 2012 8:04 pm

Re: Data stream received for long time after stop command

Hello,

I've also noticed this problem, and make a simple suggestion.

Is it possible to keep track of transcoding going on from a specific ip address and user agent. Once the ip address and user agent hit the browse page again, have it stop all ffmpeg processes?

I know of family members which will be watching a video and just close their browser. This of course happens on a multi-hour video file which then keeps the CPU pegged completely.

There's no way to tell if they've closed the browser or not, but they can be trained to hit the back button back to the file listing before closing the browser. This shouldn't affect skipping ahead or behind when that feature becomes available so long as someone doesn't go back to the files index.

Alternatively have the X that closes the flowplayer window kill off all ffmpeg processes spawned by that user.

Follow me?
Next

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 29 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.