turing-smart-screen-python icon indicating copy to clipboard operation
turing-smart-screen-python copied to clipboard

Video support!

Open gwendal-h opened this issue 2 years ago • 10 comments

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)

gwendal-h avatar Oct 03 '23 17:10 gwendal-h

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.

gwendal-h avatar Oct 03 '23 20:10 gwendal-h

Nice job! I'm looking forward to testing it this week-end when I got some time 🚀

mathoudebine avatar Oct 04 '23 21:10 mathoudebine

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...

mathoudebine avatar Oct 07 '23 10:10 mathoudebine

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.)

gwendal-h avatar Oct 08 '23 13:10 gwendal-h

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 :).

gwendal-h avatar Oct 08 '23 13:10 gwendal-h

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

gwendal-h avatar Oct 08 '23 14:10 gwendal-h

Fixes #439

n-i-x avatar Jan 07 '24 00:01 n-i-x

Hi, sorry I did not find time to review your PR before but I will try to do it as soon as possible!

mathoudebine avatar Jan 10 '24 12:01 mathoudebine

@gwendal-h Would you please update this to the latest release? 🙏

peterng1618 avatar Jun 29 '24 17:06 peterng1618

@mathoudebine Could you merge my pull request to the main branch ?

gwendal-h avatar Jul 01 '24 11:07 gwendal-h

any news?

Walrus98 avatar Dec 23 '24 16:12 Walrus98

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 !

gwendal-h avatar Dec 23 '24 20:12 gwendal-h

@mathoudebine could you let us know what's pending to adopt this? I really wish we could get video support! Thanks!

peterng1618 avatar Feb 03 '25 14:02 peterng1618

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!

mathoudebine avatar Feb 06 '25 07:02 mathoudebine

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)

peterng1618 avatar Feb 10 '25 14:02 peterng1618

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.

mathoudebine avatar Feb 10 '25 21:02 mathoudebine

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).

peterng1618 avatar Feb 12 '25 03:02 peterng1618

So, no news?

KoBOLL avatar Apr 22 '25 23:04 KoBOLL