XBMC Python Script (1 Viewer)

pmbsa

Portal Pro
September 27, 2004
60
0
Brilliant! Thanks very much!

Hi, I just installed the plugin quickly onto a couple old Xbox's and the latest linux build and it worked straight out of the box, absolutely brilliant stuff!

Cheers
Paul
 

dubbeld

Portal Member
February 1, 2007
14
7
Well I also got the latest SVN version of the TV-Server, but (like other users had noticed) the plugin isn't working.

It can't get the channelgroup/channels (ServerInterface.cs public bool setup()):
Code:
                RemoteControl.Instance.GetDatabaseConnectionString(out connStr, out provider);
            Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr);

                me = new User();
                me.IsAdmin = true;
                groups = ChannelGroup.ListAll();

                foreach (ChannelGroup group in groups)
                    Console.WriteLine(group.GroupName);

This won't return any group, connStr is set by GetDatabaseConn... but it can't select ChannelGroups. Does anyone knows a solution, since the SVN version is far more stable.

EDIT:
Ok got it working! Can someone compile it with the gentle.txt (rename it to Gentle.config and overwrite the current one in the SVN).

Now you can use the latest TV-Server (only channel switching isn't working here...).

Btw a question, how did you compile it, I only got a .exe, which is working, but that isn't a .dll, if I change .exe to .dll it is missing the Gentle.config file, so it isn't working... (you probably have to compile it with the .dll)

Btw2: If there is a developer who wants to cooperate to make this script working (and extend it)... I'm in...
 

Attachments

  • Gentle.txt
    30.6 KB

santa.clause

Portal Member
February 12, 2009
18
1
123
NorthPole
Home Country
dev info

Tested and not working TVServerXBMC.dll for your 1.0+SVN TVServer Plugin folder, built with gentle.config from dubbeld - thx man.
[Removed Attachement, see next post by dubbeld for working one]
However this will not make streams work with XBMC SVN revisions, as there is alot of stuff going on for 9.04.
I take care of that when it's released - atm you should stay at XBMC 8.10.
Next point should be some kinda recording control (I heard of myTV and 4tR for epg but I could mix things up on that one, see yourself) and then I'll focus on unified pvr.
 

dubbeld

Portal Member
February 1, 2007
14
7
This is what I got at the moment. It is working with the latest TVServer (updated the .dll files to the latest TVServer files, also updated the script (since it wasn't completely compatible with the latest dll files)).
http://derek.denhaas.info/tv.rar

- Copy TVServer to plugin/video of XBMC
- Run the plugin/TVServerXBMC.exe on the PC where the MP TV-Server is running.
- Disable the XBMCTVControl in your TVServer and reboot your PC!

It's working here...

If you will see all Live-TV and the channel listing, but XBMC is not able to stream this channel, then you have to use an earlier build... Found out that not all builds are working (like santa.clause told). Index of /xbmc the mt version is working for sure. Other builds are working succesfully on Win XP, but not on Vista.

I'll hope to have some spare time in the next 2 weeks to extend the functionality of this script, but I am not familiar with the XBMC functions (to create interfaces) besides the folder view (which the script is currently working with).

Btw... to show recordings must not be that hard...
Code:
Recording.ListAll

'or

Return Schedule.ListAll

and to record/delete a program: (was already trying that ;))
Code:
        Public Shared Function RecordProgramById(ByVal programid As Integer, ByVal rectype As Integer) As Boolean

            Try

                Dim layer As New TvBusinessLayer
                Dim program As Program = program.Retrieve(programid)
                Dim newSchedule As Schedule = New Schedule(program.IdChannel, program.Title, program.StartTime, program.EndTime)
                newSchedule.ScheduleType = rectype
                newSchedule.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value)
                newSchedule.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value)
                newSchedule.Quality = 73
                newSchedule.MaxAirings = 2147483647
                newSchedule.Persist()
                RemoteControl.Instance.OnNewSchedule()
                Return True
            Catch ex As Exception
                Return False
            End Try

        End Function
        Public Shared Function DeleteRecordingById(ByVal recordingid As Integer) As Boolean

            Try
                Dim layer As New TvBusinessLayer
                Dim recording As Recording = recording.Retrieve(recordingid)
                Dim recFile As String = recording.FileName

                If File.Exists(xmlFile) Then
                    File.Delete(xmlFile)
                End If

                recording.Delete()

                Return True
            Catch ex As Exception
                Return False
            End Try

        End Function

if you need any help, just let me know... (btw maybe nice to share the code... else we both create the same... got my own SVN server, so could host this project there if you like).
 

santa.clause

Portal Member
February 12, 2009
18
1
123
NorthPole
Home Country
nice, let's do it! :D

SourceForge.net Repository - [mp-plugins] Index of /trunk/plugins/XBMCServer

couldn't we just use that one? ;) however if you like to set up a server, just pm me the login info and I'll put my work up.
Tomorrow I look at the code you posted, let's see what we can achieve. Do you really think we should include an interface for recordings as we are always able to connect via smb? Yeah, extended Info but is this really worth writing one line of code?

Let's rock.

PS: Can you smell the workin EPG,recording stuff already? - I can, so tasty.... again big:D for your work!
 

dubbeld

Portal Member
February 1, 2007
14
7
couldn't we just use that one? ;)

We could, but we've to find the right person to get rights to their SVN, so I've created my own (see your PM for details). If there are other developers over here who want to join, just drop a PM.

I also think it's not useful to list the recordings, but it might be useful to list the scheduled recordings, so that you can delete/adjust these.

Btw, I will try to fix the current timeshifting function today, and have some spare time during the weekend, so I hope we can get the recording stuff working :) (Edit: fixed)

I'm adding some error handling. See listChannels.cs (in commands) how to send errors back to the client, which will show them on screen (better know what's wrong then get a "script error" message ;)).

Btw2, if you want to debug, you can telnet to the XBMCTVServer script on port 9596, makes it easy to debug (just press "telnet<enter>" if you are connected, and type help).

For people who are interested, you can find SVN logs (and later on also the source) on: http://thuis.denhaas.info/svn/projects/xbmc/
 

ShAddiX

Portal Member
June 24, 2007
32
2
Great guys!! Finally there is some movement for TV implementation for XBMC. Hope your plugin will work with the newer XBMX svns soon :)
 

dubbeld

Portal Member
February 1, 2007
14
7
Great guys!! Finally there is some movement for TV implementation for XBMC. Hope your plugin will work with the newer XBMX svns soon :)

The current rtsp implementation within XBMC sucks (probably not due to XBMC, but ffmpeg? the internal player of XBMC), therefore you can't stream TV, but the plugin is working correctly.
 

swifty

Portal Pro
January 6, 2006
205
10
Home Country
United Kingdom United Kingdom
The current rtsp implementation within XBMC sucks (probably not due to XBMC, but ffmpeg? the internal player of XBMC), therefore you can't stream TV, but the plugin is working correctly.

Nice to see some work on this, would be great to have a smooth reliable way of watching TV from within XBMC.

Since XBMC has just entered feature freeze for the impending 9.04 release, maybe we should make some noise over in the XBMC forums to see if the RTSP issues can be addressed in 9.04's bug bashing phase?
 

dubbeld

Portal Member
February 1, 2007
14
7
Nice to see some work on this, would be great to have a smooth reliable way of watching TV from within XBMC.

Since XBMC has just entered feature freeze for the impending 9.04 release, maybe we should make some noise over in the XBMC forums to see if the RTSP issues can be addressed in 9.04's bug bashing phase?

Don't know if you want to do this...
Code:
11:46:38 T:2796 M:2561904640  NOTICE: DVDPlayer: Opening: rtsp://192.168.2.129/stream1.0
11:46:38 T:2796 M:2561900544 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
11:46:38 T:3644 M:2561843200  NOTICE: Creating InputStream
11:46:38 T:3644 M:2561843200  NOTICE: Creating Demuxer
11:46:38 T:3644 M:2560020480   ERROR: CDVDPlayer::OpenDemuxStream - Exception thrown when opeing demuxer
11:46:38 T:3644 M:2560020480  NOTICE: CDVDPlayer::OnExit()
11:46:38 T:3644 M:2560020480  NOTICE: CDVDPlayer::OnExit() deleting input stream
11:46:38 T:2796 M:2560143360   ERROR: Can't open the database MyVideos34.db as it is a NEWER version than what we were expecting!
11:46:38 T:2796 M:2560143360  NOTICE: CDVDPlayer::CloseFile()
11:46:38 T:2796 M:2560143360 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
11:46:38 T:2796 M:2560143360  NOTICE: DVDPlayer: waiting for threads to exit
11:46:38 T:2796 M:2560143360  NOTICE: DVDPlayer: finished waiting
here is the error :) btw the stream is playable on vlc media player, so it should work.

Edit: And with debug:
Code:
13:56:06 T:4488 M:2392580096   DEBUG: CPlayerCoreFactory::GetPlayers(rtsp://192.168.2.129/stream1.0)
13:56:06 T:4488 M:2392580096   DEBUG: CPlayerCoreFactory::GetPlayers - Item is an internet stream, content-type=application/octet-stream
13:56:06 T:4488 M:2392580096   DEBUG: Alloc resources: 0.21ms (0.00 ms skin load, 0.15 ms preload)
13:56:07 T:4488 M:2392563712  NOTICE: DVDPlayer: Opening: rtsp://192.168.2.129/stream1.0
13:56:07 T:4488 M:2392563712 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
13:56:07 T:1020 M:2392535040   DEBUG: thread start, auto delete: 0
13:56:07 T:1020 M:2392530944  NOTICE: Creating InputStream
13:56:07 T:1020 M:2392530944    INFO: CDVDFactorySubtitle::GetSubtitles, searching subtitles
13:56:07 T:1020 M:2392530944   DEBUG: CUtil::CacheSubtitles: START
13:56:07 T:1020 M:2392526848    INFO: CDVDFactorySubtitle::GetSubtitles, searching subtitles done
13:56:07 T:1020 M:2392526848  NOTICE: Creating Demuxer
13:56:07 T:4964 M:2392436736   DEBUG: thread start, auto delete: 1
13:56:07 T:1020 M:2392420352   DEBUG: CDVDDemuxFFmpeg::Open - av_find_stream_info starting
13:56:07 T:1020 M:2391982080   ERROR: CDVDPlayer::OpenDemuxStream - Exception thrown when opeing demuxer
13:56:07 T:1020 M:2391982080  NOTICE: CDVDPlayer::OnExit()
13:56:07 T:1020 M:2391982080  NOTICE: CDVDPlayer::OnExit() deleting input stream
13:56:07 T:1020 M:2391982080   DEBUG: Playback was stopped

Btw Santa, you can now record shows by the RecordProgram:<program id> command. Also added ListSchedules, to see what you've scheduled and RemoveSchedule:<schedule id> to remove a scheduled recording. We only have to implement it to the gui. Also added listPrograms to list the programs of a channel.

Don't know if you ever made a GUI for XBMC, I didn't, do you have any suggestions on how to make the gui (since we now have all the functions to make it work).
 

Users who are viewing this thread

Top Bottom