[Beta - Update 2013/08/09] MP3D - Render 3D videos via MediaPortal! | Page 20

Discussion in 'MediaPortal 1 Plugins' started by ScRePt, August 14, 2010.

  1. LikeHoo

    LikeHoo Portal Member

    Joined:
    August 22, 2011
    Messages:
    10
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Germany Germany
    AW: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Right, I installed it for v.1.2 Beta
    Now I uninstalled it as you wrote and installed the other version, but it doesn't even show up in the plugins list in MP-config??

    Maybe the reason therefore is because the 1.2beta version of the plugin was deactivated, while i uninstalled it?? How can i make it show up again?


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. freeman_blat

    freeman_blat New Member

    Joined:
    August 9, 2007
    Messages:
    3
    Likes Received:
    1
    Ratings:
    +1 / 0
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Try to install it by the MP Extension installer (Go to Options and there is Install local extension button). It should work.
     
    • Like Like x 1
  4. LikeHoo

    LikeHoo Portal Member

    Joined:
    August 22, 2011
    Messages:
    10
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Germany Germany
    AW: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    I enabled it manually in MediaPortal.xml now it showed up again, ...and it WORKS :D

    Thanks:)
     
  5. MaxMan23
    • Premium Supporter

    MaxMan23 MP Donator

    Joined:
    September 8, 2007
    Messages:
    380
    Likes Received:
    36
    Ratings:
    +45 / 0
    Home Country:
    Germany Germany
    AW: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Hi,

    can you look at this Link. Here is an source code for programming a filter for 3D vision:
    Video with NVidia 3D Vision - CodeProject

    HRESULT CTransform::Transform( IMediaSample *pMediaSample, AM_MEDIA_TYPE* media_type, LPDIRECT3DDEVICE9 direct_3D_device )
    {
    if (
    pMediaSample==NULL || media_type==NULL || direct_3D_device == NULL
    )
    {
    return E_POINTER;
    }
    AM_MEDIA_TYPE* pType = media_type;
    VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER *) pType->pbFormat;
    BYTE *pData; // Pointer to the actual image buffer
    long lDataLen; // Holds length of any given sample
    RGBTRIPLE *prgb; // Holds a pointer to the current pixel

    pMediaSample->GetPointer(&pData);
    lDataLen = pMediaSample->GetSize();
    // Get the image properties from the BITMAPINFOHEADER

    int iPixelSize = pvi->bmiHeader.biBitCount / 8;
    int cxImage = pvi->bmiHeader.biWidth;
    int cyImage = pvi->bmiHeader.biHeight;
    int cbImage = cyImage * cxImage * iPixelSize;
    int numPixels = cxImage * cyImage;
    iPixelSize = pvi->bmiHeader.biBitCount / 8;
    cxImage = pvi->bmiHeader.biWidth;
    cyImage = pvi->bmiHeader.biHeight;
    cbImage = cyImage * cxImage * iPixelSize;
    numPixels = cxImage * cyImage;

    prgb = (RGBTRIPLE*) pData;
    int pixels_shift = 2*cxImage/100;
    REFERENCE_TIME rtStart, rtEnd;
    pMediaSample->GetTime(&rtStart, &rtEnd);
    {
    if(buffers_size!=cxImage*cyImage)
    {
    buffers_size = cxImage*cyImage;
    delete []member_cash_buffer;
    delete []member_buffer;
    delete []local_member_buffer_1;
    delete []local_member_buffer_2;
    delete []local_member_entered_buffer;
    member_cash_buffer = new RGBTRIPLE[buffers_size];
    member_buffer = new RGBTRIPLE[buffers_size];
    local_member_buffer_1 = new RGBTRIPLE[buffers_size];
    local_member_buffer_2 = new RGBTRIPLE[buffers_size];
    local_member_entered_buffer = new RGBTRIPLE[buffers_size];
    member_valid_cash = 0;
    }
    }


    #define RGB_BYTE_ORDER(r, g ,b) ((DWORD) (((BYTE) (b) | ((WORD) (g) << 8)) | (((DWORD) (BYTE) (r)) << 16)))
    HRESULT local_handle_result = S_OK;
    {
    IDirect3DSurface9* gImageSrcLeft = NULL; // Left Source image surface in video memory
    IDirect3DSurface9* gImageSrcRight = NULL; // Right Source image Surface in video memory

    {
    local_handle_result = direct_3D_device->CreateOffscreenPlainSurface(
    cxImage-pixels_shift, // Stereo width is twice the source width
    cyImage, // Stereo height add one raw to encode signature
    D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, // Surface is in video memory
    &gImageSrcLeft, NULL);
    if(local_handle_result!=S_OK)
    {
    return local_handle_result;
    }
    local_handle_result = direct_3D_device->CreateOffscreenPlainSurface(
    cxImage-pixels_shift, // Stereo width is twice the source width
    cyImage, // Stereo height add one raw to encode signature
    D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, // Surface is in video memory
    &gImageSrcRight, NULL);
    if(local_handle_result!=S_OK)
    {
    gImageSrcLeft->Release();
    return local_handle_result;
    }
    {
    DWORD *local_bit_map_buffer;
    local_bit_map_buffer = new DWORD[(cxImage-pixels_shift)*cyImage];

    for(int local_counter_width=pixels_shift;local_counter_width<cxImage;local_counter_width++)
    {
    for(int local_counter_height=0;local_counter_height<cyImage;local_counter_height++)
    {
    int local_couter = local_counter_width+local_counter_height*cxImage;
    int local_bit_map_couter = local_counter_width-pixels_shift+(cyImage-(local_counter_height+1))*(cxImage-pixels_shift);
    local_bit_map_buffer[local_bit_map_couter] = RGB_BYTE_ORDER(prgb[local_couter].rgbtRed,prgb[local_couter].rgbtGreen,prgb[local_couter].rgbtBlue);
    }
    }

    HBITMAP handle_bit_map = NULL;

    handle_bit_map = CreateBitmap(
    cxImage-pixels_shift,
    cyImage,
    1,
    32,
    local_bit_map_buffer);

    delete []local_bit_map_buffer;

    HRESULT local_handle_result;



    HDC hdc;
    gImageSrcLeft->GetDC(&hdc);

    HDC hdc_compatible = CreateCompatibleDC(hdc);

    SelectObject(hdc_compatible,handle_bit_map);
    BitBlt(hdc, 0 ,0 ,cxImage-pixels_shift , cyImage , hdc_compatible, 0, 0, SRCCOPY);
    gImageSrcLeft->ReleaseDC(hdc);
    DeleteDC(hdc_compatible);

    bool local_result = DeleteObject(handle_bit_map);
    }

    {
    DWORD *local_bit_map_buffer;
    local_bit_map_buffer = new DWORD[(cxImage-pixels_shift)*cyImage];

    for(int local_counter_width=0;local_counter_width<cxImage-pixels_shift;local_counter_width++)
    {
    for(int local_counter_height=0;local_counter_height<cyImage;local_counter_height++)
    {
    int local_couter = local_counter_width+local_counter_height*cxImage;
    int local_bit_map_couter = local_counter_width+(cyImage-(local_counter_height+1))*(cxImage-pixels_shift);
    local_bit_map_buffer[local_bit_map_couter] = RGB_BYTE_ORDER(prgb[local_couter].rgbtRed,prgb[local_couter].rgbtGreen,prgb[local_couter].rgbtBlue);
    }
    }

    HBITMAP handle_bit_map = NULL;

    handle_bit_map = CreateBitmap(
    cxImage-pixels_shift,
    cyImage,
    1,
    32,
    local_bit_map_buffer);

    delete []local_bit_map_buffer;

    HRESULT local_handle_result;



    HDC hdc;
    gImageSrcRight->GetDC(&hdc);

    HDC hdc_compatible = CreateCompatibleDC(hdc);

    SelectObject(hdc_compatible,handle_bit_map);
    BitBlt(hdc, 0 ,0 ,cxImage-pixels_shift , cyImage , hdc_compatible, 0, 0, SRCCOPY);
    gImageSrcRight->ReleaseDC(hdc);
    DeleteDC(hdc_compatible);

    bool local_result = DeleteObject(handle_bit_map);
    }

    int gImageWidth= cxImage-pixels_shift; // Source image width
    int gImageHeight= cyImage;// Source image height

    IDirect3DSurface9* gImageSrc= NULL; // Source stereo image beeing created

    local_handle_result = direct_3D_device->CreateOffscreenPlainSurface(
    gImageWidth* 2, // Stereo width is twice the source width
    gImageHeight+ 1, // Stereo height add one raw to encode signature
    D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, // Surface is in video memory
    &gImageSrc, NULL);
    if(local_handle_result!=S_OK)
    {
    gImageSrcLeft->Release();
    gImageSrcRight->Release();
    return local_handle_result;
    }
    // Blit left srcimage to left side of stereo
    RECT srcRect= { 0, 0, gImageWidth, gImageHeight};
    RECT dstRect= { 0, 0, gImageWidth, gImageHeight};
    direct_3D_device->StretchRect(gImageSrcLeft, &srcRect, gImageSrc, &dstRect, D3DTEXF_LINEAR);
    // Blit right srcimage to right side of stereo
    RECT srcRect2= { 0, 0, 2*gImageWidth, gImageHeight+1};
    RECT dstRect2= {gImageWidth, 0, 2*gImageWidth, gImageHeight};
    direct_3D_device->StretchRect(gImageSrcRight, &srcRect, gImageSrc, &dstRect2, D3DTEXF_LINEAR);

    // Stereo Blitdefines
    #define NVSTEREO_IMAGE_SIGNATURE 0x4433564e //NV3D
    typedef struct _Nv_Stereo_Image_Header
    {
    unsigned int dwSignature;
    unsigned int dwWidth;
    unsigned int dwHeight;
    unsigned int dwBPP;
    unsigned int dwFlags;
    } NVSTEREOIMAGEHEADER, *LPNVSTEREOIMAGEHEADER;
    // ORedflags in the dwFlagsfielsof the _Nv_Stereo_Image_Headerstructure above
    #define SIH_SWAP_EYES 0x00000001
    #define SIH_SCALE_TO_FIT 0x00000002

    // Lock the stereo image
    D3DLOCKED_RECT lr;
    gImageSrc->LockRect(&lr,NULL,0);
    // write stereo signature in the last raw of the stereo image
    LPNVSTEREOIMAGEHEADER pSIH=
    (LPNVSTEREOIMAGEHEADER)(((unsigned char *) lr.pBits) + (lr.Pitch* gImageHeight));
    // Update the signature header values
    pSIH->dwSignature= NVSTEREO_IMAGE_SIGNATURE;
    pSIH->dwBPP= 32;
    pSIH->dwFlags= SIH_SWAP_EYES; // Src image has left on left and right on right
    pSIH->dwWidth= gImageWidth*2;
    pSIH->dwHeight= gImageHeight;
    // Unlock surface
    gImageSrc->UnlockRect();


    D3DVIEWPORT9 local_view_port;
    direct_3D_device->GetViewport(&local_view_port);
    RECT local_view_port_rect = {0,0,local_view_port.Width,local_view_port.Height};

    {
    gImageSrcLeft->Release();
    gImageSrcRight->Release();
    }
    {
    direct_3D_device->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB (0, 0, 0), 0.0f, 0);
    direct_3D_device->BeginScene ();

    IDirect3DSurface9* pDestSurface;
    direct_3D_device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pDestSurface);

    if(pDestSurface)
    {
    direct_3D_device->StretchRect(gImageSrc, &srcRect2, pDestSurface, &local_view_port_rect, D3DTEXF_LINEAR);
    }

    direct_3D_device->EndScene ();
    // direct_3D_device->Present (NULL, NULL, NULL, NULL);

    if(pDestSurface)
    {
    pDestSurface->Release();
    }

    if(gImageSrc)
    {
    gImageSrc->Release();
    }
    }
    }
    }
    return S_OK;
    }



    Mayby someone can help us for using 3d vision
     
  6. grandalf

    grandalf Portal Pro

    Joined:
    January 26, 2007
    Messages:
    83
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Is there any way of installing this 0n 1.2RC, or is it a case of going back to beta, install and then upgrade again. Would appreciate any help with this.
     
  7. grandalf

    grandalf Portal Pro

    Joined:
    January 26, 2007
    Messages:
    83
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Just did a clean install of 1.2.0 RC and it appears to play 3d files ok, mkvs bd rips etc, looks great on my LG Cinema TV. Not really sure what this plugin will help with. Fot the moment somewhat baffled.
     
  8. snakeman65

    snakeman65 Portal Pro

    Joined:
    January 21, 2007
    Messages:
    68
    Likes Received:
    6
    Occupation:
    Web Developer
    Location:
    Aylesbury
    Ratings:
    +6 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Finally, a media centre program which is potentially able to handle 3D the way I want!

    I have an LG passive 3d tv and while I can use the 3d button on the tv to make any sbs content 3d, the way it works (takes each side of the screen and interlaces them) always causes the gui to be split between each eye! With this plugin my hope is that I can output the video in row interlaced (which is the native 3d format of these tvs) and not have to use the 3d button at all. Unfortunately this is where my problems start.

    When I choose the relevant options in the plugin (source sbs, output row interlaced) the video is output in a small image in the middle of the screen. It looks like it is interlaced correctly but unfortunately, something must be resizing the video as the 3d doesn't work (which means that either the lines are in the wrong place or being blurred together). I can use the media portal settings to stretch the video to fullscreen but the 3d still doesn't work. The same settings in the stereoscopic player work just fine so it must be MP doing something to the output.

    This is a brand new clean install with only this plugin installed and no other settings changed at all. Is there any way to stop media portal affecting the output?

    Thanks

    Chris
     
  9. ScRePt

    ScRePt Portal Pro

    Joined:
    August 2, 2010
    Messages:
    170
    Likes Received:
    48
    Location:
    Athens
    Ratings:
    +49 / 0
    Home Country:
    Greece Greece
    Show System Specs
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Well, make sure you comply to the following:
    - Your video is not a crappy xvid of 340x280 for example
    - Your Windows resolution is @ 1080 or 720
    - Your MP stretch settings are NOT "original"

    Also:
    - Did you try ALL the other stretch options and none worked?
    - Does it work when the output mode is SBS ?? (I mean the stretching to fullscreen)
    - Did you try with an other codec ?

    I never experienced something like that, so do some tests and report back. Screenshots of the SBS or the Interlaced outputs could also help
     
  10. snakeman65

    snakeman65 Portal Pro

    Joined:
    January 21, 2007
    Messages:
    68
    Likes Received:
    6
    Occupation:
    Web Developer
    Location:
    Aylesbury
    Ratings:
    +6 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Wow that was fast! I'm at work now so i'll do some experimentation when I get home though I can answer a few of them already:

    Nope, Its a 1080p 3D Rip of avatar i'm using for testing
    Check! Running at 1080p

    Everything else i'll have a play with when I get home.

     
  11. grandalf

    grandalf Portal Pro

    Joined:
    January 26, 2007
    Messages:
    83
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: [Beta - Update 2011/04/30] MP3D - Render 3D videos via MediaPortal!

    Snakeman65,

    Looks like I have the same TV as you. Certainly I did not know it would accept interlaced 3d without manual switching. It is a bit of a pain having to switch back to 2d (twice?) just to read the menus. Looks like this plugin should be really useful after all. I will give it a try when the final 1.2 mepo is out. Love to know how you get on with it. As an aside, anyone thinking of a new 3d set give these or any of the other passives a look, For me, I cannot tell the difference in resolution when comparing active/passive side by side, apart from the active goggles are darker. No active specs headaches for me anymore I am pleased to say.

    Mike
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!