Announcement

Collapse
No announcement yet.

uLCD-28PTU - Problem encoding video directly from the SD ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uLCD-28PTU - Problem encoding video directly from the SD ?

    Hello from Paris,

    I'm a beginner and i just would like to know how i can encoding a video directly on the micro SD card who is in behind the screen to my 28PTU ?

    - Windows 10 64bits
    - Video source 320x240 / 29.97fps / Bitrate 742 (already tried many video with different encoding setup like 10fps etc)
    - Micro SD 2go / Samsung EVO HC 1 / Formated in FAT16 (already tried FAT32/NTFS on different SD 8go etc)

    *************************************************************

    Here what happen when i start the LCD with the SD plugged in the backside of the LDC
    Someone can help me ? I'm trying since 2 days and that make me crazy ...

    -------------------

    Below a my video showing step by step of what i did, may i did something wrong with the software Workshop 4 ?

    https://www.youtube.com/watch?v=u9uB...ature=youtu.be


    -------------------
    Below a video where i followed the instruction of this video but this one is concern an another model (uOLED128-G2)

    https://www.youtube.com/watch?v=a5kvNXxbhzQ&t=158s

    Thanks you !
    Regards
    Last edited by Rick; 18 January 2018, 08:44 PM.

  • #2
    Hello Rick,

    Welcome to the forum.

    This might be easier to achieve if you were to use the Visi environment. The coding is the same as designer but you will find it easier to create a video on your display.

    Start a new project choosing your display and then click on Visi as the programming environment.

    You will be presented with some generated code

    Code:
    #platform "Gen4-uLCD-28PT"
    
    
    // Program Skeleton 1.4 generated 18/01/2018 12:46:40
    
    // #MODE RUNFLASH uncomment and set Destination to Flash to run from Flash, refer 4D-AN-00055
    
    #inherit "4DGL_16bitColours.fnc"
    
    #inherit "VisualConst.inc"
    
    #inherit "NoName2Const.inc"
    
    func main()
    //  var hstrings ; // Handle to access uSD strings, uncomment if required
    //  var hFontx ;   // Handle to access uSD fonts, uncomment if required and change n to font number
    //  Uncomment the following if uSD images, fonts or strings used.
    /*
        putstr("Mounting...\n");
        if (!(file_Mount()))
            while(!(file_Mount()))
                putstr("Drive not mounted...");
                pause(200);
                gfx_Cls();
                pause(200);
            wend
        endif
    //    gfx_TransparentColour(0x0020);    // uncomment if transparency required
    //    gfx_Transparency(ON);             // uncomment if transparency required
    
    //  hFontn := file_LoadImageControl("NoName2.dan", "NoName2.gcn", 1); // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9
    //  hstrings := file_Open("NoName2.txf", 'r') ; // Open handle to access uSD strings, uncomment if required
        hndl := file_LoadImageControl("NoName2.dat", "NoName2.gci", 1);
    */
    
    
        repeat
        forever
    endfunc
    Next click on the Widgets tab at the top and click on the System/Media tab, then click on the Video widget and then click on the image of of your display in the object inspector in the area of the screen where you would like the top left hand corner of your video to be. This doesn't have to be precise as we can change the properties of the video after it has loaded. An open file dialogue will appear, so navigate to your video then click Open.

    The video will appear in the object inspector. You can chnge the properties to suit your video.

    Next, in the generated code click in between the repeat forever command. Then go back to the object inspector and click on Paste Code. The code to play a single frame of the video will be pasted in the repeat forevor loop.

    You will then need to declare the variable frame to match the frame variable in the video command so type in var frame; under the #inherit commands

    Next we need to create a for next loop to display each frame so we will add for(frame := 0; frame < 52393; frame ++) underneath the repeat command and a next above the forever command. adjust the number of frames in the for command to suit the number of frames of your video my example was 52393. eg

    Code:
    #platform "Gen4-uLCD-28PT"
    
    
    // Program Skeleton 1.4 generated 18/01/2018 12:46:40
    
    
    
    #inherit "4DGL_16bitColours.fnc"
    
    #inherit "VisualConst.inc"
    
    #inherit "NoName2Const.inc"
    
    var frame;
    
    func main()
    //  var hstrings ; // Handle to access uSD strings, uncomment if required
    //  var hFontx ;   // Handle to access uSD fonts, uncomment if required and change n to font number
    //  Uncomment the following if uSD images, fonts or strings used.
    /*
        putstr("Mounting...\n");
        if (!(file_Mount()))
            while(!(file_Mount()))
                putstr("Drive not mounted...");
                pause(200);
                gfx_Cls();
                pause(200);
            wend
        endif
    //    gfx_TransparentColour(0x0020);    // uncomment if transparency required
    //    gfx_Transparency(ON);             // uncomment if transparency required
    
    //  hFontn := file_LoadImageControl("NoName2.dan", "NoName2.gcn", 1); // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9
    //  hstrings := file_Open("NoName2.txf", 'r') ; // Open handle to access uSD strings, uncomment if required
        hndl := file_LoadImageControl("NoName2.dat", "NoName2.gci", 1);
    */
    
    
        repeat
    
        for(frame := 0; frame < 52393; frame ++)
        // Video1 1.0 generated 18/01/2018 12:47:39
        img_SetWord(hndl, iVideo1, IMAGE_INDEX, frame) ; // where frame is 0 to 52393
        img_Show(hndl,iVideo1) ;
        next
    
        forever
    endfunc
    To enable the acessing the SD card we need to delete the /* and the */ in the above code. This will allow the SD card to mounted and the graphics files to be loaded.

    Next click Comp'n'Load and the video will be built and then saved to the SD card when prompted and then the code will be flashed to your display.

    I hope this helps

    Paul

    Comment


    • #3
      Thanks for replying !
      OK i followed all your instructions but i have 2 problems during the encoding, see my video link below please.

      https://www.youtube.com/watch?v=EPvL...ature=youtu.be

      What is the count frameset and how i can fix it ?

      Thank you !
      Regards

      Comment


      • #4
        Hi,

        Workshop didn't see your display during the Comp'n'Load. Can you click on the Comms tab and select the com port that your display is connected to and also press the scan button. The display name will show in the panel. if it does show then you will be able to click on the Comp'n'Load button again.

        Best regards

        Paul

        Comment


        • #5
          Just in case, i don't have a starter kit for this LCD but only the screen.
          My SD card is connected on a card reader to my USB port on my PC. The starter kit is essenstial to encod a video ? I need the (uUSB-PA5) ?

          Can't chose another com port

          Last edited by Rick; 19 January 2018, 02:46 AM.

          Comment


          • #6
            Hi Rick

            Yes, you will need a uUSB-PA5 or the new UPA to do it this way with Designer or Visi. It is possible to use the Serial environment but you would still need to attach an Arduino or other micro-controller to the display to send the commands serially to play the video.

            I hope this helps

            Paul

            Comment


            • #7
              Hello Paul,

              OK i received my (uUSB-PA-II) and installed this driver (CP210x_Universal_Windows_Driver.zip)
              First of all, if i understand i don't need an card reader ? To transfert a video i just need to plug the SD card into the 28PTU and conect the (USB-P-II) that's all ?




              When i conect the 28PTU to my PC with the adaptor and the SD, my PC didn't detect the device on my desktop, but i can hear the sound of the device bip from Windows like when you conect a USB key. But can't see the device on Windows but i can see it on Workshop 4D software on COM port 4.

              My current problem is when i click on Comp'n Load i can't select the destination folder because i can't see the device

              Last edited by Rick; 22 January 2018, 09:09 PM.

              Comment


              • #8
                Hello Rick,

                The SD card inserted in the display won't show as a folder in Windows explorer. The SD card will have to be removed from the display and used with a card reader on the PC. The uUSB-PA-II is used for flashing your Visi code to the display after the graphics have been saved to the SD card

                I hope this helps

                Paul

                Comment


                • #9
                  OK i understand, now when i click on Comp'n Load he created 2 files directly into the SD (see photo below)






                  -------------
                  Also created lot another files (not in the SD)


                  Now what i need to do ? What files i need to placed on the SD ?
                  On each folder i have twice NoName1.dat and CGI

                  Thank you
                  Regards

                  Comment


                  • #10
                    Hi Rick,

                    That is correct as it is, just those 2 files on the SD card. Hopefully the code has been flashed to the display so all you need to do is re-insert the SD to the display and it should be playing the video.

                    Best regards

                    Paul

                    Comment


                    • #11
                      It's working but the video is freezed, what is the best spec to encode the video ? avi ? mpg ? How many fps ?
                      Thanks

                      Comment


                      • #12
                        HI Rick,

                        WMV is the best format to use, When does it freeze, is it at the very beginning and doesn't play at all.

                        Paul

                        Comment


                        • #13
                          It freezes to the first frame of my video. What about the fps from the video source ?
                          Last edited by Rick; 23 January 2018, 12:22 AM.

                          Comment


                          • #14
                            Hi Rick,

                            There is an example in C:\Users\Public\Documents\4D Labs\Picaso ViSi\ called VIDIMAGE that you could try just to prove that the video works in case there is an error with the code I sent or your video file.

                            Best regards

                            Paul

                            Comment


                            • #15
                              Yes i found a video called (SHORT1.WMV) and i tried to transfert this video to my SD and i have the same problem. Frame freezed

                              So you think the code is not correct ?

                              Comment

                              Working...
                              X