2024-10-23 09:56 AM - edited 2024-10-23 10:31 AM
Hi,
I am working on a pretty simple GUI and everything is working nicely so far.
As soon as I add a video I am getting a compilation error. See below. If I take the video out, everything works.
Since TouchGFX needs mjpeg format, I had to convert my video file into mjpeg. The file works fine in windows. I don't know if it could be from an issue with the format or if there is an actual problem with TouchGFX itself.
What do you guys recommend to generate or convert mjpeg files?
Run Simulator
Generate
Done
Generate Assets
make -f simulator/gcc/Makefile assets -j8
Reading ./application.config
Reading ./target.config
Done
Post Generate
touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
Done
Compile
make -f simulator/gcc/Makefile -j8
Reading ./application.config
Reading ./target.config
Compiling generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.cpp
Compiling generated/gui_generated/src/standby_screen/StandByViewBase.cpp
Compiling generated/simulator/src/mainBase.cpp
Compiling generated/fonts/src/Kerning_conthrax_sb_20_4bpp.cpp
Compiling generated/fonts/src/UnmappedDataFont.cpp
Compiling generated/fonts/src/Table_conthrax_sb_20_4bpp.cpp
Compiling generated/fonts/src/FontCache.cpp
Compiling generated/fonts/src/Font_conthrax_sb_20_4bpp_0.cpp
Compiling generated/fonts/src/CachedFont.cpp
Compiling generated/fonts/src/ApplicationFontProvider.cpp
Compiling generated/images/src/__generated/image_alternate_theme_images_widgets_lineprogress_backgrounds_image_plain_thick_medium_90.cpp
Compiling generated/images/src/image_BLACK-BG-360px.cpp
Compiling generated/images/src/SVGDatabase.cpp
Compiling generated/images/src/BitmapDatabase.cpp
Compiling generated/texts/src/LanguageGb.cpp
Compiling generated/texts/src/TypedTextDatabase.cpp
Compiling generated/texts/src/Texts.cpp
Compiling simulator/main.cpp
In file included from generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.cpp:6:0:
generated/videos/include/videos/VideoDatabase.hpp:8:27: error: expected initializer before '-' token
const uint32_t video_Power-On_bin_length = 782222;
^
generated/videos/include/videos/VideoDatabase.hpp:10:34: error: expected initializer before '-' token
extern const uint8_t* video_Power-On_bin_start;
^
generated/videos/include/videos/VideoDatabase.hpp:15:27: error: expected initializer before '-' token
const uint32_t video_Screensaver_bin_length = 1185126;
^
generated/videos/include/videos/VideoDatabase.hpp:17:34: error: expected initializer before '-' token
extern const uint8_t* video_Screensaver_bin_start;
^
generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.cpp: In constructor 'ScreensaverViewBase::ScreensaverViewBase()':
generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.cpp:15:25: error: 'video_Screensaver_bin_start' was not declared in this scope
video1.setVideoData(video_Screensaver_bin_start, video_Screensaver_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from generated/gui_generated/src/standby_screen/StandByViewBase.cpp:7:0:
generated/videos/include/videos/VideoDatabase.hpp:8:27: error: expected initializer before '-' token
const uint32_t video_Power-On_bin_length = 782222;
^
generated/videos/include/videos/VideoDatabase.hpp:10:34: error: expected initializer before '-' token
extern const uint8_t* video_Power-On_bin_start;
^
generated/videos/include/videos/VideoDatabase.hpp:15:27: error: expected initializer before '-' token
const uint32_t video_Screensaver_bin_length = 1185126;
^
generated/videos/include/videos/VideoDatabase.hpp:17:34: error: expected initializer before '-' token
extern const uint8_t* video_Screensaver_bin_start;
^
generated/gui_generated/src/standby_screen/StandByViewBase.cpp: In constructor 'StandByViewBase::StandByViewBase()':
generated/gui_generated/src/standby_screen/StandByViewBase.cpp:20:25: error: 'video_Power_On_bin_start' was not declared in this scope
video1.setVideoData(video_Power_On_bin_start, video_Power_On_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~
generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.cpp:15:60: error: 'video_Screensaver_bin_length' was not declared in this scope
video1.setVideoData(video_Screensaver_bin_start, video_Screensaver_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generated/gui_generated/src/standby_screen/StandByViewBase.cpp:20:51: error: 'video_Power_On_bin_length' was not declared in this scope
video1.setVideoData(video_Power_On_bin_start, video_Power_On_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [build/MINGW32_NT-6.2/generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.o] Error 1
generated/simulator/gcc/Makefile:196: recipe for target 'build/MINGW32_NT-6.2/generated/gui_generated/src/screensaver_screen/ScreensaverViewBase.o' failed
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [build/MINGW32_NT-6.2/generated/gui_generated/src/standby_screen/StandByViewBase.o] Error 1
generated/simulator/gcc/Makefile:196: recipe for target 'build/MINGW32_NT-6.2/generated/gui_generated/src/standby_screen/StandByViewBase.o' failed
In file included from generated/simulator/src/mainBase.cpp:10:0:
generated/videos/include/videos/VideoDatabase.hpp:8:27: error: expected initializer before '-' token
const uint32_t video_Power-On_bin_length = 782222;
^
generated/videos/include/videos/VideoDatabase.hpp:10:34: error: expected initializer before '-' token
extern const uint8_t* video_Power-On_bin_start;
^
generated/videos/include/videos/VideoDatabase.hpp:15:27: error: expected initializer before '-' token
const uint32_t video_Screensaver_bin_length = 1185126;
^
generated/videos/include/videos/VideoDatabase.hpp:17:34: error: expected initializer before '-' token
extern const uint8_t* video_Screensaver_bin_start;
^
generated/simulator/src/mainBase.cpp: In function 'void setupVideoDecoder(touchgfx::HAL&)':
generated/simulator/src/mainBase.cpp:42:131: error: 'video_Power_On_bin_length' was not declared in this scope
setupVideo(static_cast<touchgfx::HALSDL2&>(hal).localFileName(videoFileName, 400, "Power-On.bin"), &video_Power_On_bin_start, video_Power_On_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~
generated/simulator/src/mainBase.cpp:42:131: note: suggested alternative: 'video_Power_On_bin_start'
setupVideo(static_cast<touchgfx::HALSDL2&>(hal).localFileName(videoFileName, 400, "Power-On.bin"), &video_Power_On_bin_start, video_Power_On_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~
video_Power_On_bin_start
generated/simulator/src/mainBase.cpp:43:149: error: 'video_Screensaver_bin_length' was not declared in this scope
setupVideo(static_cast<touchgfx::HALSDL2&>(hal).localFileName(videoFileName, 400, "Screensaver.bin"), &video_Screensaver_bin_start, video_Screensaver_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generated/simulator/src/mainBase.cpp:43:149: note: suggested alternative: 'video_Screensaver_bin_start'
setupVideo(static_cast<touchgfx::HALSDL2&>(hal).localFileName(videoFileName, 400, "Screensaver.bin"), &video_Screensaver_bin_start, video_Screensaver_bin_length);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
video_Screensaver_bin_start
make[2]: *** [build/MINGW32_NT-6.2/generated/simulator/src/mainBase.o] Error 1
generated/simulator/gcc/Makefile:196: recipe for target 'build/MINGW32_NT-6.2/generated/simulator/src/mainBase.o' failed
generated/simulator/gcc/Makefile:155: recipe for target 'generate_assets' failed
make[1]: *** [generate_assets] Error 2
simulator/gcc/Makefile:32: recipe for target 'all' failed
make: *** [all] Error 2
Failed
Failed
2024-10-23 10:31 AM
Hmm, I just read this:
TouchGFX does not support video decoding in portrait mode.
My simulator is currently setup as 600 px wide and 1024 px tall. Could that be issue?
It seems like a rather strong limitation. I was currently possibly using an STM32 chip for our product since we need a pretty extensive GUI and it felt like TouchGFX would allow us to get to market faster. Without video support, all our GUI plans will collapse.
Is this limitation something ST is working on currently?
2024-11-08 10:26 PM
Bumping this up, with hopefully some insight from a rep.
Thanks
2024-11-23 04:10 AM - edited 2024-11-23 04:13 AM
It sounds like the issue might be with the MJPEG conversion. Try using FFmpeg for reliable results:
ffmpeg -i input.mp4 -vcodec mjpeg -q:v 2 -an output.avi
Make sure the video matches TouchGFX requirements (resolution, frame rate, and container format like AVI). If it works on Windows but not in TouchGFX, check the error logs for more details.
If you're editing in CapCut, export in high quality first, then convert with FFmpeg. Let me know if you need help with this! :smiling_face_with_smiling_eyes: also check this
2024-11-24 09:48 PM - edited 2024-11-25 01:39 AM
Thank you for the reply.
I wasn't using FFmpeg so I gave it a shot and it now works in the simulator, so there definitely was a format/codec compatibility issue of some sort.
Thank you.
Now the video works fine in either Landscape or Portrait mode in Simulator mode (pure TouchGFX project).
However, if I set it up through TouchGFX from a CubeIDE/MX project in which I have configured the hardware, the video will only run in Landscape mode within the simulator or the hardware custom board with display attached to it.
So I am back to my original question (thread tittle) and I am wondering if there is a known workaround to this rather annoying limitation?
Is the current limitation affecting both software and hardware decoding? Since it doesn't work in TouchGFX's simulator I am guessing it's not a hardware problem, but I could be wrong?
Is this something ST engineers are currently working on?
2024-11-28 10:46 AM
Also, I've followed this workaround but did not succeed:
https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/video-widget-on-portrait-mode/td-p/79004