Page 1 of 1

Detect if media is streamiing

PostPosted: Thu Jan 03, 2013 3:17 pm
by vlowe
Hi,

I am wondering if it possible to check if serviio is streaming/playing media or if it is idle?

I am running on ubuntu and have a bash script which is scheduled to run every minute, it contains an rsync which occasionally transfers large files and IF streaming can cause the playback to suffer and jump.

I want to check if serviio is streaming something and if it is, don't run the rsync.

Thanks,

Vince

Re: Detect if media is streamiing

PostPosted: Thu Jan 03, 2013 4:54 pm
by zip
Not possible ATM

Re: Detect if media is streamiing

PostPosted: Fri Jan 04, 2013 1:11 pm
by vlowe
no worries, modified the script to check eth0 tx speed in kb/s, and only run sync if under 50kb/s

Re: Detect if media is streamiing

PostPosted: Fri Jan 04, 2013 5:27 pm
by r-win
I think using lsof -p <Serviio pid> would be a better way. If Serviio is streaming a file, it'll show up with lsof.

Something like:
  Code:
 
lsof $(ppid serviio)

should give you the info you need when running bash. Note: when he library is updated, files may show up here as well.

Re: Detect if media is streamiing

PostPosted: Fri Jan 04, 2013 5:43 pm
by vlowe
cheers.

would also be nice to be able to call a script once serviio starts to stream. So can stop rsync and some less important procceses to ensure an uninterrupted playback.

Re: Detect if media is streamiing

PostPosted: Fri Jan 04, 2013 5:45 pm
by r-win
I agree, with some arguments, so I can log the view on trakt.tv ;-)