Kodi Community Forum
[RELEASE] Cinema Experience - the new Home Theater Experience Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Cinema Experience - the new Home Theater Experience Script (/showthread.php?tid=87563)



RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - dezblack - 2014-04-15

I am on a gotham nightly


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-04-15

(2014-04-15, 18:34)dezblack Wrote: I am on a gotham nightly

Then you can add the following to the home_automation.py file(that exists in your userdata/addon_data/script.cinema.experience folder)

insert after line 15:
Code:
if sys.version_info < (2, 7):
    import simplejson
else:
    import json as simplejson

_3d_mode_query           = '''{"jsonrpc": "2.0", "method": "Settings.GetSettingValue",  "params": { "setting": "videoscreen.stereoscopicmode" }, "id": 1}'''

_3d_modes = [ "none",                  
              "over_under",            
              "side_by_side",          
              "anaglyph_cyan_red",      
              "anaglyph_green_magenta",
              "interlaced",      
              "hardware",      
              "mono_2d",
              "",
              "",
              "",
              "",              
            ]

Then replace the movie trigger with:

Code:
elif trigger == "Movie" and ha_settings[ "ha_movie" ]:
            utils.broadcastUDP( "<b>CE_Automate<li>movie_start</b>" )
            xbmc.sleep(250)
            result = xbmc.executeJSONRPC( _3d_mode_query )
            _3d_mode = 'mono'
            json = simplejson.loads( result)
            if json.has_key('result'):
                if json[ 'result' ].has_key( 'value' ):
                    _3d_mode = _3d_modes[ int( json[ 'result' ][ 'value' ] ) ]
                    utils.broadcastUDP( "<b>CE_Automate<li>3D_Mode_Event<%s></b>" % _3d_mode )

You are then able to create events based on the actual screen format. Eventghost will see "CE_Automate<li>3D_Mode_Event<xxxx>" with 'xxxx' representing the stereoscopic mode of XBMC's video screen. You may need to add some more delay before the query, as XBMC may need some time to switch modes, xbmc.sleep(250) provides 250ms of delay, playing around with this time(in milliseconds) will allow you to fine tune the delay.

None of this is tested, though I took most of the code from my personal 3D Mode broadcaster - https://github.com/Giftie/service.3dmode_broadcaster. I use this to switch my TV through my control system


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - revned - 2014-04-15

(2014-04-15, 18:25)giftie Wrote:
(2014-04-15, 10:22)revned Wrote: Is it possible to let the script play a random movie from the library?

Since the removal of HTTP-API from XBMC(now going on 2 years) there is no direct method of randomly choosing a movie to play. A script can be created that can poll XBMC for all of the Movie ID's then randomly choose an ID. Then it can call the script with the ID.

Thanks for your answer. Unfortunately I have no idea how to do this Sad


Re: RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - dezblack - 2014-04-16

(2014-04-15, 18:57)giftie Wrote:
(2014-04-15, 18:34)dezblack Wrote: I am on a gotham nightly

Then you can add the following to the home_automation.py file(that exists in your userdata/addon_data/script.cinema.experience folder)

insert after line 15:
Code:
if sys.version_info < (2, 7):
    import simplejson
else:
    import json as simplejson

_3d_mode_query           = '''{"jsonrpc": "2.0", "method": "Settings.GetSettingValue",  "params": { "setting": "videoscreen.stereoscopicmode" }, "id": 1}'''

_3d_modes = [ "none",                  
              "over_under",            
              "side_by_side",          
              "anaglyph_cyan_red",      
              "anaglyph_green_magenta",
              "interlaced",      
              "hardware",      
              "mono_2d",
              "",
              "",
              "",
              "",              
            ]

Then replace the movie trigger with:

Code:
elif trigger == "Movie" and ha_settings[ "ha_movie" ]:
            utils.broadcastUDP( "<b>CE_Automate<li>movie_start</b>" )
            xbmc.sleep(250)
            result = xbmc.executeJSONRPC( _3d_mode_query )
            _3d_mode = 'mono'
            json = simplejson.loads( result)
            if json.has_key('result'):
                if json[ 'result' ].has_key( 'value' ):
                    _3d_mode = _3d_modes[ int( json[ 'result' ][ 'value' ] ) ]
                    utils.broadcastUDP( "<b>CE_Automate<li>3D_Mode_Event<%s></b>" % _3d_mode )

You are then able to create events based on the actual screen format. Eventghost will see "CE_Automate<li>3D_Mode_Event<xxxx>" with 'xxxx' representing the stereoscopic mode of XBMC's video screen. You may need to add some more delay before the query, as XBMC may need some time to switch modes, xbmc.sleep(250) provides 250ms of delay, playing around with this time(in milliseconds) will allow you to fine tune the delay.

None of this is tested, though I took most of the code from my personal 3D Mode broadcaster - https://github.com/Giftie/service.3dmode_broadcaster. I use this to switch my TV through my control system

Perfect, thank you! Now I need to figure out why my 3d sbs movies have the right eye blacked out when using CE. they work fine when just playing without CE.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - Mungo - 2014-04-16

(2014-04-15, 01:33)Mungo Wrote:
(2014-04-14, 19:49)giftie Wrote: Require a full debug log

Will change the path again, recreate and grab that tonight. Smile

Cheers,

Mungo

Apologies for the lateness - I was out last night for B-day celebrations.

It's weird, and unfortunate - but changing my folder name back to "intro's" to try and reproduce this issue didn't really work. For some reason, it now appears to play all files successfully, where before it didn't - even after going through the gui and putting all the path's back in multiple times. In having said that - the log does still show (for one path at least) the issue I had described, on line 989:

http://xbmclogs.com/show.php?id=174960

This path was also what was visible in the GUI (but again, isn't now, when I'm trying to reproduce the issue)

Hopefully it's of some help. Otherwise, I'll just try and refrain from using special characters in my paths.

Cheers,

Mungo


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - inv3ntor - 2014-04-17

Hey guys, running latest stable xbmc12.3, aeon nox skin, windows 7 32bit.

Just started using cinema experience yesterday, so far i have everything running fine except the Trailers dont play (and therefore coming attractions intro/outro)

Everything else fires off as it should, Theatre intro, feature intro, rating video, audio video, feature outro, intermission, theatre outro. I dont use the trivia options and dont really plan to.

I think the reason maybe instead of streaming them, im tying to play them from a local folder. I have it set to "2 trailers", Trailer Scraper: "local folder", and pointed it to the folder i have named "Trailer Scraper" in the cinema experience>videos folder, im using the folder structure shown on the wiki..but it does not show anything for a trailer folder so i just used something logical. (threw it in videos folder, named it what the settings screen calls it "Trailer Scraper" as thats basically true for the rest)

I have deselected the 3 limit options underneath. The trailers themselves are .mp4 files with random names.

Is there something specific i need to do, or will it simply not play 2 random trailer files from that folder for me? I can think of a workaround but would be nice to get it to work. (workaround would be replace theatre intro folder with contents on feature intro folder, then dump trailers in feature intro folder..of course then i no longer get to see my original theatre intro videos..but it was just the red curtain opening)


Re: RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-04-17

(2014-04-17, 13:22)inv3ntor Wrote: Hey guys, running latest stable xbmc12.3, aeon nox skin, windows 7 32bit.

Just started using cinema experience yesterday, so far i have everything running fine except the Trailers dont play (and therefore coming attractions intro/outro)

Everything else fires off as it should, Theatre intro, feature intro, rating video, audio video, feature outro, intermission, theatre outro. I dont use the trivia options and dont really plan to.

I think the reason maybe instead of streaming them, im tying to play them from a local folder. I have it set to "2 trailers", Trailer Scraper: "local folder", and pointed it to the folder i have named "Trailer Scraper" in the cinema experience>videos folder, im using the folder structure shown on the wiki..but it does not show anything for a trailer folder so i just used something logical. (threw it in videos folder, named it what the settings screen calls it "Trailer Scraper" as thats basically true for the rest)

I have deselected the 3 limit options underneath. The trailers themselves are .mp4 files with random names.

Is there something specific i need to do, or will it simply not play 2 random trailer files from that folder for me? I can think of a workaround but would be nice to get it to work. (workaround would be replace theatre intro folder with contents on feature intro folder, then dump trailers in feature intro folder..of course then i no longer get to see my original theatre intro videos..but it was just the red curtain opening)

Do the base name of the file end with -trailer?


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - inv3ntor - 2014-04-17

Thanks mate, that fixed it!


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - DasFa - 2014-04-18

Is there support for DTS-HD HR and Dolby Digital+? If yes wich foldernames do i need?


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-04-18

(2014-04-18, 20:40)DasFa Wrote: Is there support for DTS-HD HR and Dolby Digital+? If yes wich foldernames do i need?

DTSHD-HR is supported already, the folder name is "DTS-HR"

Dolby Digital Plus support needs to be added.. The folder name will be 'Dolby Digital Plus'


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - DasFa - 2014-04-19

(2014-04-18, 22:24)giftie Wrote:
(2014-04-18, 20:40)DasFa Wrote: Is there support for DTS-HD HR and Dolby Digital+? If yes wich foldernames do i need?

DTSHD-HR is supported already, the folder name is "DTS-HR"

Dolby Digital Plus support needs to be added.. The folder name will be 'Dolby Digital Plus'

Thank you


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - rmilyard - 2014-04-19

(2014-04-18, 22:24)giftie Wrote:
(2014-04-18, 20:40)DasFa Wrote: Is there support for DTS-HD HR and Dolby Digital+? If yes wich foldernames do i need?

DTSHD-HR is supported already, the folder name is "DTS-HR"

Dolby Digital Plus support needs to be added.. The folder name will be 'Dolby Digital Plus'

giftie where does it figure out the sound from? File name or something else?


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-04-19

(2014-04-19, 04:25)rmilyard Wrote:
(2014-04-18, 22:24)giftie Wrote:
(2014-04-18, 20:40)DasFa Wrote: Is there support for DTS-HD HR and Dolby Digital+? If yes wich foldernames do i need?

DTSHD-HR is supported already, the folder name is "DTS-HR"

Dolby Digital Plus support needs to be added.. The folder name will be 'Dolby Digital Plus'

giftie where does it figure out the sound from? File name or something else?

The script uses the stream details stored in the database. These details are only in the database if your .nfo file has the details or the movie has been played once already(a couple of seconds)


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - rmilyard - 2014-04-19

(2014-04-19, 05:10)giftie Wrote:
(2014-04-19, 04:25)rmilyard Wrote:
(2014-04-18, 22:24)giftie Wrote: DTSHD-HR is supported already, the folder name is "DTS-HR"

Dolby Digital Plus support needs to be added.. The folder name will be 'Dolby Digital Plus'

giftie where does it figure out the sound from? File name or something else?

The script uses the stream details stored in the database. These details are only in the database if your .nfo file has the details or the movie has been played once already(a couple of seconds)

Been wondering. Seems all my bd .iso files don't detect it. My files are named like The Hangover.iso etc.


RE: [RELEASE] Cinema Experience - the new Home Theater Experience Script - giftie - 2014-04-19

(2014-04-19, 05:18)rmilyard Wrote:
(2014-04-19, 05:10)giftie Wrote:
(2014-04-19, 04:25)rmilyard Wrote: giftie where does it figure out the sound from? File name or something else?

The script uses the stream details stored in the database. These details are only in the database if your .nfo file has the details or the movie has been played once already(a couple of seconds)

Been wondering. Seems all my bd .iso files don't detect it. My files are named like The Hangover.iso etc.

If they haven't be watched, XBMC won't report them correctly(not to the script, or skins)