abrenoch / hyperion-android-grabber Goto Github PK
View Code? Open in Web Editor NEWScreen grabber for hyperion
License: MIT License
Screen grabber for hyperion
License: MIT License
Might be helpful in some cases
Observed on Shiekd TV
reproduce
2
for horizontal and vertical led countDoes not happen always but quite frequently
Don't know the first thing about this yet, but it is bound to be an issue.
Apps like Netflix and Amazon Video are DRM protected, but this might be able to by bypassed using root and xposed.
crash on android tv emulator Oreo 8.0 and Mi Box 3 Oreo 8.0 when call intent.migrateExtraStreamToClipData(); PendingItent.java line 340
I don't set setContentIntent
for the builder when isTv
UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(UI_MODE_SERVICE); if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) { isTv = true; }
The notification icon is currently a solid shape, something like an H would be more recognizable
I've only seen this a handful of times, but basically the screen content being sent to the LEDs does not change when switching the app.
I'm not sure what exactly the cause is yet, but clearing the app from the memory and restarting the grabber service eventually seems to solve the problem.
Not sure what the exact source of this problem is yet, but the result is the screen grabber stops running (as indicated by the absence of the cast icon in the notification bar). The problem seems to be either the HyperionScreenEncoder
Runnable is dying off, or the HyperionScreenService
IntentService it was launched from is being terminated. I'm trying to run that intent service as a foreground service, but I'll have to do some work to see if that is actually working as expected (https://stackoverflow.com/questions/6645193/foreground-service-being-killed-by-android). I am getting the notification that the service is in the foreground, but I'm not sure what impact that is having on the screen grabber (and the notification seems to be a bit too persistent - should have a exit button).
Seems to be the only major hold-up right now!
It seems that the TV app does not notice that the host has been filled until the app is restarted
reproduce:
with a fresh install of the app:
expected: hyperion is turned on
actual: toast message: Host must not be empty
After an app restart, the host is used, so the persistence is not the problem. Settings should be reloaded when settings are closed.
I'd be happy to fix this
can swipe the app out of memory on a phone, but the TV build doesn't seem to behave that way.
Basically the grabber doesn't stop sending data when it should.
The most I can anyway; I'm not sure exactly how reliant I am on the behavior of this yet (original code is not mine).
Ideally the encoder gets stripped down to the bare essentials that allows it to ecode the screen to an EGL surface, then implement a decoder for the hyperion image instead.
Turning it off and then back on again seems to get it going. May be related to the grabber version switching.
Might still need to determine the best way to represent this as a setting... This should be very simple for the end user to figure out, and not something they need to guess at.
A good way may be to simply have the user note how many LEDs wide & tall their setup is. Seems like that should give us a good bitrate range to aim for when scaling the captured image from the device running the grabber.
Basically decode the pixel data from the surface into a byte array that we can send over the hyperion protobuf socket.
Punching in ip addresses and port numbers sucks, especially on a TV. Let's try to find a running hyperion server if the settings haven't been filled yet. Currently working on this
✓ investigate technical feasibility
✓ Implement Scanner
▶ TV UI
◌ Mobile UI
Will need:
Might need:
Adding a licence to the project will make it easier for people to contribute
Black padding on either top/bottom/sides depending on the screen orientation (and probably other things).
Explains some users feeling like the colors are not as vibrant as they should be, and should explain #30
It appears when restarting or shutting down the device kills the service without the lights being cleared.
Hi
running on 5.1.1 its only captures the pixels from upper left corner.
Tried with out scaling, but as expected extremly slow...
My idea is capture with full resolution and scale after
Image img = reader.acquireLatestImage();
before
'savePixels(ing)'
I am a PLC Programmer no Android.
Any suggestions on doing this or why it is only captures a small part?
First of all thank you @abrenoch 😘
I am currently super worried and pissed at the current state of things... let me explain. Android is not a small or niche platform, but still when it comes to some stuff it get's left behind.
SPMC is a great kodi fork very important for android / shield tv users especially because it's ability to run the Hyperion-Ambilight Addon while hardware acceleration is turned off. If I turn off hardware acceleration on any kodi build I can't playback any video file without stutter... but as most of you know SPMC got discontinued few weeks ago which really worries me about the future. I don't wanna be stuck with SPMC forever. I know these developers sacrifice their free time and don't owe us anything! I'm not complaining just voicing my concerns that's all.
It's really cool that @abrenoch has made this application! I use SPMC/kodi and YouTube on my shield tv and it's great that I'm not dependent on the kodi youtube addon because it's sucks and is limited to only 720P.
The Grabber works fine but sometime freezes and I have to manually restart it. But has some pro's and con's.
Pro's:
not limited to kodi/SPMC
has a settings for framerates
good black border recognition very quick
hasn't has a issues with different framerates (causes no delay while watching 24fps movies)
Con's:
isn't 100% reliable yet stops working randomly
right side of LED's not bright as the rest!
no settings option for how much % in the picture should be scanned
no settings like the Hyperion addon which enables to set picture width and high I have mine set to 225 and 120 which results in a more accurate effect. shield tv can handle stuff like this. there is a noticeable difference in the ambilight effect between the addon and this apk.
I just hope @abrenoch continues development on this very promising app.
With the new changes that broadcast the grabber status, if the host is unavailable, the animation showing the grabber has started would play for just a moment before the connection error was returned, which the animation would stop playing as expected.
Same issue as before but the reverse now 😆
A @abrenoch noted earlier, the toast message that appears when starting the app is not ideal.
I am working on a PR that shows a more subtle message on the main screen when the grabber is active
Project was started with support for android TV, so a simple interface will need to be tossed together to deploy a test for the shield.
I joined the Google Play Beta, but visiting this link from the Netherlands (and logged in with a google account registered in the Netherlands) gives me a 404:
Could you check that the beta is available worldwide?
Have a notification item with a button to pause/stop the screen grabbing
Basically a way to define what apps the screen grabber will or won't grab.
https://developer.android.com/guide/topics/ui/shortcuts.html
Seems like a good excuse to learn about these
Mobile:
General:
To make it easier to use lokalise to handle user contributions to the translations, we should move all the strings to the common directory. Otherwise we would need to manually organize those values every time a translation is added or updated.
We should probably organize the default values and the pref_key_* values to a different file as well so they don't get mixed up with the translation strings. Lokalise only supports string values anyway so we would have to store those in a different file regardless,
This probably is not at all relevant to the tv build, but when grabbing on a mobile device and the screen is rotated, then the content of the grabbed screen gets all funky. Maybe we would need to re-initialize the grabber on rotation events? Would take a little experimenting.
Hello,
is your app able to capture HW accelerated video on android TV?
If so, could you please send post here .apk file?
Many thanks
Hi, I saw min SDK version is 19 for mobile. I installed app on 4.4.2 but when I click on app icon it crashed immediatelly. Any idea please?
If the MainActivity
is not running when the settings tile is toggled, the grabber will fail to start without showing the toast notification.
Easy enough to add a toast to HyperionGrabberTileService
, but it might need something to check if HyperionGrabberTileService
has a BroadcastReceiver
registered before showing the toast in MainActivity
, or else the notifications will double-up. Seems like that should be easy to achieve with a static boolean in HyperionGrabberTileService
.
Maybe this is better suited for hyperion itself, but wanted to consider it.
It seems like when turning on the grabber, and the host is unreachable, the grabber should be turned back off and convey to the user that the provided host is unreachable.
Any thoughts on this from anyone? Seems like the right move to me, though we may need to look at how this interacts with the reconnect behavior (maybe not).
git hash 4f09e7c (image quality branch)
java.lang.OutOfMemoryError: Failed to allocate a 134287376 byte allocation with 25165824 free bytes and 62MB until OOM, max allowed footprint 161279872, growth limit 201326592
at com.abrenoch.hyperiongrabber.common.network.Hyperion.receiveReply(Hyperion.java:139)
at com.abrenoch.hyperiongrabber.common.network.Hyperion.sendRequest(Hyperion.java:127)
at com.abrenoch.hyperiongrabber.common.network.Hyperion.clear(Hyperion.java:45)
at com.abrenoch.hyperiongrabber.common.network.HyperionThread$1.clear(HyperionThread.java:46)
at com.abrenoch.hyperiongrabber.common.HyperionScreenEncoderBase$1.run(HyperionScreenEncoderBase.java:63)
at java.lang.Thread.run(Thread.java:764)
07-14 11:59:03.986 688-757/? E/InputDispatcher: channel '623e101 com.abrenoch.hyperiongrabber.tv/com.abrenoch.hyperiongrabber.tv.activities.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
07-14 11:59:03.988 688-757/? E/InputDispatcher: channel 'c3f6976 com.abrenoch.hyperiongrabber.tv/com.abrenoch.hyperiongrabber.tv.activities.ManualSetupActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Not sure the best way to describe this. Using the grabber on a Shield. Works perfect for a while then the lights will freeze. Going to grabber, turn off and on and all good. No consistency in how long it works, but works no longer than 35 mins.
Any logs or anything I can look at?
Using Alpha 2
Thanks for the idea @ninovanhooff !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.