Page 1 of 1

Refresh on Demand plugin for linux?

PostPosted: Sun Jun 24, 2012 6:05 pm
by xs2inattar
I read through the refresh_on_demand wiki that allows refreshing of web resources from the client, but it seems like it is specifically for serviio windows installation.

Can anyone please let me know if it could be setup on linux installation of serviio.

Thanks.

Re: Refresh on Demand plugin for linux?

PostPosted: Sun Jun 24, 2012 7:48 pm
by jhb50
I know nothing about Linux, but I see no reason why equivalent prereqs as I described in the wiki could not be setup and made to work.

Re: Refresh on Demand plugin for linux?

PostPosted: Mon Jun 25, 2012 9:07 pm
by xs2inattar
Finally, got it working.

For people who might need it, below are the details.

I am using serviio on synology, so i used the spk provided by http://pcloadletter.co.uk/2012/01/25/se ... o-package/ to install the package.

The above package uses a ffmpeg-wrapper.sh file to implement the ac3 codec floating/fixed point thing for arm processor.

It also has serviio-wrapper.sh in place which has the ffmpeg location already set up.

So the only thing, I did to get Refresh on Demand working, was make the following changes to the ffmpeg-wrapper.sh file in /volume1/@appstore/Serviio/bin.

After the following code line in ffmpeg-wrapper.sh

  Code:
if [ ${INPUT} = 1 ]; then



Add the following:


  Code:
    #if the url is of the format 'rtsp://a1709.l1856953708.c18569.g.lm.akamaistream.net:554/D/1709/18569/vnnn/reflector:53708*'
    #extract VVAL from the url for Refresh-on-Demand (Refresh.groovy)
    VVAL="$PARAM"
    VVAL=`expr match "$VVAL" 'rtsp://a1709.l1856953708.c18569.g.lm.akamaistream.net:554/D/1709/18569/v\(.*\)/reflector:53708*'`
    if [[ ! -z "${VVAL}" ]]; then
      curl -X POST "http://localhost:23423/rest/action" -H "Content-Type: text/xml" -d "<action><name>forceOnlineResourceRefresh</name><parameter>${VVAL}</parameter></action>"
    fi



Make the above changes, not sure if serviio needs to be restarted or not, but do it any way and you should be all set.

Thanks.

Re: Refresh on Demand plugin for linux?

PostPosted: Mon Jun 25, 2012 9:35 pm
by jhb50
Cool. Why not add it to the wiki under linux with a pointer to my windows wiki? It will only get lost in the forum.

Re: Refresh on Demand plugin for linux?

PostPosted: Mon Jun 25, 2012 9:42 pm
by xs2inattar
Ok Will do that.

Re: Refresh on Demand plugin for linux?

PostPosted: Mon Jun 25, 2012 11:14 pm
by xs2inattar
Added to the wiki. Please take a look and let me know if it looks good.

http://wiki.serviio.org/doku.php?id=ref ... mand_linux

Re: Refresh on Demand plugin for linux?

PostPosted: Tue Jun 26, 2012 3:39 am
by jhb50
Looks good. Thanks.

Re: Refresh on Demand plugin for linux?

PostPosted: Fri Oct 05, 2012 2:03 pm
by ttguy
So I have been playing with the ffmpeg-wrapper.sh script that is posted on the Wiki in the link mentioned above. I am interested in it for puposes other than Refresh on Demand. I don't know if anyone else is using that script. But I found that it had quite a few issues.

I have made some corrections so that it runs for me. But I have not tested it with the whole Refresh on Demand set up.

I have posted it to the Wiki as ffmpeg-wrapperv2.zip
My changes are:
Make it a bash script instead of a sh script - so the [[ ]] extended test construct works
Fixed line feeds so they are Unix style not windows style
Fixed missing close quotes on the curl call (and added the closing </PARAMETER> tag
added [[ ]] to the test for =="-i"

Make it work if ffmpeg executable is not in the same folder as this script
To do this you set a FFmpegFOLDER variable to the location of your ffmpeg executable. If it resides in the same folder as
this ffmpeg-wrapper.sh then "." is valid

This is all just FYI stuff. Don't expect anyone to do any thing with this. Somone might find it useful. Or Not.