After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628764 - [videorate] add new option for max frame rate
[videorate] add new option for max frame rate
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 564957
 
 
Reported: 2010-09-04 11:48 UTC by Oleksij Rempel
Modified: 2011-06-15 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vfr-max-mode.patch v1 (3.12 KB, patch)
2010-09-04 11:50 UTC, Oleksij Rempel
none Details | Review
git ready patch (3.82 KB, patch)
2010-09-04 12:11 UTC, Oleksij Rempel
none Details | Review
videorate: optionally only drop frames to ensure max frame rate (4.05 KB, patch)
2011-05-02 09:49 UTC, Mark Nauwelaerts
committed Details | Review
videorate: optionally ensure max average framerate (8.23 KB, patch)
2011-05-02 09:57 UTC, Mark Nauwelaerts
committed Details | Review

Description Oleksij Rempel 2010-09-04 11:48:51 UTC
In some situations there is good to work with variable frame rate. But we need to be sure we have not too match frames. So we will have for example 1-15 fps and every thing over should be dropped.
Comment 1 Oleksij Rempel 2010-09-04 11:50:05 UTC
Created attachment 169478 [details] [review]
vfr-max-mode.patch v1

This my patch what add this option.
Comment 2 Oleksij Rempel 2010-09-04 12:11:41 UTC
Created attachment 169481 [details] [review]
git ready patch
Comment 3 Oleksij Rempel 2010-09-04 18:20:20 UTC
i didn't noticed new videomaxrate plugin. There is no need of this patch anymore
Comment 4 Olivier Crête 2010-09-04 18:56:25 UTC
Maybe the videomaxrate plugin should be merged into videorate. That said, videomaxrate works a bit differently, it give you a max average frame rate (so it doesn't guarantee that the time between two frames is less than framerate/1). If you use the naive approach (just drop frames but not duplicate), you end up with the risk that if you start with 11fps but want 10fps, it may instead drop 50% of the frames (because the time between two incoming frame is always a bit more than 1/10s) and you end up with 6 fps.
Comment 5 Sebastian Dröge (slomo) 2010-09-04 21:47:55 UTC
Merging videorate and videomaxrate makes sense IMHO
Comment 6 Oleksij Rempel 2010-09-11 06:53:14 UTC
(In reply to comment #4)
> Maybe the videomaxrate plugin should be merged into videorate. That said,
> videomaxrate works a bit differently, it give you a max average frame rate (so
> it doesn't guarantee that the time between two frames is less than
> framerate/1). If you use the naive approach (just drop frames but not
> duplicate), you end up with the risk that if you start with 11fps but want
> 10fps, it may instead drop 50% of the frames (because the time between two
> incoming frame is always a bit more than 1/10s) and you end up with 6 fps.

I can't reproduce what you write in thew praxis. 

Here i use this pipeline, but i still get about 9-10fps on output

gst-launch v4l2src -v ! videorate ! video/x-raw-yuv,width=320,high=240,framerate=11/1 ! ffmpegcolorspace ! videorate vfr-max-mode=1 ! video/x-raw-yuv,framerate=10/1 ! fpsdisplaysink

my patch  work just fine for me. Can you please take a look in it?
Comment 7 Olivier Crête 2010-09-13 20:21:34 UTC
For some reason, it just works as you claim. But I have a gut feeling that there is something wrong in there, but maybe I'm just wrong.

If others like it, the "vfr-max-mode" property probably needs a better name like "no-duplicates" or "drop-only" or something.

The other thing that annoys me with using videorate is that it introduces an extra frame of useless latency (since in the live case, we can just drop the next frame anyway).
Comment 8 Mark Nauwelaerts 2011-05-02 09:49:58 UTC
Created attachment 187022 [details] [review]
videorate: optionally only drop frames to ensure max frame rate

Patch as provided above, adjusted with minor decorative edits and renaming of property as suggested above.

AFAICS, this method should arrange for the desired frame rate, of course provided the input frame rate at least sufficiently reaches that desired frame rate.
Comment 9 Mark Nauwelaerts 2011-05-02 09:57:04 UTC
Created attachment 187023 [details] [review]
videorate: optionally ensure max average framerate

To allow for variation in taste, this patch essentially merges videomaxrate (max average framerate approach) into videorate.
Comment 10 Mark Nauwelaerts 2011-05-16 10:49:30 UTC
commit eba4a948fb28216390bd66fe0e890086007196b3
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon May 2 11:43:38 2011 +0200

    videorate: optionally ensure maximum average output frame rate
    
    See #628764.

commit 1e092720248afd8f1273690a6ec431a4ae4cb56e
Author: Alexey Fisher <bug-track@fisher-privat.net>
Date:   Fri Apr 29 14:58:02 2011 +0200

    videorate: optionally only drop frames to ensure maximum frame rate
    
    This adds option to arrange for maximal allowed variable frame rate.
    
    Fixes #628764.