Idea: plugin to control playback on PS3MS via IR remote

Discuss issues related to PS3 Media Server development (only for programmers)

Idea: plugin to control playback on PS3MS via IR remote

Postby Kafka » Sun May 30, 2010 7:14 am

Assumptions

Please let me know if any of these are wrong

1. It is possible to alter playback position of a streamed file to PS3 outside of the PS3
2. This can be done solely by a custom plug-in and not altering the underlying out of the box code.


Problem attempting to solve:

Not able to fast forward, skip forward, rewind, skip back on certain types of files (MKV for example)

Possible solution

Directly access the process running the video. Initially my investigation has centered on mencoder, and using its seek command similar to this:

Code: Select all
PrintStream s = new PrintStream(process.getOutputStream());
String command = "seek +30 0\n";
s.print(command);
s.flush();


What I'm hoping this will do is move the playback 30 seconds forward, the PS3 will simply receive the stream 30 second from where it was. Am I out to lunch here?

Assuming I'm not (a big assumption) there are a number of difficulties:

Problem

No way for the custom code to know which process is streaming the video (i.e mencoder)

PMS.get().currentProcesses returns a list of Processes, but no way of knowing which process is which.

I put some debug code in ProcessWrapperImpl to print out the current number of processes and their array of command parms. This is what you get when you play a file:

Code: Select all
******* BEFORE STARTING PROCESS currentProcesses COUNT IS: 0
******* STARTING PROCESS WITH CmdArray of: 0:D:\Data\Eclipse\Workspaces\PS3_Media_server\PMS3\win32\ffmpeg.exe 1:-ss 2:1 3:-i 4:F:\PS3 Media Server\Modern Family Session 1\Modern Family S01E11 Up All Night.mkv 5:-an 6:-an 7:-s 8:320x180 9:-vframes 10:1 11:-f 12:image2 13:pipe:
******* AFTER STARTING PROCESS currentProcesses COUNT IS: 1
[New I/O server worker #1-2] TRACE 18:38:03.628 Starting transcode/remux of Modern Family S01E05 Coal Digger.mkv
******* BEFORE STARTING PROCESS currentProcesses COUNT IS: 0
******* STARTING PROCESS WITH CmdArray of: 0:D:\Data\Eclipse\Workspaces\PS3_Media_server\PMS3\win32\ffmpeg.exe 1:-vframes 2:1 3:-i 4:F:\PS3 Media Server\Modern Family Session 1\Modern Family S01E05 Coal Digger.mkv 5:-vcodec 6:copy 7:-f 8:h264 9:-vbsf 10:h264_mp4toannexb 11:-an 12:-y 13:pipe:
******* AFTER STARTING PROCESS currentProcesses COUNT IS: 1
******* BEFORE STARTING PROCESS currentProcesses COUNT IS: 0
******* STARTING PROCESS WITH CmdArray of: 0:D:\Data\Eclipse\Workspaces\PS3_Media_server\PMS3\win32\mencoder.exe 1:-ss 2:0 3:F:\PS3 Media Server\Modern Family Session 1\Modern Family S01E05 Coal Digger.mkv 4:-quiet 5:-quiet 6:-really-quiet 7:-msglevel 8:statusline=-1:mencoder=-1 9:-ovc 10:copy 11:-nosound 12:-mc 13:0 14:-noskip 15:-of 16:rawvideo 17:-o 18:\\.\pipe\1275183483707ffmpegvideo
******* AFTER STARTING PROCESS currentProcesses COUNT IS: 1
******* BEFORE STARTING PROCESS currentProcesses COUNT IS: 1
******* STARTING PROCESS WITH CmdArray of: 0:D:\Data\Eclipse\Workspaces\PS3_Media_server\PMS3\win32\mencoder.exe 1:-ss 2:0 3:F:\PS3 Media Server\Modern Family Session 1\Modern Family S01E05 Coal Digger.mkv 4:-quiet 5:-quiet 6:-really-quiet 7:-msglevel 8:statusline=-1:mencoder=-1 9:-channels 10:6 11:-ovc 12:copy 13:-of 14:rawaudio 15:-mc 16:0 17:-noskip 18:-oac 19:copy 20:-fafmttag 21:0x2000 22:-lavcopts 23:acodec=ac3:abitrate=384 24:-af 25:lavcresample=48000 26:-srate 27:48000 28:-aid 29:1 30:-o 31:\\.\pipe\1275183483707ffmpegaudio01
******* AFTER STARTING PROCESS currentProcesses COUNT IS: 2
******* BEFORE STARTING PROCESS currentProcesses COUNT IS: 2
******* STARTING PROCESS WITH CmdArray of: 0:D:\Data\Eclipse\Workspaces\PS3_Media_server\PMS3\win32\tsMuxeR.exe 1:C:\DOCUME~1\Kafka\LOCALS~1\Temp\javaps3media\pms-tsmuxer.meta 2:\\.\pipe\1275183483722tsmuxerout.ts
******* AFTER STARTING PROCESS currentProcesses COUNT IS: 3


Now I'd like to avoid hard coding the second process in the array (mencoder). So I need a way of finding that process.

Ideas I have

1. Alter the out of the box code to add some info about the processes. Do not want to do this as it makes the plug-in not really usable by others who don't want to alter the pms.jar
2. Use aspects (AspectJ for example) to "hook" the call to new ProcessBuilder(cmdArray)

If this is at all possible the last step would be to get an IR interface for the computer, set up a programmable remote (such as the Harmony) to send IR codes to the IR interface, monitor the IR interface for codes being sent, do whatever that code it set to do by interfacing with the PS3 Media server.

Thanks that idea. Whether its possible or not is another question.

Thoughts?
Kafka
 
Posts: 6
Joined: Fri May 21, 2010 6:23 pm

Re: Idea: plugin to control playback on PS3MS via IR remote

Postby meskibob » Sun May 30, 2010 1:48 pm

Just to clarify for others....
Rationale behind this (replicate Go To on programmable remote as FF/RW mechanism) - viewtopic.php?f=2&t=6764&start=0
I provide NO application support via PM or email, so please post your question to the forum per the Forum Rules.
meskibob
Moderator
 
Posts: 4760
Joined: Mon Jan 19, 2009 4:11 pm

Re: Idea: plugin to control playback on PS3MS via IR remote

Postby Kafka » Sun May 30, 2010 6:11 pm

Also to clarify .... I plan to program this myself. Just looking for some nudges in the right direction, if there are any. Specifically with regards to getting a handle on the mencoder from a plug-in.
Kafka
 
Posts: 6
Joined: Fri May 21, 2010 6:23 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 5 guests