-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video support! #348
base: main
Are you sure you want to change the base?
Video support! #348
Conversation
Fix the UPDATE_BITMAP command when drawing a big image (image size > 65535) This bug happened when trying to draw a long text with a big font size.
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
Sample code file "test_new_features.py" is provided to demontrate the new features. 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 🚀 |
Reduces a lot the data sent on the serial bus.
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... |
Fix update image payload: last 250 bytes packet must not end with 0xef 0x69. and last 250 bytes packet must not be "0x69 0x0000..." nor "0xef 0x69 0x0000..."
Improved refresh rate with JIT compiling the function _get_visible_segments with numba
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. 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. 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 : refresh_without_numba.mp4With numba : refresh_with_numba.mp4 |
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent work and it works great with my 5" Turing display.
Have you figured out a way to copy files FROM the device locally? I'd like to backup the stock videos off my device.
# Set your COM port e.g. COM3 for Windows, /dev/ttyACM0 for Linux, etc. or "AUTO" for auto-discovery | ||
# COM_PORT = "/dev/ttyACM0" | ||
# COM_PORT = "COM5" | ||
COM_PORT = "COM4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "AUTO"
# - SIMU for 3.5" simulated LCD (image written in screencap.png) | ||
# - SIMU5 for 5" simulated LCD | ||
# To identify your smart screen: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions | ||
REVISION = "C" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "A"
|
||
def ListFiles(self, dir_path : str): | ||
pyd = bytearray() | ||
pyd.extend(len(dir_path).to_bytes(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyd.extend(len(dir_path).to_bytes(1, 'big'))
Fix throughout
lcd_comm.SetBrightness(level=50) | ||
|
||
# Check if video is loaded and upload video if needed. | ||
video_size = lcd_comm.GetFileSize("/mnt/SDCARD/video/particle_wave.mp4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My device doesn't have an SDCard, but there are plenty of videos on internal storage. Maybe check if there are any internal videos and randomly select one instead of trying to upload a video to the SDCARD which may not exist?
Or, split these examples out into an sdcard and an internal storage version? There may even be space available on internal storage to push the videos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mine had nothing on internal storage.
You can upload a video on internal storage, with the "UploadFile" function by setting the argument "destination_path".
For example: destination_path = "/root/video/video.mp4"
I don't know if it's possible to download video from the device's internal storage. The software provided by the manufacturer doesn't have that feature.
@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 ! |
New features supported for the 5 inch Turing screen: