Under what circumstances does RenderCapture Fail?
#1
Hi,

I am working on a python script and am using the RenderCapture class to capture video frames.
In a subroutine that starts with the event onPlayBackStarted, I issue a capture() request (using the height and width of the video playing) and then a waitForCaptureStateChangeEvent.
Following this I check getCaptureState and always get back CAPTURE_STATE_FAILED. In a loop, this occurs for every capture() request.

I was wondering if anyone could help me understand what circumstances give rise to a failed capture.
Thanks!
Reply
#2
You shouldn't do the capture from the thread which calls the onplaybackstarted callback - did you try it in your pythons mainloop instead? - also have a look on how the boblight addon does it:

http://github.com/bobo1on1/script.xbmc.boblight
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
#3
(2014-04-27, 20:09)Memphiz Wrote: You shouldn't do the capture from the thread which calls the onplaybackstarted callback - did you try it in your pythons mainloop instead? - also have a look on how the boblight addon does it:

http://github.com/bobo1on1/script.xbmc.boblight

Thank you for responding!

I am doing the same sequence that is written in the run_boblight module from lines 202-216, but am subclassing the player and using the onplaybackstarted event to initiate the start of capture. By moving it to my main loop, do you mean that I should create a loop that continuously checks to see if playback has started and then from there call rendercapture.capture()? For performance reasons, I was trying to avoid that kind of continuous loop. is there some kind of timing conflict that can arise if I call the capture directly from the onplaybackstarted event? Thanks again for your help.
Reply
#4
I am writing this follow up in the hope that it may help others. I tried many things to get this to work, and the one thing that I found that DOES work is complete voodoo. But reproducible voodoo.
If I call RenderCapture.getWidth(), .getHeight() and getAspectRatio() before RenderCapture.capture(...), I no longer get CAPTURE_STATE_FAILED. Mind you, I don't use any of those to establish the video height and width or AspectRatio - in fact they return zero for the height and width. I get those variables using mediainfo.dll.

And if I comment those lines back out, I go back to CAPTURE_STATE_FAILED. If anyone knows why this works, please share.
Reply

Logout Mark Read Team Forum Stats Members Help
Under what circumstances does RenderCapture Fail?0