BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Streaming AVI to VM816CU50A  (Read 71 times)

gt5659a

  • Newbie
  • *
  • Posts: 1
    • View Profile
Streaming AVI to VM816CU50A
« on: November 16, 2020, 05:13:42 PM »

My goal is to stream an AVI file to the BT816 to drive an LCD screen.  The AVI file will be about 40 MB, it's binary (black or white pixels) and it will change every 30 seconds or so, and each time I need to stream it to the BT816 with as little latency as possible (I want the video to start within a 0 to 2 second window of nominal start time).

I have a VM816CU50A eval unit (it has an LCD).  I am able to create an external AVI file, and stream it to the LCD screen with the EVE Screen Editor v3.3.0.  The timing appears to be acceptable--the latency is very small: it takes less than a second to start the display after I click the "Upload RAM and Coprocessor" button with the following code:

CLEAR(1, 1, 1)
CMD_PLAYVIDEO(0, "C:/Users/Public/Documents/EVE Screen Editor/Examples/testvideo3.avi")

So far, all is well with the eval board, it appears the BT816 can dow what I want and now I need to get the BT816 integrated into my global architecture (which is coded in C#).  Two ways that I know of to use the C++ code in C# is either a CLI approach or a DLL approach.  In either case, I think the first step is getting it to work in C++, so that's what I am trying to do now.

I tried the easy route to export from ESE (running as an admin): Export-->EVE Hal 2.0 Projects-->VM81650A_LIBFT4222.  This gives me an error stating "Error copying assets to project folder: [Errno 2] No such file or directory: untitled_BT81X_EVE_HAL/untitled/Test/testvideo3.avi")".  I can export projects from ESE and run them in Visual Studio without issues if there isn't a CMD_PLAYVIDEO in them.

I also hacked some code directly in C++ and was able to display one of the provided videos of Star Trek with Jeri Ryan (FYI my 13 year old self thanks you for this), and here's a snipped of such a project:

void Skeleton(Gpu_Hal_Context_t *phost)
{
   Gpu_CoCmd_FlashFast(phost, 0);
   Gpu_CoCmd_Dlstart(phost);
   App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
    #define ADDR_VIDEO 4096
    Gpu_CoCmd_FlashSource(phost, ADDR_VIDEO);
    App_WrCoCmd_Buffer(phost, CMD_PLAYVIDEO);
    App_WrCoCmd_Buffer(phost, OPT_FLASH | OPT_SOUND | OPT_NOTEAR | OPT_OVERLAY);
    App_Flush_Co_Buffer(phost); //Video plays after this
}


Here's my specific questions.

1. Is it worth digging into the Export from ESE approach (I opened up the python export file but gave up)?  I had hoped this would make it an easy way for me to get some sample code to get moving, but if it's going to be a lot of work I can just start to hack the C++ directly
2. Can someone explain the process that ESE uses to generate the video from the provided AVI file?  Specifically, does ESE break the AVI in to bytes and add them in after a CMD_PLAYVIDEO, does it alter the AVI format and send it to flash, provide a direct filename/location link to BT81x, etc? 
3.  It seems the C++ code that I have is very close to what I need but I don't understand how the avi file gets assigned to the "ADDR_VIDEO 4096"...I think this is a location in the flash memory but I don't think that the flash upload is fast enough to be able to display the video with the low latency I am seeing in ESE (e.g., the video starts in about 500 milliseconds regardless of the size of the video tested (up to ~80 MB) hence I don't think it's going to flash).
4. Can I assign the ADDR_VIDEO (or some equivalent) to be a file name like "XYZ.avi"? and then just reassign to the new AVI whenever I need to play the video?
5. Any other pointers on how to get this to work?


Any help would be greatly appreciated!






Logged

BRT Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 266
    • View Profile
Re: Streaming AVI to VM816CU50A
« Reply #1 on: November 20, 2020, 06:04:39 PM »

Hello,

Thank you for your questions.
I will look into why the export feature is causing errors when a CMD_PLAYVIDEO command is included.

For your first question, the export code feature can be very useful, however it would help to know what your target MCU is to be able to advise further.

Eve Screen Designer uses our Video converter utility (now incorporated into EVE Asset Builder) to convert the .AVI file into an EVE compatible format. A general use case is to convert the video and store this converted asset in flash/RAM_G, you can then use the CMD_PLAYVIDEO to play the video using either the OPT_MEDIAFIFO or OPT_FLASH option to tell the co-processor where the video data is stored and where to stream it in from.

I will need to contact the development team to query how Eve Screen Designer simulates using a video from flash memory as i do not believe that it currently supports uploading flash images to the development board.

When using flash as the source for your video file you require  '#define ADDR_VIDEO 4096'. This does denote the location in flash where the video file is stored and is used in the subsequent command:
   
      Gpu_CoCmd_FlashSource(phost, ADDR_VIDEO);

Unfortunately when streaming the video from flash you cannot set ADDR_VIDEO to be a filename.

I have attached a set of examples which covers various ways of streaming video with EVE.

Best Regards,
BRT Community
Logged