10 Replies Latest reply on May 19, 2011 8:10 AM by adninjastrator

    Video quality with flv component

    qpidity72 Level 1

      Hi,

       

      I'm trying to improve the reproduction of a video incorporated into a website. The original .mov was 60 MB at 1280 x 720px. Using the Adobe media encoder I converted to FLV ( to add cue points for several small mc animations) and reduced dimensions to obtain filesize of 12MB. Video was brought into the SWF with the flv component. File loads quickly enough online- not too much in the way of delays waiting for video to start etc, however the reproduction is a little jumpy in several places and a little out of sync. I'm wondering if this is completely a result of the conversion process or whether the flv component might also be struggling with this filesize. I believe there is a FLVPlayback 2.5 component I released after my flash version CS4. Could anyone advise if I would gain improvements in the reproduction if I used this instead ?

       

      Also - throughout the video I appear to have gained what looks like borders around the video, but only on the left and right sides, not all the way around (see screenshot). I'm not entirely sure whether this is a result of the conversion process with the adobe media encoder or whether this is something which has resulted within the flash file. And also on the last frame, the background colour of the video is completely strange. I had set to match the webpage, however as you can see in the screenshot attached, there's a strange graduation in colour that simply does not make sense to me - I would very much like to resolve as it looks very unprofesional.

       

      Grateful for any assistance with any of the above issues

       

      Thanks so much in advance !

      Picture 49.png

        • 1. Re: Video quality with flv component
          adninjastrator Level 4

          On your first point of quality and file size, they are really un-related. Only when you concider the video bitrate and display dimensions can you judge whether a particular file size will result in a good quality or poor quality video. The FLV Playback component really does not affect the quality one way or another.. it only displays what it's told to display. If you have other issues like

          "however the reproduction is a little jumpy in several places and a little out of sync"

          it's more likely that something was introduced during the conversion process.

          But first, a little review of video bitrate:

          Video bit rate

           

          One of the principle of goal setting is to "Begin with the end in mind". In this case it'll be very hard to give good recommendations because the end is not defined. So I'll just make a few assumptions and you can correct me as needed.
          First, I'll assume that since you are converting to Flash, you want to deliver this video over the Internet. If that's true, then we'll have to make some assumptions on the Internet connection download speeds of your potential viewers. Let's just say that most have at least a 1.5Mb connection or faster.
          OK, that would mean that a video bitrate of half that should usually provide a video download that is not interupped by buffering (most of the time anyway). So assuming a video bitrate of 750kbps, what would the optimum display dimensions be?
          Before we decide, here's a little info about bitrate. For highest quality playback, the video bitrate is tied directly to the display dimensions. That is, the larger the display, the more incoming data is required to properly display the video. Think of bitrate in terms of a can of paint. If you have 1 quart of paint, you might be able to do a very nice job on a 32 X 24 foot area. But if you try to stretch that same amount of paint out over a 64 X 48 foot area, the coverage will not be nearly as good and you get poor results.
          In the same way, a video displayed at 640 X 480 pixels will require 4 times the bitrate as a video displayed at 320 X 240 pixels to produce the same quality. So for example a video with a bitrate of 100kbps, displayed at 160 X 120 will produce the same quality results as a video with a bitrate of 1600kbps if displayed at 640 X 480.
          So to boil it all down, video bitrates of 750kbps, even up to 1000kbps can usually get delivered of the Internet on most high speed connections. Higher bit rates may work for really fast connections but will cause problems for viewers with slower connections. Video display size has a direct bearing on the final quality. In the 750 to 1000kbps range, display size should be kept around 450 or 500 width max (and whatever height the aspect ratio calls for). Yes it can be displayed larger, but the quality will suffer.
          Sound like your audio settings are fine, especially for Internet delivery.
          As for framerate, maintain the original raw video framerate for best results. So if the video was shot at 24fps, leave it.
          As for video converters, do you have the Flash 8 Video Converter? It works just fine for video to be delivered over the Internet. Remember, you are taking a Cadillac version of video (h.264 HD) and stuffing it into a Chevy body to get it to work over the Internet.

          As for slight borders in the display, it's most likely that somewhere in the conversion process or setting the dimensions of the FLVPlayback that the display/video dimensions got mismatched... even by a few pixels. So video is 480 x 360 while FLVPlayback is 480 x 356 or something like that. There is also the possibility that the FLVPlayback is trying to maintain the correct aspect ratio but the dimension is just a little off. So if the display is a little too short for the width, you could get black bars on either side. If the display is a little too narrow for the height, you will get black bars top and bottom.

          So play with the display dimensions and see if you can correct it. If you can't, it may be in the video itself... test in another, FLV video player.

          Best of luck on your project!

          Adninjastrator

          1 person found this helpful
          • 2. Re: Video quality with flv component
            qpidity72 Level 1

            Thanks so so much adninjastrator for your very helpful reply ! There's a lot of information there which I just simply did not know, so armed with that now I should hopefully work toward much better results.

             

            The client wanted the video to be made available online at full site width. (I personally feel this is very optimistic, especially in order to have the video display at best quality possible). I took the .mov supplied and converted it from 1280 x720 pixels to 950 x 534 px, maintained the frame rate of the original video, and I used a bitrate of 1500 I think ( it was a default and to be honest I was really just experimenting at that stage). The results I have to admit are not bad considering, but as I say, we need the quality to be better. I think I have better than average internet connection speed here so more than likely the reproduction will suffer more with other users.

             

            You recommend max video width for online viewing of 500px - do you think we'd be silly to aim for somewhere around 650 px ? I was hoping this would be an achievable compromise. The content is very very visually appealing and my client wants to maximise it's effect as much as possible.

             

            Thanks for the advice about why we might be getting those black bars. I'll try as suggested with the dimensions. Any thoughts about that strange background colour ? Not sure if it was obvious in the screenshot but about one fifth of the area is appearing like a  gradient.

             

            Many thanks again.

            • 3. Re: Video quality with flv component
              adninjastrator Level 4

              Glad you found the article helpful.

              As for the exact display size, I'm really just giving some suggestions and principles so you can figure what works best for you.

              The suggestion of a 500px width is so that the bitrate can be low enough that most viewers can download without problems. Nothing is more frustrating than to have a video stop/start, stop/start as it buffers because the bitrate is too high for my Internet connection download speed.

              So a quick little comparison of bitrate requirements for two different display sizes with the goal of producing equal quality in both:

              500 x 282 = 141000px

              650 x 366 = 237900px

              the larger display size is approx 1.7 times larger than the smaller so in theory, to produce the exact same quality video in the large display as in the smaller, the bitrate should be 1.7 times greater.

              So a 1000kbps bitrate video displayed in 500 x 282 would require 1700kbps bitrate to display equal quality at 650 x 366.

              Again, these are just suggestions, there is no one set answer that will work for everyone. but understanding the principles of bitrate and it's relation to display size will help you make a more informed choice.

              I really can't see the background. However, using a second FLV player to test your videos can often help determine if the problem is in the video itself or if the problem is the player.

              Here is a free, little FLV editor that you can use to test (and/or edit) .flv files:

              http://download.cnet.com/Moyea-FLV-Editor-Lite/3000-2168_4-10912717.html

              Open your file in there and take a look. If there is something that needs to be trimmed at the end, you can do that in this little editor without having to re-render the video file. You can also combine 2 or more flvs, again without re-rendering.

              Best wishes,

              Adninjastrator

              • 4. Re: Video quality with flv component
                qpidity72 Level 1

                I've managed to resolve the border issue - it was to do with the dimensions. As for the background colour - I'll look at your suggestion to use that Flash 8 converter - is there an equivalent for the Mac ?

                 

                One really strange and annoying issue which has come up. I have created two different sized fla's for testing purposes, each with different video dimensions....I've used the same cue points for both, however in one version the events are simply not at the correct point in the video. I've tried re-doing the conversion to add the cue points again and still the result is incorrect, but only in one version. No matter what I do the last two events keeps coming in about 8 seconds too early. I feel like I'm going insane with this  because the cue points are set at exactly the same time in the video- has anyone come across this before who can advise what the issue might be ??

                 

                Thanks in advance.

                 

                BTW I've checked the cue points in the flv component and they are listed correctly, so that makes this even stranger !

                 

                Message was edited by: qpidity72

                • 5. Re: Video quality with flv component
                  adninjastrator Level 4

                  As for the cue point issue, I'd suggest starting a new thread, it may just end up buried in here.

                  Not sure how you are assigning cue points and whether AS2 or AS3, so there may be a number of possible causes... best to fill in exactly how and what.

                  Are you using NetStream or the FLVPlayback? Are you embedding cue points or assigning dynamically?

                  If you are using NetStream there is a method sometimes called "psuedo cue points" where you just listen for a time in the video and at a certain time you fire of a function. it's not really a cue point... hence the name. Don't have any links or articles I can point to right now but maybe this will help:

                  http://www.quip.net/blog/2007/flash/how-to-use-flash-video-cue-points

                  or Google for "Flash psuedo cue points' for more info on that method.

                  As for the conversion, is the vidoe corrupteddifferent in any way, one compared to the other? Do they have the exact number of frames? Can you read or trace the metadata? It will give exact length, dimensions, etc.

                  This will trace the metadata in an flv file played using NetStream when testing in Flash:

                   

                  // Trace the metadata  //
                  ns.onMetaData = function(myMeta) {
                  for (var i in myMeta) {
                    trace(i + ":\t" + myMeta[i])
                  }
                  }

                   

                  Or you may be able to extract the metadata some other way... Google for more info.

                  Best wishes,

                  Adninjastrator

                  • 6. Re: Video quality with flv component
                    qpidity72 Level 1

                    Hi again,

                     

                    Thanks for getting back to me.

                     

                    I set the cue points in Adobe Media Encoder. I created two flv versions of the video, differing only in dimensions, each with the same 4 cue points. Each version went into a separate .fla, identical only for the size of the video. So very curious that one .fla produces the correct result and the other doesn't. I am starting to think something has become corrupt somewhere along the way, but just in case, here's the code I'm using to fire the events:-

                     

                    import fl.video.FLVPlayback;
                    import fl.video.VideoEvent;
                    import fl.video.MetadataEvent;

                     

                    //set up functions for credits fading in and out
                    mc_credit.alpha = 0;

                     

                    function fadeCreditIn():void
                    {
                    Tweener.addTween(mc_credit, {alpha:1, time:4, transition:"easeInOut" });
                       
                        }
                       
                    function fadeCreditOut():void
                    {
                    Tweener.addTween(mc_credit, {alpha:0, time:3, transition:"easeInOut" });
                       
                        }
                       
                    my_flv.addEventListener(MetadataEvent.CUE_POINT, cueFunction1);

                     

                    function cueFunction1(evt:MetadataEvent):void{
                    if(evt.info.name == "01fade-in")
                    { fadeCreditIn();}
                    if(evt.info.name =="01fade-out")
                    { fadeCreditOut();}
                    if(evt.info.name == "02fade-in")
                    { fadeCreditIn();}
                    if(evt.info.name =="02fade-out")
                    { fadeCreditOut();}
                    }

                     

                    The first fade in and fade out works correctly but the second round fired by cue points 02fade-in and 02-fade-out doesn't appear at all.I really am perplexed. To my mind there is nothing wrong with this code. What's more it's the same code used in the other fla and it all works perfectly there.

                    • 7. Re: Video quality with flv component
                      adninjastrator Level 4

                      Perhaps a class missing for the non-working version?

                      Or mis-naming of something in the actionscript that is NOT a part of the cue points but rather the fade functions?

                      Can you put together a simple little timeline (non-flv cue point) version of the fade in / fade out and get it to run thru the sequence a couple times?

                      Are you tracing the cue points so that you know when and if they fire? something like:

                       

                      ns.onCuePoint = function(evt:Object){
                          trace(evt.name);
                          trace(evt.time);
                          if(evt.name == "play_vid1") {
                              trace("YO!Loading wide_holder!");
                              wide_holder.loadMovie("rm/images/black_bear.swf");
                          }

                          if(evt.name == "play_vid2") {
                        trace("YO!Loading standard_holder!");
                              standard_holder.loadMovie("rm/images/sqis.swf");
                          }
                      };

                       

                      I really don't know...  just asking questions now..

                      Best of luck!

                      Adninjastrator

                      • 8. Re: Video quality with flv component
                        qpidity72 Level 1

                        Curiouser and curiouser.

                         

                        Traced the cuepoints using the following code:

                         

                        my_flv.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
                        function cp_listener(eventObject:MetadataEvent):void {
                                trace("Elapsed time in seconds: " + my_flv.playheadTime);
                                trace("Cue point name is: " + eventObject.info.name);
                                trace("Cue point type is: " + eventObject.info.type);
                        }

                         

                        Strangely the cuepoints are indeed registering.

                         

                        Elapsed time in seconds: 2.6029999999999998
                        Cue point name is: 01fade-in
                        Cue point type is: event
                        Elapsed time in seconds: 8.375
                        Cue point name is: 01fade-out
                        Cue point type is: event
                        Elapsed time in seconds: 55.455
                        Cue point name is: 02fade-in
                        Cue point type is: event
                        Elapsed time in seconds: 58.926
                        Cue point name is: 02fade-out
                        Cue point type is: event

                         

                        Going to double check other items as you mentioned to see if Ive just made a typo somewhere...

                        • 9. Re: Video quality with flv component
                          qpidity72 Level 1

                          After stepping away from this project for a few hours I discovered that there was an anomoly with the movie clip in that particular .fla in that it was holding a nested mc with the same name. So I once I corrected for this my cue point events are now being fired the desired fade-ins and fade-outs are working correctly. Thanks again though for all the advice - I have learnt a mountain load as a result of all the advice.

                          • 10. Re: Video quality with flv component
                            adninjastrator Level 4

                            Glad it all worked out in the end!

                            Best wishes,

                            Adninjastrator