cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Error Running Simulator (video in portrait mode limitation?)

sm1981
Associate II

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

 

 

 

 

13 REPLIES 13

Hi @Osman SOYKURT 

Thank you for your reply. That is what I tried, but unfortunately without success. I only see the upper part of the video (probably around 480 pixels) while my display is 800x480 pixels. I use a stride value of 832, not sure if that makes a difference.

I am using TouchGFX 4.26.0.

 

 

mathiasmarkussen
ST Employee

Your stride value should not be a problem in this case. I suspect that you are using a video buffer, and that it is set up wrong. I think it should be set to 800x480, and the rendered images are then copied to the framebuffer, where the rotation is applied. If it's already 800x480, I'm probably wrong, and you should try swapping it anyway :)

Baldi1879
Associate

Hi @mathiasmarkussen 

I'm working on this project with @gerthmar.

I made the settings as recomended in the answers to this post. 
Settings_CubeMX.JPGSettings_TouchGFX.JPG

The result on the device looks like that:
Result_on_device.jpg

When i tried to swap the buffer width and height, the result was worse than before and nothing of the video gets shown.
WhatsApp Bild 2025-12-03 um 15.14.13_301e0732.jpg

Thanks. 

Best regards,

Adrian

I have asked around a bit, and have identified the reason for this.

The STM32F769 is an edge case when it comes to hardware video decoding. For all MCUs with hardware video decoding except the F7, DMA2D can perform a conversion from YcBcR to RGB. This is done into a smaller intermediate buffer, that is then copied and, if needed, rotated into the video buffer.

The F769 DMA2D does not support YcBcR, so this conversion is done in software instead. This code path does not rotate the video before putting it into the final buffer.

If your hardware design is final, and you cannot select another MCU (which I suspect from your images), another option is to rotate you videos at encode time in FFMPEG. I have attached a project that demonstrates how this can be done, and how to modify the video widget in TouchGFX, so it draws the widget with width and height swapped.

Also note that you video buffers do not need to be larger than the largest video you expect to show, and if you rotate the video at encode time, it should match the actual size of the video, not be aligned with the framebuffers as you have them now.

Read readme.md in the project, it is pretty well described there, and let me know if you have any further questions.