turing-smart-screen-python
turing-smart-screen-python copied to clipboard
Video support!
New features supported for the 5 inch Turing screen:
- File upload
- Delete file
- List files and directories (internal storage and SD card)
- Start/stop a video
- Draw image / texts / progress bar on the video
- 1 small fix:
- Fix the UPDATE_BITMAP command when drawing a big image (image size > 65535)
Sample code file "test_new_features.py" is provided to demontrate the new features. New sample code file "simple-program-video-mode.py" is basically "simple-program.py" but in video mode.
Video dimensions must be 480 * 800. I added some sample videos as an example.
I still have to improve the performance: the refresh is a bit slow and it takes too much CPU.
Nice job! I'm looking forward to testing it this week-end when I got some time 🚀
My Turing 5" just broke 😞 I was testing your code and everything was working fine but suddenly my computer restarted and I think it broke the screen, now it connects/disconnects in loop and won't respond to commands, I need to order a new one...
My Turing 5" just broke 😞 I was testing your code and everything was working fine but suddenly my computer restarted and I think it broke the screen, now it connects/disconnects in loop and won't respond to commands, I need to order a new one...
Oh no! what happened ? Was it like a micro power outage that broke it ? You could try pluging the screen with the other cable (There's the USB-C cable and the 4-wire cable that you can connect to your mother board directly.)
So this week-end I was able to fix the last remaining issue: sometimes the resfresh would freeze and the status reply was "NeedReSend = 1" ...
Turns out the last 250 bytes packet of the image payload can not end with 0xEF69. And the last 250 bytes packet can not be 0x69000000... or 0xEF69000000...
So in that case I add a "dummy" visible pixel field to fix the image payload format.
Now the script "simple-program-video-mode.py" is running smoothly.
But man that was time consuming to find this one :).
I also tried to improve the refresh time to the best i could. I ended up using numba to just-in-time compile the function _get_visible_pixels. (Python was quite slow in those loops)
On my computer the average refresh time went from 0.056 s down to 0.016 s ! (so much less CPU consumption in real application!)
Without numba :
https://github.com/mathoudebine/turing-smart-screen-python/assets/146868911/ec5257f8-d7d5-4118-b29b-ce8c4ec1bf62
With numba :
https://github.com/mathoudebine/turing-smart-screen-python/assets/146868911/4ab7e987-a0d6-4b26-abe6-b1e2b3a709ca
Fixes #439
Hi, sorry I did not find time to review your PR before but I will try to do it as soon as possible!
@gwendal-h Would you please update this to the latest release? 🙏
@mathoudebine Could you merge my pull request to the main branch ?
any news?
Nope no news, I didn't follow this project so I don't know if my branch has drifted from the main branch. But you could try my commit @Walrus98 it should work if you want to display a video on your screen !
@mathoudebine could you let us know what's pending to adopt this? I really wish we could get video support! Thanks!
Hi all and thank you for your patience, I have not had the time to test it since my Turing 5" screen broke. I'm asking for your help: can someone with the Turing 5" model test this PR on their model and confirm the video feature is working properly? Thanks!
Hi Matthieu, I tested it before and it worked well on my 5". Do you need me to test it again? (It has some conflicts with the current Master branch, per the merge notice)
Hi @peterng1618 thanks for the feedback! No need to test it again, I will merge it just after the PR for the 8.8" and 2.1" screen support that has been asked a lot recently. I will also need to think of a way to integrate it to themes & config.
Yeah, I was struggling to figure out how to use it in themes 😅 If you could make it happen, that'd be early Christmas for me. It's basically the only thing that stops me from recreating my favorite themes (from the original software).
So, no news?