Announcement

Collapse
No announcement yet.

Playing Video Clips at Normal Speed?

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

  • Playing Video Clips at Normal Speed?

    I have no programming background, but I have managed a little success with my project reading through the forums and trial and error. However, I am stuck, and I need help!

    I have one objective for two different displays (uoled-128-G2 and uLCD-43P):

    Objective: Play one video file from the micro sd card when the device is powered on and have it repeat until the device is powered off. That's it.

    I use the graphics composer to format the file to the micro sd (already formatted to FAT, but converting to Raw), however, the 128-g2 plays at half speed, and the 43P plays slower than 1/4 speed.

    I solved the problem for the 128-G2 by speeding up the original video clip in Windows Live Movie Maker to 2x. It plays perfectly on the 128x128 screen without artifacts, etc. The frame rate isn't perfect, but pretty good and isn't that noticeable.

    I can't solve the speed problem with the 43P. I have tried editing the original file to 4x, but the frame rate is horrible and "choppy."

    I tried changing the value for the gfx_Set(FRAME_DELAY, x), but it seems 0 is the default anyway, and negative values are not possible (?).

    What can I do to my original file to help it play better on the 43P? I would love to have it utilize the entire 480x272 screen. I have seen some posts suggest making it smaller. I haven't had success with that either, but I'm probably setting the values incorrectly in the graphics composer (I still get full frame but a smaller frame showing a double image).

    Here is the code I'm using, and it works other than the speed and "choppiness":

    func main()

    gfx_ScreenMode(LANDSCAPE_R) ; // This portion is only on the 43P, but the rest below is the same for both displays

    while(media_Init()==0); // wait if no SD card detected

    repeat
    media_SetAdd(0x0000, 0x0000);
    media_Video(0,0);

    endfunc

    Thanks!
    Sparky

  • #2


    The Picaso display can display about 750,000 pixels per second when using media_Video() ;

    This is about 5.7fps

    The only way you are going to get faster than this is to use less of the screen
    Mark

    Comment


    • #3


      So if the original video is around 30fps, is there something I can do to it to find some compromise? Can I convert the original wmv file to a larger or smaller resolution, smaller or larger bit rate, less fps, AND use less of the screen when converting in graphics composer? Will that help with the speed and refresh rate? Which of those would make the most difference? I can also change the speed of the original file (changing the speed to 2x on the 128-G2 worked almost perfectly), but changing the file to 3x, 4x, etc. to play on the 43p still gives a refresh problem with jumpy, choppy, or scrolling video. I've tried a few different resolutions and tried lowering the fps of the original file, as well as making it smaller on the 43p, but I'm still getting a bad refresh rate.

      I have to imagine that someone has been successful playing video that looks good on the 43p. The application notes for playing video for Picaso shows an example of Finding Nemo. The way I'm doing it, I don't see how playing short clips from something like Finding Nemo would even be possible unless something was done to the original file.

      On another note, I'm not sure I understand the position values to play the video on less of the screen. In the graphics composer, I changed the resolution from the original size (480x272) to 384x216 and set the position to 50, 30 in both the graphics composer and the code in order to center it. That worked fine, other than still not refreshing correctly. However, when I reduced to 256x144, the position of the red square centered in the graphics composer was around 105, 50. When I changed this value in the code, I got a double image: one in the upper left corner and one in the lower right corner, and a little overlap in the middle. ??

      Reading some other threads about slow speed, the moderators often said, "Make the screen smaller," but nothing has been mentioned about the original video file. Also, I've seen other posts using other environments or displays talk about frame commands (usd_Frame?). I'm assuming based on the answer "play in a smaller screen" that there is nothing in the code of any environment that will help make a video file look better.

      I would really love to make this work, as this is just a 5 to 10 minute wmv file that will repeat. I'm not ready to give up because if it works, I'll be purchasing hundreds of these displays for my purpose.

      Thanks
      Sparky

      Comment


      • #4


        Hi SparkyPinball

        In the other thread you posted in (which isn't really related)... I have replied.

        Here it is again:

        Pixel rate, is the number of pixels per second the processor is capable of drawing on the screen. The larger your screen size, the more pixels. The larger the object you have on the screen, the more pixels you need to draw, so the slower the thing is going to be able to draw, and therefore the slower your video is going to play. Reduce the size (physical dimensions) of your video to make it play faster. You are asking too much of the processor.

        The frame delay is the delay in ms between one frame displaying and the next. The frame delay should be set to 0 for fastest 'response', although since the timing starts when the frame starts to display, a lot of 'low values' will appear to have no effect for large frame sizes as the delay will be completely used up in the time it takes to display the frame.

        As we understand it you will need about 11 FPS to stop the image appearing choppy.Unfortunately the software you use may inherently make it more choppy in the process. The reason for this is that the original source may have duplicate frames in it (25fps is often converted to 30fps by simply duplicating every 5th frame). When the software tries to convert it to 11fps it may end up not taking them 'smoothly' from the source material.
        So if you convert it to 11fps using your 'movie maker' you can then bring it into workshop/GC and it will resize it to what you have calculated will give 11fps and it should work properly.

        You could centre the movie and pretty up the surround by putting some sort of image there.

        You need to realise the limitations of the processor. It is not really designed to output full screen video, but when you do you need to know the limits.
        Picaso can output about 750,000 pixels per second when using media_Video()

        I hope that helps

        Regards
        James

        Comment


        • #5


          Thanks James! This helps me a lot because it keeps me from wondering if there's more I could do to either the original file or code.

          I played around with the fps and speed of the original file more, as well as using less of the screen. I have no problem getting the file to play at "normal" speed on a full screen by manipulating the original file, but I can't solve the fps/refresh issue. It looks great if the characters are standing still, but as soon as they move, there's refresh problems. As you said above, I need to realize the limitations. It was sooo close to doing what I wanted, too! The ready-made bezel and mounting brackets were perfect for my purpose!

          This leads me to my next question: I still need to complete this project, as I have a need for hundreds of displays that can repeat one video file upon power-up. Since the 43P isn't the product I need, are there any 4D Systems displays that are capable of playing full screen video at a proper fps (30fps?)? If I used a Beaglebone Black or RPi, does that solve the processing issue, or is it still the limitation of the display? Does the 4DLCD-FT843 have full screen video capabilities?

          I don't know if it's bad form to ask about another company's product on this forum, but if 4D Systems' displays aren't intended for full screen video, are there displays on the market that DO play at the proper fps to run on a BBB or RPi? Would these be TFT's or IPS? Again, sorry if this question is bad form.

          Thanks again.
          Sparky

          Comment


          • #6


            Hi Sparky

            So is all you want to do is play a full screen video?
            If that is what you want to do, then our display solutions may not be the best match for your requirements. They are not designed to be multimedia players, they are designed to be interactive GUI's etc, and just happen to be able to play video, provided you know the limitations.

            Nothing we have will do 30 FPS. If you take a 4.3" display for example which has a resolution of 480x272, and want to achieve 30 FPS, you would need the processor to handle almost 4 Million pixels per second. Our Diablo16 processor is capable of 1.22 Million pixels per second. Picaso which is on a uLCD-43 you have already, is capable of 750K pixels per second. So the most we can achieve out of a Diablo16 4.3" display is about 16 FPS. We are looking at releasing a Diablo16 4.3" Display, however this is still to be confirmed.

            If you want to go to something like the Beaglebone Black and use our 4.3" or 7.0" CAPEs, then yes, you would most likely achieve your 30FPS, however you would then be running Linux or Android and you would have to program those yourself, as our Workshop4 IDE does not cover the BBB.
            Remember though, the BBB is a 1Ghz ARM platform which runs Linux, its not even on the same playing field, designed for a totally different purpose.

            If you went to the Raspberry Pi and connected an external HDMI display, then again you would most likely achieve your 30 FPS, but you again would have to program Linux yourself to achieve whatever you wanted to do. If you connected a SPI display instead of a HDMI display, then you would be more around the 20 FPS mark due to the limit of the bandwidth of the SPI bus.

            The 4DLCD-FT843 will not even do 2 FPS, the FTDI FT800 graphics controller on it is not designed for that.

            Why do you need 30 FPS exactly?

            Totally depends what you are actually trying to achieve.
            Are you doing anything other than playing a video?

            Regards
            James

            Comment


            • #7


              James,

              Yes, all I want to do is play one video file and repeat it. In most instances, the video file would only be a 5 to 15 minute wmv file (no sound), edited from snippets of movie trailers, tv shows, or other user videos. Claiming I need 30fps is probably just a case of my ignorance on the subject. All I really need is for the display to show the video at ANY fps that will make it appear as close to "normal" as possible but in a full screen. When I changed my files last night to 11 fps, 18fps, 22fps, they still looked good full screen, just too much "scrolling" with the actors' movements.

              I am already successfully using the uOLED-128-G2 for a different purpose but in the same way (one file repeated), and although the refresh rate isn't perfect, I'm happy with the way that one looks after changing the original file to 2x the speed. I could probably drop the fps on those file a little, and maybe they'll look even better. I'll be ordering an initial 100 of the 128-G2 as soon as the prototypes for my bezels, wire harnesses, and mounting brackets are tested and approved (by me).

              The appeal of both the 128-G2 and the 43p for my purpose is that it's a single unit with a ready-made bezel (43p), it powers up and begins the video immediately without the delay of a boot-up, menu, etc., and the code is simple to accomplish that.

              If a Diablo16 processor could play 16 fps compared to the 43p (5.7?), then that could be a huge difference, especially if I decrease the fps of the original files.

              Thanks for your help. I don't want to give up on this, and I don't want to have to use a RPi or BBB set up if I can help it.
              Sparky

              Comment


              • #8


                Just for better reference, I posted a youtube video of both displays showing the same video, but these were saved as different files.

                Original file for the 128-G2 saved as wmv: standard 320x240, 1600kbps bit rate, 22fps, sped up 2x. Original speed plays 22 seconds. After converting to the 128-G2 18 seconds.

                For the 43p: widescreen 960x540, 1000kbps bit rate, 18fps, sped up 3x. Original 22 seconds, but after converting is 29 seconds.

                I'm very happy with the 128-G2. The 43p is very close, but not quite there. Action scenes and quick cuts are obviously worse.

                Here's the link to the youtube video: http://youtu.be/cmcSyBri2-w[/video]] 100% 100%
                Sparky

                Comment

                Working...
                X