RenderCapture support for omxplayer
#1
Raspberry PI is gaining popularity as a platform for running XBMC. All the video playing is offloaded to the Broadcom GPU via XBMCs omxplayer code. The problem is that RenderCapture is not compatible and only captures black frames when running on the raspberry pi. The good news is that a bunch of smart guys produced a patch for the XBMC's omxplayer that splits the video pipe and sends a resized screen frame to a boblight server (a lighting control daemon). Now, this code is too specialized and will not be pulled into XBMC for the right reasons, but the question still is: can this code be used to fix RenderCapture and make it work on a raspberry pi?
Reply
#2
PR: "Too invasive a change compared to the handful of people it benefits."

I don't get it. Is "the handful of people it benefits" referring to something else than the RPi regarding to how many units that have been sold so far??
1. XBMC: http://github.com/FlyingRat/xbmc (ffmpeg-head-inc-xbmc-patches)
2. FFmpeg: http://github.com/FlyingRat/FFmpeg (ffmpeg-head-with-xbmc-custom-patches)
3. XBMC-updated-FFmpeg-binaries (just dev snapshots, no regular distros)
Reply
#3
(2013-05-03, 17:31)flyingrat Wrote: I don't get it. Is "the handful of people it benefits" referring to something else than the RPi regarding to how many units that have been sold so far??
It's referring to the hard-coded link between the omxplayer and the boblight daemon. Not many folks use boblightd, so putting it into the core of XBMC would not help many. Putting the code into the RenderCapture makes it work with the whole add-on framework. That expands it to any and all add-ons, including the boblight add-on . The boblight add-on currently does not work on RPi, because of the non-working RenderCapture.
Reply
#4
Is there a plan to incorporate the fix to RenderCapture so that it will work on the RPi?
Could someone please explain the required change or where I could read about it so I can implement it myself?
Reply
#5
Someone needs to implement this interface for rbpi (like rendercapturegl or rendercapturedx)

https://github.com/xbmc/xbmc/blob/master...rCapture.h
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#6
Could you please elaborate.
I would first like to create a standalone app that will capture the frames directly from the hardware accelerator.
Do you know if this is possible and how?
I looked at the hello_video.c example but it seems that this code decodes the video stream from the file itself not by capturing frames from GPU.

Am I wrong?
Any help would be highly appreciated!
Reply
#7
I have noe clue how to access the rendered video frame on the rbpi. I only can tell you which interface needs to be implemented for making the boblight addon working Wink
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#8
(2013-06-04, 11:27)Memphiz Wrote: I have noe clue how to access the rendered video frame on the rbpi. I only can tell you which interface needs to be implemented for making the boblight addon working Wink

Since I got the rendering covered I'll need your help with the interface stuff.
I have no clue as to how XBMC will be compiled when needs to run on RPi and how the addon will get the pixel information (which defines what I have to implement in the interface...)
So please elaborate here or if you prefer a chat session or by email what I need to do with regard to the addon and I have the rendering covered and working...
Reply
#9
I think I figured out the addon (and what parts of the interface are needed)...
What do I define to make sure that my rendercapture interface is compiled when compiling for RPi?
Reply
#10
if defined(TARGET_RASPBERRY_PI)

if you mean that?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#11
I have implemented my code into the RenderCapture interface and it works with the boblight addon.
I'm now facing a problem with interval change of LED colors.
There is a huge delay in the color change.
Placed some debug code to see the calls to the different functions in the RenderCapture interface and I see this sequence of calls: BeginRender --> GetBuffer --> GetBuffer --> EndRender.
I implemented my code as was implemented for GL/GLES, meaning:
BeginRender - only creates the buffer for the frame (Which essentially after the first call does nothing basically...)
GetBuffer - Also does nothing except for returning the prefilled buffer (The is literally on a return statement there...)
EndRender - This is where the magic happens, here I take the snapshot and save it into the buffer. I also have to swap between Red and Blue because DispmanX only supports RGB.

This last point brings me to my next point that I think that the boblight addon should call getImageFormat and take that into consideration. This is a fairly simple change to implement...

Memphiz - Has this addon been used on other systems and worked well? I am really confused as to why I get this sequence of function calls... I even tried moving the actual rendering into the GetBuffer function but nothing has changed...
Reply
#12
Well first - thx for taking the time for doing it right :o). Great that you got the basis to work. I can tell that the Addon was used on iOS, OSX, Windows and linux so far (where on iOS the GPU pipeline stalls during readpixels so its only usable on SD content most of the time and leads to slight stutter).

About the double call to GetBuffer i can't tell much. I try to involve the developer who did the rendercapture interface.

The delay in color change could also be the fact of slow speed in the addon configuration (i bet you already increased the speed - but i wanted to bring this up as a cause just for beeing safe Wink ).

Where to place the rendering is not clear to me. Imo it would be logical to add it to BeginRender and fetch the buffer in GetBuffer - EndRender wouldn't do anything then. But as you already tried to move the actual render code around without change i doubt it would help.

Lets see if bobo1on1 jumps in here with some helpfull comments

@bobo1on1 - also any comment about the "GetImageFormat" thingy would be nice.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#13
Thanks for the quick reply...
Another thing that should be addressed is that when I set the addon configuration to custom it stops working.
Only when I use slow or fast the addon works...

I am working on pushing my code into a fork of XBMC so that you all can review the code and later pull it into the mainline...
Right now I'm working on an OE branch...
Reply
#14
for the custom thingy i would be interested in the debug log (wiki) ... as its technically nothing different then the presets - its just changing the values the presets have hardcoded. So if it doesn't work then one of the custom values might be out of usefull range or so maybe.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#15
Here are my commits to the repo:
https://github.com/brooc/xbmc/commit/24d...710e622329
https://github.com/brooc/xbmc/commit/db2...72488b6c10
https://github.com/brooc/xbmc/commit/d44...40a2d822b5

@bobo1on1 and @Memphiz

Please review and let me know what you think...
I would really like to get this resolved and push the changes up stream a.s.a.p...
Reply



Logout Mark Read Team Forum Stats Members Help
RenderCapture support for omxplayer0
This forum uses Lukasz Tkacz MyBB addons.