Skip navigation

Getting a FLV to loop back toward a specific frame using Netstream (as3)

Aug 30, 2012 9:15 AM

Tags: #help #as3 #flv #netstream #loop
  Latest reply: mitwyatt85, Sep 14, 2012 1:55 PM
Replies 1 2 Previous Next
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 5, 2012 7:17 AM   in reply to mitwyatt85

    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.

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 5, 2012 10:31 PM   in reply to mitwyatt85

    what's your url?

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 6, 2012 6:59 AM   in reply to mitwyatt85

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

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 6, 2012 7:29 AM   in reply to mitwyatt85

    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.

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 12, 2012 9:46 AM   in reply to mitwyatt85

    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.

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 12, 2012 1:54 PM   in reply to mitwyatt85

    upload your new flv for testing.

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 12, 2012 3:37 PM   in reply to mitwyatt85

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 12, 2012 5:21 PM   in reply to mitwyatt85

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 12, 2012 8:30 PM   in reply to mitwyatt85

    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

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 13, 2012 7:10 AM   in reply to mitwyatt85
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 13, 2012 12:38 PM   in reply to mitwyatt85

    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

     
    |
    Mark as:
  • kglad
    72,207 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 13, 2012 1:02 PM   in reply to adninjastrator

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 13, 2012 1:59 PM   in reply to mitwyatt85

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 9:35 AM   in reply to mitwyatt85

    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

     
    |
    Mark as:
1 2 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points