Announcement

Collapse
No announcement yet.

Video Playback in Visi

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

  • Video Playback in Visi

    Hi, I'm completely new to 4D workshop and building your own project type stuff. It is something I have just started as a hobby and have little experience in electronic circuitry and programming.
    I am using the uOLED-128-G2 kit with the current drivers and PMMC installed, I have it connected using windows 8.1 on VMware Fusion on a macbook pro,
    I am very happy with the screen so far and that it works straight out of the box and someone like me is able to use it with very limited knowledge, however my simple success has driven my desire to make it do more, but I fear I may have bitten off more than I can chew.

    So far I have managed to draw objects like triangles, and used demo's like the gauge program. But I am having difficulty figuring out how to display my own video files.
    I am using the ViSi environment in workshop and the steps I have taken are these.

    After I start a new project I select the uOLED-128-G2 in landscape mode.
    I then click on the comms tab and make sure that the screen is connected.
    I then goto the widgets\system media tab and drag the media icon into the form1 image of my display module.
    I have no problems using and displaying the SHORT1.WMV that is provided. But when I try to use my own video I get a window saying "Invalid Floating Point Operation" this is where I become stuck as I have no idea what this is or what I am supposed to do to resolve it. (Also if I try this twice workshop will hang and have to be force closed with task manager)

    I have tried to use a video converter to make my video match the SHORT1.WMV properties such as, frame width = 320, frame height = 240, data rate = 960kbps, total bitrate = 1024kbps, and frame rate = 30fps. But still end up with the same problem.

    The original video was downloaded from youtube in MP4 format that I converted to WMV. I also tried converting the MP4 and the converted WMV to match the properties of SHORT1.WMV with no success.
    I am wondering if there is some kind of specific type of video or video limitations that exist and what the type of video I need to play back is?

    Is there a tutorial for ViSi widget video playback something similar to the 'how to draw pixels and lines in ViSi' app note? I was unable to find a guide for video playback in the app notes downloads section.
    I have come across this link in the forums but am not sure if it is relevant, however I noticed the use of graphics composer which I will fiddle about with tonight to see if it helps (http://forum.4dsystems.com.au/forum/...video-question).

    This reply mentions that the screen being used is not a video player (http://forum.4dsystems.com.au/forum/...6019#post46019). I would be interested in knowing which 4dsystem product would be best for video playback in a tiny screen size.

    Also I was wondering if there is a way to make things upside down quickly like some kind of function, method that would invert images that I drew such as the triangle so I would not have to type in two individual set of triangles co-ordinates?

    Please forgive my lack of understanding of such topics, I have tried to explain all the steps I have taken and detail everything as best as I can and hope that it makes sense. I would really appreciate any help and advice that anyone is able to provide back.

    Thanks.




  • #2
    Workshop uses Directshow to capture videos and split them into images to create the .GCI files. Thus Workshop should be able to read any video format that Media player can. The error you report is occurring inside DirectShow, one suspects this means either the Video is explicitly 'copy protected', or the 'Codec' that renders the video either deliberately or inadvertedly has prevented Workshop from adding a 'frame grabber' to capture the video. Try saving the video in a different format, or reprocessing it to a different format. Let us know what works and what doesn't.

    We don't make anything specifically designed to produce video, it's mostly up to how fast each processor can read the uSD and transmit those pixels to the screen. Goldelox can do ~210,000 pixels per second, Picaso ~650,000pps and Diablo ~1,220,000pps. So you can up the Frames per second by lowering the size of the frame (as it doesn't need to be full screen).

    GFX type primitives can be easily done 'upside down' by using gfx_ScreenMode() to change the orientation of the display
    Mark

    Comment


    • #3
      Thanks for the reply Mark, I'm still unsure as to why the original files may not have worked. It may be something to do with the codec but I really am in the dark on this matter. I did manage to get it working however by trying a few formats with various success and failures, I found a free online converter and tried a few different formats the most successful was to convert the file to mpeg-1 format. Then compile and wait for it to tell me what total number of frames to set so that it would match the GCI, then I would recompile and everything will run perfect. I also am unable to figure out how to play videos after each other. I have tried to add two media widgets to the form, resize them and then used the paste code feature to place them in the repeat forever segment but it seems to only run the first video. I followed the demo program but it seems to just do an image and video. I also tried to run each video in a second form and use the paste all code but cannot seem to find how to swap forms correctly. I tried to create two functions called Form1(); and Form2(); similar to ones that I located in one of the app notes and then call those in main(); but as my knowledge of coding is at a beginner level I don't know what is relevant and what is not in the examples. I will paste my code below for any suggestions that anyone may have.

      The code for using two videos in one form is as follows:

      func main()
      // Uncomment the following if uSD images, fonts or strings used.

      print("Starting\n");
      pause(2000);
      gfx_Cls();
      while(!media_Init())
      putstr("Drive not mounted...");
      pause(200);
      gfx_Cls();
      pause(200);
      wend


      repeat



      media_SetAdd(iVideo1H, iVideo1L) ; // point to the Video1 image
      media_Video(0, 0) ; // show video

      gfx_Cls();


      media_SetAdd(iVideo2H, iVideo2L) ; // point to the Video2 image
      media_Video(0, 0) ; // show video

      gfx_Cls();

      forever
      endfunc


      The code for using two forms is below:

      func main()
      // Uncomment the following if uSD images, fonts or strings used.

      print("Starting\n") ;
      pause(2000);
      gfx_Cls();
      while(!media_Init())
      putstr("Drive not mounted...");
      pause(200);
      gfx_Cls();
      pause(200);
      wend


      repeat

      // Form1
      media_SetAdd(iForm1H, iForm1L) ; // point to the Form1 image
      // media_Image(0,0);

      // Video1
      media_SetAdd(iVideo1H, iVideo1L) ; // point to the Video1 image
      media_Video(0, 1) ; // show video

      gfx_Cls();

      // Form2
      media_SetAdd(iForm2H, iForm2L) ; // point to the Form2 image
      // media_Image(0,0);

      // Video2
      media_SetAdd(iVideo2H, iVideo2L) ; // point to the Video2 image
      media_Video(0, 0) ; // show video

      gfx_Cls();


      forever
      endfunc

      Comment


      • #4
        Can you use file, zip project and attach your project here?
        Mark

        Comment


        • #5
          Hello,

          I have your same problem Swoop. I'm working with a uOLED-96-G2 in ViSi environment,

          With the Nemo Video I don't have problems, but when I try to use another video, I get your same window saying "Invalid Floating Point Operation", I used a converter too and I also tried others formats like Mark said but it doesn't works.

          Can you solve the problem Swoop? or Mark, do you have any other advice for us?

          Comment


          • #6
            Well, the last thing I asked Swoop to do was attach his video, and as you have seen he didn't do that, so we're stuck.

            Can you attach your video?

            Can you list the formats you tried converting your video into?
            Mark

            Comment

            Working...
            X