1 2 Previous Next 68 Replies Latest reply: Sep 14, 2012 1:55 PM by mitwyatt85 Go to original post RSS
      • 40. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
        kglad CommunityMVP

        you must have a keyframe at that seek location.  seek goes to the closest keyframe.  when you encode your video you can assign a keyframe.

         

        or, you can use the flvplayback component (instead of using netstream) to play your video.  that class has a seek method that allows you to do seek to the closest 10,000th second.

        • 41. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
          mitwyatt85

          You're damn right! I re-encoded my FLV with key frames at every frame, and now it's smooth as butter when I do a test movie within my Flash project. The only issue now is my publishing - when I publish my project as a .SWF in the same directory as my FLV it plays and freezes on the last-frame when I load it in a webbrowser (which will be it's final viewing format), its like the .swf isn't containing/reading the AS3 code in it. Anyway, I'm quite happy this is actually working now. Here's my code and publishing settings for reference:

           

          AS3 code:

           

          var video:Video=new Video(1980,1020);

          addChild(video);

          var nc:NetConnection = new NetConnection();

          nc.connect(null);

          var ns:NetStream=new NetStream(nc);

          this.addEventListener(Event.ENTER_FRAME,f);

          ns.client = this;

          video.attachNetStream(ns);

          ns.play("All.flv");

          function onMetaData(obj:Object):void{

           

           

              trace(obj.duration);

           

           

          }

          function f(e:Event):void {

          if(ns.time>14){

          trace(ns.time);

          }

          if(ns.time>16.24){

          ns.seek(10.61);

          };

          }

          My .swf publishing settings are as follow:

           

          Player: Flash Flayer 10

          Script: ActionScript 3.0

          JPEG quality 100

          Audio Stream/Event: both disabled

          Compress movie: off

          Include hidden layers: off

          Include XMP metadata: off

          Export SWC: off

          trace and debug: all are off

          Local playback security: Access local files only (if i use the network option the .swf is blank when I load it in a webbrowser)

          Hardware Acceleration: Level 2 -GPU

          Script time limit: 15 seconds

          • 44. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
            kglad CommunityMVP

            what's that url have to do with this thread?  (but that is a nice looking html page.)

            • 45. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
              mitwyatt85 Community Member

              I thought you wanted me to share the URL I intend to host the .SWF you've been helping me with.  Could you be a little bit more specific, for my own sake.

              • 46. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                kglad CommunityMVP

                you said, "..it's smooth as butter when I do a test movie within my Flash project. The only issue now is my publishing - when I publish my project as a .SWF in the same directory as my FLV it plays and freezes on the last-frame when I load it in a webbrowser..."

                 

                i wanted to see what you were testing in your browser.  so, upload your swf and embedding html to your server and post a link to the embedding html so i can view it in my browser.

                • 47. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                  mitwyatt85 Community Member

                  Sure, I just made a html file and inserted my swf in it. It plays all the way through and stops at the last frame, but for some strange reason several seconds later it will play through the loop, pause at the last frame for a while and play the loop again, you will have to wait a moment to see it happen:

                   

                  http://mitchpatrick.com/art/Int_Medium.html

                   

                  And again, if I test the movie within the Flash program itself, it runs fine.

                   

                  *PS: For some reason it's also a little sluggish on the first load. Basically it's boiling down to this - the .SWF file plays fine in the adobe flash player, but does not play correctly in an HTML file within Safari or Google Chrome.

                  • 48. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                    mitwyatt85 Community Member

                    Hmmm, is there no solution available to get this loop running correctly in a web-browser? The as3 code/FLV is working just fine, with no glitches, in the stand-alone flash player. 

                    • 49. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                      kglad CommunityMVP

                      no kidding. your bitrate is 10,000!  that's a bit much. 

                       

                      who encoded that flv?  why don't you try a more reasonable bitrate like 400 or so.

                      • 50. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                        mitwyatt85 Community Member

                        Oh, I thought you left me in the dark. I encoded it, sorry I was pandering toward quality. I'll re-encode with a lower bit-rate for the web version. I'll update you with my results soon.

                         

                        Thank you.

                        • 51. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                          mitwyatt85 Community Member

                          Okay, so I re-encoded my video with bit rate of 400, (with keyframes at every frame). Same issue is happening, the .swf plays fine in the Flash stand-alone-player, but when the .swf is loaded into a web-browser it hangs on the last frame a while before looping. I tested in both Google Chrome and Safari. The FLV video clearly is the new one (400 bitrate), due to the lower visual quality. As a detail, the new .flv is at 15mb, the older one was at 46mb, though this hasn't made a difference in the video hanging at the end before the loop action.

                          • 52. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                            kglad CommunityMVP

                            upload your new flv for testing.

                            • 53. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                              mitwyatt85 Community Member

                              Okay here it is:

                               

                              http://mitchpatrick.com/art/Int_Medium.html

                               

                              *loads at original size, zoom out to see the entire video.

                              • 54. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                kglad CommunityMVP

                                this still has a glitch especially the first time through the video but thereafter it's not bad:  http://www.kglad.com/Files/forums/main.html

                                 

                                you can remove the first time glitch by preloading your flv or using the lower bitrate video.

                                • 55. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                  adninjastrator Community Member

                                  Is there some very special reason that the video needs to display at such large dimensions? As a consumer (who happens to have a fair amount of Flash and video production experience) I just don't get the message of the video, the purpose behind it. And making me wait and wait watching a jerky video, only confuses me further.

                                  A smaller dimension and lower bitrate video that works correctly and effectively focuses on the message behind the video, may very well be a much better choice than continually attempting to "fix" a video that from the outset has a very shakey foundation.

                                  Contrast your video with the link I posted earlier.... which loops back to a set point in the video using NetStream:

                                  http://www.cidigitalmedia.com/tutorials/loop_vid/loop_vid.html

                                  What exactly is happening in the frame that you are attempting to loop back to? Is that really needed? Can it be done some other way? Can you use a smaller, lower bitrate video and do a better job in getting your message across?

                                  Just trying to help here so I hope you take this suggestion in the spirit with which it is intended.

                                  Best wishes,

                                  Adninjastrator

                                  • 56. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                    mitwyatt85 Community Member

                                    Yes, everything is needed, it's a peice of video art that I'm putting together for a show. The tailoring of the video itself is fine. The frame it loop backs to is the beginning of a palindrome loop, after the start of the video it will sustain the seamless loop that happens towards the end. It's very simple. I just need to either put a preloader on it (personally I think it would take away from the work), or reduce the bit-rate and make the video itself smaller. The "non"/original web version will be sized at 1920 x 1080p, the web version looks as if it will have to be much smaller in screensize and bitrate.

                                    • 57. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                      adninjastrator Community Member

                                      So the "Show" version is a kiosk or non-Web version?

                                      A pre-loader (which doesn't actually pre-load anything... it just hopefully distracts the viewer long enough for them to download the full 15MB of data) is only needed when viewing via Internet (not kiosk based). And if the viewer has to wait too long... forget it!

                                      If you've not done much work with video bitrate vs display dimensions, here is an old post that may help with background information. The really important part is the correlation between display size and required video bit rate. Doubling the display size does NOT double the required video bit rate... so a jump from 320 x 240 to 640 x 480 for example requires 4 TIMES THE BITRATE to achieve equal quality. And once this bitrate exceeds the download speed of your visitors... you are in trouble... as per your first video encoding.

                                      Anyway, for your review:

                                      Video bit rate

                                      Video bitrate is the minimum amount of data that must continually flow into the video player in order for the player to display that particular video uninterrupted. If that supply of data is not high enough, the video player will stop…. Wait for more data to download, then resume. The video bitrate is set as a parameter when the video is encoded.

                                      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.

                                       

                                      Best wishes,

                                      Adninjastrator

                                      • 59. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                        mitwyatt85 Community Member

                                        I re-encoded the video, it is now at 768 x 432 pixels with a bitrate of around 500, and still - freezing occurs on the last frame when played in a web browser

                                         

                                        *Please also note that when I open the file in a web-browser such as Chrome or Safari - it's a file thats on my computer (right click-open with) , it doesn't need to download/stream anything from a server, and it still freezes - why is that?

                                         

                                        *Also when I encoded the video it says the file output size will be something 835kb but the file ends up being 18megs? Why is that?

                                         

                                         

                                        *The display dimensions are looking good now at-least (not as BIG) maybe the file size should be much lower? - This is strange because I have other flash videos on my website that are around the same size and they load without a hitch.

                                         

                                        http://mitchpatrick.com/art/L2.html

                                         

                                        ::Pulling hair out::

                                         

                                         

                                         

                                        PS: Also I notice when the video eventually loops, that the time in-between the loops change each time - sometimes 5 seconds, sometimes 1 second, sometimes ten, one minute, etc, etc, whatever.

                                        • 60. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                          mitwyatt85 Community Member

                                          I saw what you posted on your domain, still a little sluggish and size is too big. See my reasponse to Adninjastrator - updates have been made, size is now at a good spot, just need to get the thing to loop smoothly when played in a browser.

                                          • 61. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                            adninjastrator Community Member

                                            From what I'm seeing in both kglad's and your post of the video, the video really seems to be having problems. That is, it's very jerky and slow to load.

                                            Also, when I view the file in my cache it shows up as an html file, not an .flv file.

                                            Is this the correct address to direct download the video? We should be able to direct download the .flv if in fact it is a .flv file.

                                            http://mitchpatrick.com/art/All_w.flv

                                            The reason I ask is that I'd like to see the plain .flv, without adding in the looping problem. I think there is something wrong with the video and viewing it straight, whithout any looping may give some indication of what the problem is.

                                            I'd suggest that you first get a smooth running version of the video (no looping). Do not play the video from your cache, upload to your server and delete your cache and see if you can get the jerkiness out of the video.

                                            Also, the link you posted above is NOT displaying at 768 x 432, it's much smaller than that.... yet anoter problem with the video.

                                            While you may be able to see the looping point, there is so much jerkiness in the rest of the video that from a new viewers point of view, it's not an issues... it's the rest of the video that has the problems.

                                            So can you post a non-looping, just play from start to finish version to verify that the video is OK.

                                            Best wishes,

                                            Adninjastrator

                                            • 62. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                              mitwyatt85 Community Member

                                              Ok, here is a link where you can download the .FLV I'm using in the web version:

                                               

                                              http://www.mediafire.com/?mayf8h56i4qwesz

                                               

                                              The video is at 768 x 432p, but for some reason the html page loads it at a smaller size, so you have to manually zoom in.

                                               

                                              Some details about the .flv:

                                               

                                              - Before encoding I put a Flash cue point on the exact time where the video should loop back to when it ends, the cue point is at 10.18 seconds (which is where the palindrome loop starts).  (maybe this cuepoint is causing an issue?)

                                               

                                              - In my encoding settings I set my keyframe distance at 1 instead of the default 30, so my loop will hit more accurately. (maybe this is causing the issue?) though when I wasn't using this setting my loop wasnt working correctly, when I set my keyframe distance to 1 it loops perfectly (when played in the stand-alone flash player)

                                               

                                               

                                              Hope these details give you some insight to the problem. Thank you for all the valuable feedback thus far.

                                               

                                              -mitch

                                              • 63. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                kglad CommunityMVP

                                                that one is going to be slow to load because his bitrate is 10,000.  but once it loads it's ok and like i mentioned, it can be preloaded if the 400bitrate video is unacceptable.

                                                • 64. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                  adninjastrator Community Member

                                                  I was attempting to direct download the .flv from the URL used for the .flv in this link:

                                                  http://mitchpatrick.com/art/L2.html

                                                  my cache shows the file here:

                                                  http://mitchpatrick.com/art/All_w.flv

                                                  but that does not download a working .flv file. Wonder why that is!!

                                                  We should be able to access the .flv file just like the .swf player file does... same URL as used in the player, but in this case there seems to be some error.

                                                  I'm not a great fan of pre-loading .flv files, though that is sometimes a work-around when bit-rate is too high or there are some other issues with the .flv file. I'd rather see the file correctly sized for the application.

                                                  Best wishes,

                                                  Adninjastrator

                                                  • 65. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                    mitwyatt85 Community Member

                                                    I've uploaded the .FLV im using to mediafire:

                                                     

                                                    http://www.mediafire.com/?mayf8h56i4qwesz

                                                     

                                                    see post 62 above.

                                                    • 66. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                      adninjastrator Community Member

                                                      Thanks for the link, but what I was really hoping to test was the URL used in your .swf to load the video... not a zipped file fo the video. This direct URL download as used in the .swf is just one of the basic trouble shooting steps for .flv video.

                                                      Anyway, I did download the video file from the link you listed and now have a better feel for what you are attempting to accomplish. One thing to note, to make a seemless jump from the last frame of a video to some earlier point in the video means that the last frame must match EXACTLY the frame you are looping back to.

                                                      In the case of your video, you have a moving hand holding a camera phone. Matching exactly the very last and the loop to frame is a VERY difficult job because of the movement, camera angle, lighting, etc.

                                                      Using the suggested 10.18 loop to point, you'll notice that the over the shoulder camera has not yet gained correct focus on the hands. Second, the hands are not in EXACTLY the same position as they are in the last frame. So the jump from last frame to 10.18 makes the hands jump (positions don't match exactly) and the hands are a little blurry (the camera has not yet quite grabbed correct focus).

                                                      I played around with a couple other loop to points, and while none match exactly, I think 11.426 matches the last frame a little better. See samples and compare here:

                                                      http://www.exploreolympics.com/stal/seek_to_and_loop.html

                                                      I don't see any hestitation or problems with looping in these samples

                                                      As for your code, if you are using ns.seek, there is no need to use a cue point, The "seek" method is sometimes referred to as a pseudo cue point, that is, it can trigger events just like a cue point. So yes, the cue point may be throwing things off. Start by eliminating that.

                                                      Second, I would still suggest that you post on a Web page a none looping version of your video to ensure that the loading and playing the video via NetStream is correctly done. Only after you have a working, none looping version displaying correctly from a Web server (NOT on your local machine) would you move to adding in the looping... Not trying to tell you how to run your project, just pointing out some basic trouble shooting steps. Eliminate ALL other possible problems before moving to the looping phase.

                                                      And I say this because as you can see from my examples, you should be able to loop using NetStream very easily.

                                                      Best wishes,

                                                      Adninjastrator

                                                      • 67. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                        mitwyatt85 Community Member

                                                        Okay, so I re-encoded the video this time without the Flash cue point inserted in the timeline. I loaded my Flash project and re-published (both the .swf and an html file). I believe the issue at hand is not how this is playing on the web. What is concerning me is why the .swf is not playing correctly in a web browser when I just simply open the html or .swf on my local machine into something like Google Chrome or Safari. If it's not looping correctly when loaded directly from my machine, then I think it's safe to say that it wont loop when I put it on my server. Again, it plays fine in the stand-alone Flash Player.

                                                         

                                                        ****WHOA*** So, I just decided to start a new project and copy/paste the as3 code I'm using in the previous project, NOW - all of sudden it's working in my webbrowser now when loaded off my machine. I think my project file was corrupted? Wow. Let me try putting it on my server now.

                                                         

                                                        Message was edited by: mitwyatt85

                                                        • 68. Re: Getting a FLV to loop back toward a specific frame using Netstream (as3)
                                                          mitwyatt85 Community Member

                                                          UDATE: Now we're getting somewhere. For some unknown reason(s) this thing wasn't looping right when my project file fps was set 29.97, though when set at 24fps it loops fine in webrowsers now, that was just a detail I noticed when I was combing through all the pre-publishing options. Anyway, I'm sure there were other possible reasons why it just wasnt working right. Please give this a try:

                                                           

                                                          http://mitchpatrick.com/work2012.html

                                                           

                                                          (click on INT_MEDIUM) should pop up a window at the correct frame-size, on first load it lags sightly but its looping fine now. Maybe all that's needing adjustment is my bitrate settings to get it near perfect, but it may be in a good place as it is.

                                                           

                                                           

                                                          Thanks.

                                                          1 2 Previous Next