Plugin requests - please have a look

Discuss third-party additions, plugins and translations for PS3 Media Server

Plugin requests - please have a look

Postby squadjot » Sun Mar 25, 2012 5:32 pm

Hi

I love PMS, but i miss some functionality that i thoguht could be done with a couple of plugins wich i think could benefit everyone.
So, for one..i would like opinions on if it's possible to do via a plugin, and next, would anyone care to contribute time in develop it?
I have some programming skills, but never messed with java. I have no clue on how to start building a plugin.

1. Play AVS files - Plugin
- Plugin that let you play .avs files for obvious reasons.
I don't know for what reason this is not already possible, but there's so many things you could do (make your own structure, chapters, even mix sequences, with having to duplicate or alter the video files) Edit: I know AviSynth is not preferred, also got some limits..but still.

2. Simple Active/Inactive Event CMDline interface - plugin
- Plugin that calls execute commandline to your OS when ever PMS is active/inactive)
Reason: In order to gain performance, and save bandwidth, I'd like that my server shuts of certain services while streaming movies.
Instead of having a script that parses the PMS log file to see if PMS is active/inactive, maybe PMS could "execute/call" shell script that
would, in my case, shut off the services i want to stop .. . When PMS goes inactive, it calls another shell script that activates these services again.
It does not even have to be very dynamic, PMS should simply just execute "active.bat" when active..and "inactive.bat" when inactive.
It's possible that adding arguments could enhance further use (ie pass the movie filename as arg, to do...??..i dont know, but could turn useful)
Last, I know a plugin was made to call _one_ commandline, my request is quite different.

3. General CMDline interface - plugin
Why not let PMS excute shell/bat files? , you'd be able to control pretty much everything on your computer from your remote.

--

1. i'd like opinions on how "hard" it would be to make it.. possible even?
2. Would anyone care to look into it?
3. As user, can you also see the benefits from such plugins?

Thanks
Last edited by squadjot on Sun Mar 25, 2012 6:49 pm, edited 1 time in total.
User avatar
squadjot
 
Posts: 243
Joined: Thu Mar 25, 2010 10:03 pm

Re: Plugin requests - please have a look

Postby infidel » Sun Mar 25, 2012 6:41 pm

squadjot wrote:3. General CMDline interface - plugin
Why not let PMS excute shell/bat files? , you'd be able to control pretty much everything on your computer from your remote.


You can do this with jumpy, for instance to run mycommand.bat create a python wrapper (mycommand.py) inside plugins/jumpy like so:

Code: Select all
import sys, os, jumpy

if len(sys.argv) == 1:
   # initial call, add a 'mycommand' folder under 'Jumpy' and exit
   pms.addItem(PMS_FOLDER, "mycommand", [sys.argv[0], "mycommand"], "")

elif sys.argv[1] == "mycommand":
   # user clicked on our 'mycommand' folder, run mycommand.bat
   exit_code = os.system("c:\\somewhere\\mycommand.bat")

   # and report the exit code as the label of a fake video item
   label = "mycommand.bat returned %d" % exit_code
   pms.addItem(PMS_VIDEO, label, "fake.mpg", "")


This a minimal example, you could expand the same python script to have a 'myUtils' folder with multiple scripts/batch files inside.

EDIT: path needs double backslash '\\' in os.system() call
Last edited by infidel on Sun Mar 25, 2012 8:07 pm, edited 2 times in total.
infidel
 
Posts: 278
Joined: Sun Aug 15, 2010 4:56 pm

Re: Plugin requests - please have a look

Postby squadjot » Sun Mar 25, 2012 6:47 pm

@ infidel - sweet, i'll try that!
User avatar
squadjot
 
Posts: 243
Joined: Thu Mar 25, 2010 10:03 pm

Re: Plugin requests - please have a look

Postby el.botijo » Sun Mar 25, 2012 7:02 pm

Hi, squadjot,
I have not touched PS3MediaServer for a while, but let me give you my comments anyhow. Be aware that I might be wrong, though. Things have surely moved on since I last had a look at the code.

1) AVS files
As far as I know, AVS are AVISynth files, that is, script files for non linear video editing. The only solution I see is if PMS does transcoding on the fly. I suppose that AVISynth could feed that decoded stream into mencoder without much hassle ( http://avisynth.org/mediawiki/FAQ_frameserving ). I did not have a look at how PS3MediaServer works with media files, so I cannot tell you how difficult this task is. Anyhow, AVISynth only works in Windows, as far as I can see from their website.

2) Simple Active/Inactive Event CMDline interface - plugin
As you said, somebody created a "shutdown" plugin some time ago, where a single command was executed (was that really me?). The thing about plugins is when they are executed. It looks like the most promising one for you is StartStopListener.
https://github.com/ps3mediaserver/ps3me ... tener.java
What this prototype shows is that some code can be run when the server starts serving a file and when it stops serving that file. It still does not say anything about media server doing grunt work (so it will not play well with more than one client if you are not aware of them), but this one is worth looking at. The biggest worry I have is that some media renderers might stop if these functions take too much time.
Other types of plugins can be found at:
https://github.com/ps3mediaserver/ps3me ... s/external

3) General CMDline interface - plugin
I am against anything that involves typing on a TV remote (by the time you finish typing, you could have gone to the computer and do whatever you wanted). As you do not want that, I can see how the "shutdown" command could be easily expanded with a configuration window inside PMS.

If I look into the details of your request, I can see that coding (2) and (3) should not be too much trouble, at least compared to (1). Writting plugins is just a matter of class inheritance, typical of any Object Oriented Program like Java. Learning Java isn't complex either. However, I wonder how easy is it to create the plugins nowadays, as you might need to download the complete source code.

The biggest trouble you can face with (2) and (3) is user privileges. As far as I know, you need to be an admin in order to start and stop services in both Windows and GNU/Linux (I have not much experience with MacOsX). UAC in Windows might require physical access to your computer. But that is probably one discussion that is not really focused on PMS.

You also ask if I can see any benefit on implementing these. Well, I have been working without AVISynth for some time now. And at that time, it was used for DVD encoding tasks only. As for the extra commands, when I am in my couch, the last thing I want to do is to run any extra batch program in my computer. My media files are in such a format that my UPNP-AV server does not need to transcode anything for my "smart" TV, so I do not see any need to fine-tune my computer to be more efficient. TSMuxer has been a better friend than transcoding, and that does not need a lot of power.

As I have said at the beginning, I am not working in PMS at all. I do not even have PMS installed in my computer anymore. Java is not too hard to work with. However, the biggest risk I see is in installing Eclipse (or whatever JavaIDE you want), download PMS and compile it. And I say risk because there are so many options and so many new things that you might step out.

Regards.
el.botijo
 
Posts: 50
Joined: Thu Feb 04, 2010 9:14 pm

Re: Plugin requests - please have a look

Postby chocolateboy » Sun Mar 25, 2012 7:13 pm

el.botijo wrote:The biggest worry I have is that some media renderers might stop if these functions take too much time.


They won't.
chocolateboy
Project Member
 
Posts: 2579
Joined: Wed Sep 16, 2009 10:05 am

Re: Plugin requests - please have a look

Postby squadjot » Sun Mar 25, 2012 7:44 pm

@el.botijo - Thanks for reviewing my request and giving a thorough comment! - much apreciated!
el.botijo wrote:I am against anything that involves typing on a TV remote (by the time you finish typing, you could have gone to the computer and do whatever you wanted)

Oh, kind of agree! - But in mycase, my server is in the basement (cool + safe from theft) ,and what i meant was basically what infidel gave a solution for. ( havent tested it yet )

--

About playing AVS files, i actually thought mencoder/player was able to play these out the box.. i seem to be wrong.

--

About Startstop Event, i guess from what you say about the existing StartStopListner, based on that - it's possible, quite doable?

Again, i have NO insight in PMS code whatsoever, but as i see it, all it would require is that PMS calls active.bat/inactive.bat ( just in PMS root folder or something ) - I mean..that would be pretty great functionality right there! =)

Edit: Maybe iy could just be a single shell/bat-file called with argument
Code: Select all
Status.bat <status> <filepath> <playheadtime>
User avatar
squadjot
 
Posts: 243
Joined: Thu Mar 25, 2010 10:03 pm

Re: Plugin requests - please have a look

Postby -m- » Wed May 23, 2012 12:49 am

i'm very happy and appreciative of all the hard work you guys put into this server. the only thing i feel it is lacking is a graphic equalizer for tweaking the sound for different types of files. i'm unsure of if this is even possible, but it would be awesome if it is.
-m-
 
Posts: 50
Joined: Wed Aug 03, 2011 10:50 pm


Return to Additions and Plugins

Who is online

Users browsing this forum: No registered users and 5 guests