Jump to content


Photo

VLC PLayer and Plex


  • Please log in to reply
2 replies to this topic

#1 WurtzelSepp

WurtzelSepp

    Member

  • Members
  • PipPip
  • 13 posts

Posted 30 July 2012 - 03:05 PM

Hi I want to playback my videofiles on a vlc player served by a plex media server running on a windows machine.

So i d like to get a resizable videoplayer working with plex but i dont get it...

if i try to open the mediaserver with the windows media player it cant diplay folders or any movie and on vlc i can see the server in the playlist menue but cant open it to add a single movie oer anything else. My serverversion is 0.9.6.5

if annybondy can help me pls answer tx ... (if anyone can tell me how i get apis and how to fetch media mybe we can start making a vlc plugin)

#2 Baa

Baa

    Plex Star

  • Members
  • PipPipPipPipPipPip
  • 2733 posts

Posted 30 July 2012 - 04:45 PM

Not sure if this helps...
a couple of month ago I tried to understand a little more about the internals of Plex, especially the communication between the Server and the clients. In the end I came up with a small application to
- dig through the (remote) library
- ask VLC to replay the file.
It worked for the basic stuff, but misses some core features like...
- defining the clients capabilities (to start a transcoder session)
- replaying transcoded or streamed files thats PMS sends in chunks.
Anyway, I added the main C file for your reference, it basically outlines the idea behind it. If you want I also can share the secondary helper functions to bring it to live. Have a look and check back if you need more :-)

/*
 *  main.c
 *  LilPlex
 *
 *  Created by Baa on 9/12/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "help_Bonjour.h"
#include "help_HTTP_XML.h"
#include "help_PMS.h"



int main(int argc, const char * argv[])
{
	/*
	 * look up Plex Media Server on Bonjour...
	 */
	printf("*** look up PMS\n");

	char* IPAddr;
	int IPPort;
	Bonjour_FindPMS(&IPAddr, &IPPort);

	/*
	 Result:
	 HTTPAddr: 192.168.178.20
	 HTTPPort: 32400
	 */

	/* 
	 * request "http://<PMSadr>
	 */

	int choice;

	char* HTTPAddr = NULL;
	HTTP_BuildAddr(&HTTPAddr, IPAddr, IPPort, "/");
	
	char* HTTPResponse = NULL;
	struct Menu_T* Menu;
	
	do
	{
		printf("*** HTTP request\n");
		
		HTTP_Request(&HTTPResponse, HTTPAddr);
	
		/*
		 Result:
		 <MediaContainer size="15" friendlyName="baas-imac.fritz.box" machineIdentifier="8c47f270d8fd11e08ba764d8f5c34de07f9c950c" platform="MacOSX" transcoderActiveVideoSessions="0" transcoderVideoBitrates="64,96,208,320,720,1500,2000,3000,4000,8000,10000,12000,20000" transcoderVideoQualities="0,1,2,3,4,5,6,7,8,9,10,11,12" transcoderVideoResolutions="128,128,160,240,320,480,768,720,720,1080,1080,1080,1080" version="0.9.3.4-397e914">
		 <Directory count="1" key="accounts" title="accounts"/>
		 <Directory count="1" key="applications" title="applications"/>
		 <Directory count="1" key="channels" title="channels"/>
		 [...]
		 </MediaContainer>
		 */
		
		/*
		 * receive XML and decode. display "folders"
		 */
		
		printf("*** decode XML\n");
		
		XML_Decode(&Menu, HTTPResponse);  // Menu[256]
		
		/*
		 Result:
		 Menu[0].key = "accounts"
		 Menu[0].title = "accounts"
		 Menu[0]...
		 Menu[0].IsDir = 1 // Directory
		 */
		
		/*
		 * receive user input: move up/down in folder hirachy
		 */
		
		printf("*** Menu and Selection\n");
		
		PMS_ShowMenu(Menu);
		PMS_Selection(&HTTPAddr, IPAddr, IPPort, Menu);

		/*
		 if Dir loop to HTTP request
		   system/plugins/all/...
		   video/abc
		   library/sections/
		 if video file call video player
		   library/parts/12466/file.avi
		 */
	}
	while(Menu[choice].IsDir==1);
		
	/*
	 * call video player
	 * VLC/Safari/Quicktime: open Network/URL - http://192.168.178.20:32400/library/parts/12466/file.avi
	 */
	/*
	 '/video/:/transcode/segmented/start.m3u8?identifier=com.plexapp.plugins.library&offset=0&quality=5&url=http%3A%2F%2F127.0.0.1%3A32400${video}&3g=0&httpCookies=&userAgent=';
	 */
	printf("*** call video player\n");
		
	printf("PLAY FILE: %s\n", HTTPAddr);
	
	char cmd[5000];
	strcpy(cmd, "/Applications/VLC.app/Contents/MacOS/VLC ");
	strcat(cmd, HTTPAddr);
	strcat(cmd, " &");

	free(HTTPAddr);
	free(HTTPResponse);
	//free(Menu);
	
	system(cmd);
	free(Menu);
	return(0);
}

Plex @ aTV - think different: PlexConnect

-> the missing link between Plex Media Server and your AppleTV - 2 or 3, jailbroken or not.

plex forums: [PlexConnect] -- github: [latest Sources], [Wiki] -- donations (paypal): [US-$][EUR]


#3 falco

falco

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 31 December 2012 - 01:28 PM

Hello buddys,

could you tell me where I can get the includes header files?

thanks,
Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users