First of all, hello plex community!
I'm totally new in developing a plex channel plugin, fortunately after doing some howtos I was able to make my first channel (which is shown in my PMS!) - thats the good part :-)
The bad part is as follows:
The reason why I'm developing this channel is, I'm using some kind of IP-TV and I want to get all the channels into the PMS. After some work I was able to reconfigure my NAS, so I'm now able to open the http media stream directly f.e. in VLC.
It's looking like that: http://192.168.1.1:5555/udp/233.252.12.54:5004 -> this is a full http stream of one channel
When I open the stream in VLC and save it and open the saved file again with MediaInfo I get the following information:
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 1.02 MiB
Duration                                 : 7s 944ms
Overall bit rate                         : 1 072 Kbps
Encoded date                             : UTC 2013-10-29 15:52:51
Tagged date                              : UTC 2013-10-29 15:52:51
Writing application                      : vlc 2.1.0 stream output
Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 7s 760ms
Source duration                          : 7s 800ms
Bit rate                                 : 945 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.091
Stream size                              : 896 KiB (86%)
Source stream size                       : 907 KiB (87%)
Language                                 : English
Encoded date                             : UTC 2013-10-29 15:52:51
Tagged date                              : UTC 2013-10-29 15:52:51
mdhd_Duration                            : 7760
Audio
ID                                       : 1
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 6B
Duration                                 : 7s 944ms
Source duration                          : 7s 970ms
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 124 KiB (12%)
Source stream size                       : 124 KiB (12%)
Language                                 : German
Encoded date                             : UTC 2013-10-29 15:52:51
Tagged date                              : UTC 2013-10-29 15:52:51
mdhd_Duration                            : 7944
I now tried to open this stream in plex (http://192.168.1.1:5555/udp/233.252.12.54:5004) like:
(this is the important part of my ServiceCode.pys - I guess...):
def MediaObjectsForURL(url):
    return [
        MediaObject(
                        #video_codec = VideoCodec.VP6,
                        video_codec = VideoCodec.H264,
			audio_codec = AudioCodec.AAC,
                        container = 'mp2ts',
			#container = 'mpgv',
			#container = 'mpga',
			audio_channels = 2,
			video_resolution = '720',
			#container = Container.MP4,
			optimized_for_streaming = True,
                        #parts = [PartObject(key=HTTPLiveStreamURL(Callback(PlayVideo, url = url)))]
			#parts = [PartObject(key=Callback(PlayVideo, url = url))]
			parts = [PartObject(key=url)]
		)
    ]
def PlayVideo(url):
#video_url = RE_VIDEO_URL.search(page).group(‘video_url’)
#return Redirect(BASE_URL + video_url)
return Redirect(‘http://192.168.1.1:5555/udp/233.252.12.54:5004’)
As you can see, I tried a lot of codecs containers, etc... unfortunately I always got the following errors or just a Warning:
Errors like:
"Cannot load M3U8: 404 not found"
MIME type wrong...
Or
just a warning like:
...
DEBUG (core:553) - Finished loading plug-in code
2013-10-30 13:51:29,379 (4000) :  DEBUG (runtime:640) - Adding a prefix handler for 'Myplugin' ('/video/myplugin')
2013-10-30 13:51:29,386 (4000) :  INFO (core:598) - Started plug-in
2013-10-30 13:51:29,387 (4000) :  DEBUG (socketinterface:144) - Starting socket server
2013-10-30 13:51:29,390 (4000) :  DEBUG (runtime:1107) - Created a thread named 'start'
2013-10-30 13:51:29,391 (4000) :  INFO (socketinterface:168) - Socket server started on port 55789
2013-10-30 13:51:29,391 (4000) :  INFO (pipeinterface:25) - Entering run loop
2013-10-30 13:51:29,392 (4000) :  DEBUG (runtime:717) - Handling request GET /:/prefixes
2013-10-30 13:51:29,400 (4000) :  DEBUG (runtime:814) - Found route matching /:/prefixes
2013-10-30 13:51:30,022 (2800a) :  DEBUG (services:362) - Loaded services
2013-10-30 13:51:30,032 (4000) :  DEBUG (runtime:914) - Response: [200] MediaContainer, 448 bytes
2013-10-30 13:51:30,046 (2c00b) :  DEBUG (services:438) - No shared code to load
2013-10-30 13:51:30,079 (3800a) :  DEBUG (runtime:717) - Handling request GET /video/myplugin
2013-10-30 13:51:30,082 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,087 (3800a) :  DEBUG (runtime:814) - Found route matching /video/myplugin
2013-10-30 13:51:30,090 (3800a) :  DEBUG (base:123) - Checking if com.plexapp.plugins.myplugin is broken
2013-10-30 13:51:30,092 (3800a) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU5VydmljATpZc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsTMoxCmxpc3QKMAsaMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjgKY29tLnBsZXhhcLKucGx1Z2lucy5ibGl6em5ldDFsMAppZGVudGlmaWVycjAK'
2013-10-30 13:51:30,116 (3800a) :  DEBUG (services:615) - Found a service matching 'http://192.168.1.1:5555/udp/233.252.12.54:5004' - Myplugin (com.plexapp.plugins.myplugin)
2013-10-30 13:51:30,118 (3800a) :  DEBUG (services:41) - Loading service code for Myplugin (URLServiceRecord)
2013-10-30 13:51:30,183 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,187 (3800a) :  DEBUG (services:41) - Loading service code for Fallback (URLServiceRecord)
2013-10-30 13:51:30,815 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,823 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,828 (3800a) :  DEBUG (services:615) - Found a service matching 'http://192.168.1.107:5555/udp/233.252.12.54:5004' - Myplugin (com.plexapp.plugins.myplugin)
2013-10-30 13:51:30,832 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,838 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,843 (3800a) :  DEBUG (services:615) - Found a service matching 'http://192.168.1.107:5555/udp/233.252.12.54:5004' - Myplugin (com.plexapp.plugins.myplugin)
2013-10-30 13:51:30,847 (3800a) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-10-30 13:51:30,852 (3800a) :  WARNING (objectkit:199) - Media part has no streams - attempting to synthesize
2013-10-30 13:51:30,858 (3800a) :  DEBUG (runtime:106) - Sending packed state data (109 bytes)
2013-10-30 13:51:30,859 (3800a) :  DEBUG (runtime:914) - Response: [200] MediaContainer, 1381 bytes
One time I was able to get the audiostream for about 5 seconds - but after restarting PMS it was gone?! :-(
Any help would be very appreciated :-)
Thanks guy and kr,
Martin