Kodi Community Forum
WIP Stereoscopic 3D support for half/full SBS, over/under, etc - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: WIP Stereoscopic 3D support for half/full SBS, over/under, etc (/showthread.php?tid=147285)



RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - giaur - 2013-05-09

da-anda Wrote:exactly, no need to switch your TV into 3D mode, and it's done in GPU AFAIK. In OpenGL builds some "stipple" thing is used, but this feature is not available in Direct3D.
Very nice, I hope my gpu can do this (nvidia gt220). I've tried something similar with mplayer some time ago, but result was 1-2 fps and 100% cpu load, so unacceptable. And, can Raspberry PI do the same?

P.S.
Where can I checkout this branch from? Is there any tutorial/readme describing how 3D functionalities works?


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - popcornmix - 2013-05-09

(2013-05-09, 15:10)giaur Wrote: Very nice, I hope my gpu can do this (nvidia gt220). I've tried something similar with mplayer some time ago, but result was 1-2 fps and 100% cpu load, so unacceptable. And, can Raspberry PI do the same?
Raspberry Pi can put TV into 3D SBS or TAB mode. It already does this when the filename matches and TV indicates 3D support.
Would be nice to get Pi using this 3D branch, although it will be less efficient that the current (hacky) scheme.
(Currently the Pi renders UI once, and then duplicates it. This branch will render the UI twice).


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - giaur - 2013-05-09

Quote:Raspberry Pi can put TV into 3D SBS or TAB mode. It already does this when the filename matches and TV indicates 3D support.
Hey people, please - it's broken. The movie is displayed incorrectly - entire picture at top part of the screen with black bottom part (in case over under movie).

Nobody can confirm this issue? Really? This is official main branch, so maybe should I report this as a bug?


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - plesken - 2013-05-10

@giaur - what kind of sbs or ou you used? If full resolution SBS (3840x1080), or OU (1920x2160) then raspberrypi doesn't play it correctly.
Popcornmix didn't write it's working with "half resolution" SBS (1920x1080) and OU (1920x1080).

@popcornmix - do you have a plan to add "full resolutions" SBS and OU handle to omxplayer? I suggest to show bino code and implement most functionality (switch display between anaglyph/sbs/ou etc..)Smile


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - giaur - 2013-05-10

(2013-05-10, 16:18)plesken Wrote: what kind of sbs or ou you used? If full resolution SBS (3840x1080), or OU (1920x2160) then raspberrypi doesn't play it correctly.

Half over under, 1920x1080.

(2013-05-10, 16:18)plesken Wrote: Popcornmix didn't write it's working with "half resolution" SBS (1920x1080) and OU (1920x1080).
So... full over under/side by side not supported by PI, now you're saying 1920x1080 are not supported too. So, what kind of movies are supported? It seems all of this is suitable only for watching xbmc gui in 3D mode - very nice, but I rather preffer to watch some movies Wink


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - popcornmix - 2013-05-10

The Pi currently supports half-SBS and half-TAB (i.e. resolutions up to 1920x1080).
You need to have "Adjust display refresh rate to match video" and your display need to report 3D support through its edid (check with tvservice -m CEA).

Technically the Pi's video hardware is only designed for 1080p30, but that is for the theoretical worst case streams, and for typical streams it can run a lot faster.
It also overclocks quite well, so decoding [email protected] is not completely impossible.
I believe that vdec3 can handle MVC, but last time I checked it wasn't being used by any customers, and so fixing problems wasn't a priority, and it wasn't quite plumbed in fully.

But 1080p half-SBS/half-TAB does work now.


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - giaur - 2013-05-10

I have no idea. What am I doing wrong? My TV switches automatically into 3D mode but movie is displayed incorrectly. After I switch off 3D mode on my tv, I can see entire movie is displayed at top part. Displaying movie should be untouched - only gui should be splitted.

I belive you when you're saying it works. But, as you can see for me it doesn't work. Do you have any idea what am I doing wrong?? I don't know if this makes any different, but I need to set 1920x540 (because I'm using 3D mkvs written on bluray discs, so I can't change their names to htab).

I'm not sure what do you mean by "Adjust display refresh rate to match video", where is this option? Maybe this is the reason?


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - aptalca - 2013-05-11

for half 3D, the only thing that's important on the player's side is the refresh rate.

That is because the player doesn't even need to know if it's outputting 3D or not. As far as the player is concerned, it is a regular 1080p or 720p stream.

The display on the other hand, has to be able to convert the sbs or tab frame into a 3D sequential mode to display it properly. Now the only tricky part is, not all 3D displays will accept all 3D formats at all resolution and frame rates.

For instance, most 3D projectors will process over-under (or tab) at 1080p24 and 720p60, and sbs at 1080i60 or 720p60. If you try to feed 1080p60, the display simply won't accept it and the 3D option will be greyed out. If you try to output sbs at 1080p24, it will treat it as tab and it won't be displayed properly. If you display tab or sbs at 720p60, it will force you to select tab or sbs, you get the idea. (Now, on your tv, things may be different)

"Adjust display refresh rate to match video" is an option in xbmc settings and it allows you to output at 24p (as long as the video is encoded in 24p)

So if you're trying to display 3d-TAB, just check that option so you output 1080p24, and on your display, you *might* also have to select top-and-bottom or over-under in 3D settings


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - baijuxavior - 2013-05-15

(2013-05-08, 19:07)da-anda Wrote: guys, use branch from elupus and you don't need that addon. In his branch, XBMC uses the MKV meta tag info to detect the 3D mode of the movie and if that fails extracts it from the filename. GUI is switched to correct 3D mode automatically. Also you can convert a SBS movie f.e. to TAB, anaglyph (currently only on linux, windows doesn't work) etc. And if you have a passive 3D TV and happen to run a linux XBMC you can also switch to 3D interlaced mode so that you don't have to do the extra switch on your TV (AFAIK work is being done for windows, but it's a lot more complicated with Direct3D - hail to OpenGL). The only thing missing is a 3D on/off toggle/cAction + overall improvements and fixes for Windows and the rPI.

I compiled this elupus version and it is great. I have a couple of questions:

1. I tried names like 3DSBS, SBS, HSBS as in 'Avatar.3DSBS.mkv', 'Avatar 3DSBS.mkv', 'Avatar HSBS.mkv', but auto switching of GUI is not working. What is the correct naming convention for this to work?

2. Is there any option to start xbmc in normal view mode (stereoscopy off) instead of the last used stereoscopic mode?

3. Any option to turn off stereoscopic mode when I stop the movie?

Edit - I use Windows platform.

TIA.


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - da-anda - 2013-05-15

1) auto switch is not working yet - I was wrong about that, sorry. I'm working on a PR that implements this (modes: ask if 3D detected, auto-switch 3D, convert 2D)
2) what do you mean? On startup?
3) no, not yet, as the auto switch is not yet there. As said, I'm working on it.


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - baijuxavior - 2013-05-15

^^ Thanks. I edited the elupus source code and with the help of 'script.custom.3dmodexbmc-master' by jaaps I'm now able to autostwitch gui on playback and stop. Also it will start xbmc in normal mode even if you close xbmc in stereoscopic mode. The trick is to call xbmc.executebuiltin("Action(3dmodeoff)") when xbmc starts using autoexec.py. I want to add this also to the script.custom.3dmodexbmc-master in the init section, but it is showing error.

The script.custom.3dmodexbmc-master I'm using is

Code:
import xbmc,re

class MyPlayer(xbmc.Player) :
    def _init_ (self):
        xbmc.Player._init_(self)

    def onPlayBackStarted(self):
        if xbmc.Player().isPlayingVideo():
            currentPlayingFile = xbmc.Player().getPlayingFile()
            if re.search(r'3D Movies', currentPlayingFile, re.I):
                if re.search(r'3D.OU', currentPlayingFile, re.I):
                    xbmc.sleep(500)
                    response = xbmc.executebuiltin("Action(3dmodetab)")
                
                if re.search(r'3D.SBS', currentPlayingFile, re.I):
                    xbmc.sleep(500)
                    response = xbmc.executebuiltin("Action(3dmodesbs)")
                    
    def onPlayBackEnded(self):
        response = xbmc.executebuiltin("Action(3dmodeoff)")

    def onPlayBackStopped(self):
        response = xbmc.executebuiltin("Action(3dmodeoff)")

player=MyPlayer()
while(1):
        xbmc.sleep(500)

I want to remove the line ' if re.search(r'3D Movies', currentPlayingFile, re.I): ' but it throws an error if I remove it. Can you suggest what is wrong with it? The movies should be in a folder containing '3D Movies' if using this line which I don't want.

Thanks.


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - TeKo - 2013-05-15

Should work like that.

Code:
class MyPlayer(xbmc.Player):
    def _init_ (self):
        xbmc.Player._init_(self)

    def onPlayBackStarted(self):
        if xbmc.Player().isPlayingVideo():
            currentPlayingFile = xbmc.Player().getPlayingFile()
            if re.search(r'3D.OU', currentPlayingFile, re.I):
                xbmc.sleep(500)
                response = xbmc.executebuiltin("Action(3dmodetab)")
                
            if re.search(r'3D.SBS', currentPlayingFile, re.I):
                xbmc.sleep(500)
                response = xbmc.executebuiltin("Action(3dmodesbs)")
                    
    def onPlayBackEnded(self):
        response = xbmc.executebuiltin("Action(3dmodeoff)")

    def onPlayBackStopped(self):
        response = xbmc.executebuiltin("Action(3dmodeoff)")

player=MyPlayer()
while(1):
        xbmc.sleep(500)



RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - baijuxavior - 2013-05-16

^^ Thanks, but it is not working. XBMC shows 'Script Failed: 3D Mode XBMC switch' on startup. Can you test this addon?

https://github.com/jaaps/script.custom.3dmodexbmc


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - giaur - 2013-05-16

Hello,

Sorry for offtopic, but where can I download it from? I've searched in this thread but I can't find any link.


RE: [PATCH]3D Subtitles for half/full SBS and over/under ( - baijuxavior - 2013-05-16

(2013-05-16, 09:22)giaur Wrote: Hello,

Sorry for offtopic, but where can I download it from? I've searched in this thread but I can't find any link.

The version I'm using? I used elupus 3d and made necessary changes to get the gui autoswitching. I am trying to compile it with the latest xbmc master as mp3 audio is not working in the elupus version. It was broken in the nightly. If you want I can give the necessary changes to make gui autoswitching to work.