taskGnash - The GNU Flash player - Tasks: task #5930, implement DEFINEVIDEOSTREAM (using...


You are not allowed to post comments on this tracker with your current authentification level.

task #5930: implement DEFINEVIDEOSTREAM (using gstreamer & ffmpeg)

Submitted by:  Vitaly Alexeev <alexeev>
Submitted on:  Fri Sep 29 11:53:25 2006  
Should Start On: Thu Sep 28 20:00:00 2006Should be Finished on: Thu Dec 28 21:00:00 2006
Category: NonePriority: 6
Status: DonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: ClosedEffort: 0.00

(Jump to the original submission Jump to the original submission)

Mon May 14 21:59:09 2007, comment #21:


Tomas Groth <tgc>
Mon May 14 21:34:05 2007, comment #20:

I guess we can close this, right ?

Sandro Santilli <strk>
Project Member
Mon Oct 30 09:32:30 2006, comment #19:

Embedded video should have such frame rate as root. Embedded video is not implemented yet. I did not test FLV files. AVI files are played well. But there are problems with synchronization audio & video.

Vitaly Alexeev <alexeev>
Mon Oct 30 09:18:31 2006, comment #18:

One more: When I set the fps to 0.5 then the video is rendered at a slower frame rate too. Seems like embedded video is rendered near 10 times the nominal frame rate (if that does not exceed the FLV frame rate).

Maybe the player works with some sort of sub-frames and does re-rendering checks 10 times per frame. This would be an approximation. As mouse events immediately force re-rendering checks because of the buttons, this probably affects video playback too.

Of couse these are assumptions but even if the player does not really work like that we could implement it this way in Gnash anyway.

Udo Giacomozzi <udog>
Project Member
Mon Oct 30 09:12:08 2006, comment #17:

I analyzed this a bit and it's not exactly how I expected it.

First, the docs say that the frame rate of the player window is fixed to the nominal frame rate when using embedded video. However, this does not apply for streaming videos, which do not use frame-based playback:


So I made a quick test using a short 30fps video and a external FLV file loaded via HTTP.

This page shows the video in a 30fps SWF:

This page shows the same video in a 1 fps SWF:

This is interesting. The SWF is rendered at 1 fps like it should be. You can see that in the little animation at the bottom right. The video is rendered at some slower frame rate, but certainly not at 1 fps. I'd say it's 10 fps or somewhere near to it. Further, when you move the mouse over the plugin, then the video is rendered faster (only better rendering, not faster playback), most probably a re-rendering is triggered due to the mouse events.

Udo Giacomozzi <udog>
Project Member
Mon Oct 30 08:36:28 2006, comment #16:

Is it the video frame being skipped or the animation frame ?
Is there any document stating it ?
I'm aware of documents stating the need to skip animation frames
to keep in sync with audio (ie: execute actions but don't render
the frame).

Sandro Santilli <strk>
Project Member
Mon Oct 30 08:31:11 2006, comment #15:

Yes. Normally you start with a normal flash movie (where you can freely set a frame rate between 0.01 and 120) and add a FLV player component (which is basically an embedded SWF), regardless of the type of FLV connection (Macromedia Server, HTTP, ...).

For automatic online videos like YouTube I guess the framerate is dynamically adjusted depending on the content.

When the frame rate is not very exact (say 31 fps vs. 30 fps) this results in one doubled or skipped frame every X seconds (in the example ~30 seconds). It's hard to notice that.

Udo Giacomozzi <udog>
Project Member
Mon Oct 30 08:12:41 2006, comment #14:

Just a tought: this will be up to the flash developer, right ?
I mean, a conscius developer will have the video and animation frame rates match...
How could we force them to match otherwise ? should we implement
a 'nearest' clocktick seek ?

Sandro Santilli <strk>
Project Member
Sun Oct 29 00:57:04 2006, comment #13:

I was not talking about handling button events but more about rendering issues. I saw complex movies (Macromedia had some car presentations linked on their website when it released Flash 7) that heavily mixed FLV and classic Flash content.
The player will always need to respect the root movie's frame rate which in most cases will be near (or, more probably identical to) the FLV frame rate. Say, that's 30 fps. When you have a FLV that is not exactly 30 fps but very close to it (29 fps or 25 fps...) this results in a final frame rate around 60 fps or so which must be handled by the renderer. This can also happen when both nominal frame rates are identical but are calculated in a different way (different timers).

Most FLV players also have a regularily updated status bar so the invalidated bounds can't help here either.

So, I fear the frame rate feature will really affect playback in a negative way.

BTW, I once saw the complete Blade 2 movie online with a Flash player. The quality was very good, except for the very high video compression. But there was no complain regarding frame rates...

Udo Giacomozzi <udog>
Project Member
Sat Oct 28 20:07:53 2006, comment #12:

First of all I should express the regret in occasion of failure of new release of gnash. I did not know that you plan it to make. I have deliberately laid out a crude videostream because I can not keep up with your changes (in occasion of the claim of Markus). I also have no sufficient free time for test videostream on Linux.
I recognize that I used public fragments of programs. Is it bad ?
Modern Nvidia videocards provide ~10ms per frame, therefore we can simultaneously start 4 films (4 = 1000ms/10ms*4-> 25 FPS) and with good quality. Simultaneously with it we can also to start easy flash animation. It abruptly. In total it can be reached only using modern hardware. The heaviest operation is a scaling. And I tried to avoid it.

Vitaly Alexeev <alexeev>
Sat Oct 28 19:01:32 2006, comment #11:

I haven't read through this new code yet, but my general thought is to see how video is most often used. As far as I can tell, often a Flash based video player is limited to a few control buttons, and plays a single FLV movie at a time. So it seems that in this case Gnash should be optimized to make the video play with good quality, and it shouldn't be hard to still handle events froom the control buttons. Especially on an embedded target, once this works with AGG, I doubt any ARM based target could handle more than a single FLV at a time anyway.

Rob Savoye <rsavoye>
Project Administrator
Fri Oct 27 17:12:50 2006, comment #10:

Rob, are you sure it's a good idea to have asynchroneous video playback? This would pratically result in a summed frame rate that must be handled by the renderer (the nomal frame rate + the frame rate of all videos.

Just think of a 15 fps SWF containing a 14 fps FLV and a 16 fps FLV. In theory this would result in a much higher frame rate if you really want match all of them. Remember there can be any vector shape over the video which means the render handler would have a hard job...

Udo Giacomozzi <udog>
Project Member
Fri Oct 27 15:28:28 2006, comment #9:

The next my task - synchronization of audio & video streams.

Vitaly Alexeev <alexeev>
Thu Oct 12 16:57:13 2006, comment #8:

I would actually like to see the video support in Gnash play a video stream or file at higher than the Flash movie framerates. This would let us play "dvd quality" video, unlike any existing Flash player. The way to do this is to fire up a background thread to play the video. Usually with Flash based audio or video players the only Flash being executed is just the player control buttons.

We also want the video support to work with the AGG backend as well as OpenGL. People embedding Gnash want video support too.

Rob Savoye <rsavoye>
Project Administrator
Thu Oct 12 14:11:51 2006, comment #7:

>>Does anybody know if this is possible with the current model?

no problem

>>but NetStream doesn't exist.

I'm doing the play method of NetStream

avcodec return images in YUV 420 format (one luminance and two chrominance channels, with the chrominance channels samples at half the spatial resolution of the luminance channel).

Does anybody know how to show the image of this format using OpenGL without intermediate converting to RGB and texture creation?

Vitaly Alexeev <alexeev>
Wed Oct 11 22:13:19 2006, comment #6:

So about the "dynamic" video streams... That means that we need to be able to display the external video at a higher framerate than the SWF who loaded the video...
Does anybody know if this is possible with the current model?

Tomas Groth <tgc>
Wed Oct 11 15:43:05 2006, comment #5:

NetConnection now works, but NetStream doesn't exist. I've been putzing with these on and off for a while. To make this work, I decided that adding RTMP/RTMPT/RTMPTS support to libCURL was the wasy to do this so all of the existing code in Gnash would "just work". Currently RTMPT works, RTMPTS is mostly done, and RTMP (which needs AMF support as well) is in progress and about 3/4 done. You can grab my snapshot of libCurl with RTMP support from http://www.welcomehome.org/gnash/curl-080206.tar.bz2.

Rob Savoye <rsavoye>
Project Administrator
Wed Oct 11 14:34:31 2006, comment #4:

Thanks for the offer of the help. Implementation of embedded video has no big importance for me, because: frame rate of embedded video should be same as at root movie, embedded video has no sound.

It is much more interesting to do implementation of "dynamic" video streams, which is started approximately so:

var my_nc:NetConnection = new NetConnection();
var my_ns:NetStream = new NetStream(my_nc);

Vitaly Alexeev <alexeev>
Wed Oct 11 13:12:55 2006, comment #3:

Ok, let me know if you need any help (not on windows stuff though...). I suggest you have a look at the gplflash2 source which has support for embedded video, which might give an example as to how it can be done.

Tomas Groth <tgc>
Wed Oct 11 12:00:32 2006, comment #2:

I agree with "Using ffmpeg directly might be an easier solution than using gstreamer... "
I at last have compiled ffmpeg on VC++ and have received necessary DLL's. I understand with ffplay.c to begin programming Flash videostream

Vitaly Alexeev <alexeev>
Mon Oct 9 13:52:28 2006, comment #1:

Using ffmpeg directly might be an easier solution than using gstreamer...
My suggested solution to this is to make a videohandler (same style as the sound handlers), which will make it more generic...

Tomas Groth <tgc>
Fri Sep 29 11:53:25 2006, original submission:
Vitaly Alexeev <alexeev>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by tgc (Posted a comment)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by alexeev (Updated the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon May 14 21:59:09 2007tgcStatusReady For Test=>Done
    Mon May 14 21:34:05 2007strkCarbon-Copy-=>Added tgc
    Fri Dec 1 10:43:56 2006alexeevAssigned toalexeev=>None
    Fri Oct 27 15:31:05 2006alexeevStatusNeed Info=>Ready For Test
    Fri Oct 27 15:28:28 2006alexeevStatusIn Progress=>Need Info
    Mon Oct 2 07:32:09 2006strkCarbon-Copy-=>Added strk

    Back to the top

    Powered by Savane 3.1-cleanup