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 735859 - videomixer: Dynamically changing the FPS leads to an incorrect buffer time
videomixer: Dynamically changing the FPS leads to an incorrect buffer time
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.4.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-02 05:42 UTC by Andrei Sarakeev
Modified: 2014-09-04 09:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix, line 407 (71.12 KB, text/x-csrc)
2014-09-02 05:42 UTC, Andrei Sarakeev
  Details
fix (1.25 KB, patch)
2014-09-02 07:20 UTC, Andrei Sarakeev
committed Details | Review

Description Andrei Sarakeev 2014-09-02 05:42:03 UTC
Created attachment 285111 [details]
fix, line 407

When changing the FPS, update mix->ts_offset in gst_videomixer2_update_converters()
Comment 1 Sebastian Dröge (slomo) 2014-09-02 06:33:41 UTC
Please attach the fix as a patch in "git format-patch" format, and also provide some more information about what breaks and ideally also a testcase to show the problem.
Comment 2 Andrei Sarakeev 2014-09-02 07:20:59 UTC
Created attachment 285114 [details] [review]
fix
Comment 3 Andrei Sarakeev 2014-09-02 07:32:13 UTC
In the dynamic change in the branch of pipeline (for example, when playing a sequential series of videos with different fps) during the transition to the next file can be observed freezing or skipping. Sorry for the google translate
Comment 4 Andrei Sarakeev 2014-09-03 05:14:08 UTC
gst_videomixer2_collected(...)
...
output_end_time =
      mix->ts_offset + gst_util_uint64_scale_round (mix->nframes + 1,
      GST_SECOND * GST_VIDEO_INFO_FPS_D (&mix->info),
      GST_VIDEO_INFO_FPS_N (&mix->info)) + mix->segment.start;
...

Example:

99 frames with 50fps
buffer(99)->pts = 00:01.98
buffer(99)->duration = 00:00.02
output_end_time = 0 + (100 * 1 / 50) = 2 * GST_SECOND;

caps negotiation

100th frame with 25fps
buffer(100)->pts = 00:02.00
buffer(100)->duration = 00:00.04
output_end_time = 0 + (101 * 1 / 25) = 4 * GST_SECOND; !!!


log (transition form framerate=(fraction)5000/167 to framerate=(fraction)25/1):

0:00:30.248874047 videomixer2.c:422:gst_videomixer2_update_converters:<mixer> The output format will now be : 12 with colorimetry : 1:1:0:0 and chroma : (null)

0:00:30.249005301 videomixer2.c:461:gst_videomixer2_update_converters:<mixer:sink_0> This pad will not need conversion

0:00:30.249024772 videomixer2.c:461:gst_videomixer2_update_converters:<mixer:sink_1> This pad will not need conversion

0:00:30.249469775 videomixer2.c:1662:gst_videomixer2_src_setcaps:<mixer:src> set src caps: video/x-raw, format=(string)BGRA, width=(int)400, height=(int)336, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0, framerate=(fraction)25/1

[* note]
0:00:30.262908570 videomixer2.c:878:gst_videomixer2_fill_queues:<mixer> output_start_time 0:00:30.026600000, output_end_time 0:00:36.000000000

0:00:30.263004319 videomixer2.c:986:gst_videomixer2_fill_queues:<mixer:sink_0> Taking new buffer with start time 0:00:30.030000000

0:00:30.263081632 videomixer2.c:986:gst_videomixer2_fill_queues:<mixer:sink_1> Taking new buffer with start time 0:00:30.040000000

[** note]
0:00:30.275772139 videomixer2.c:878:gst_videomixer2_fill_queues:<mixer> output_start_time 0:00:36.000000000, output_end_time 0:00:36.040000000

0:00:30.275855789 videomixer2.c:1007:gst_videomixer2_fill_queues:<mixer:sink_0> Too old buffer -- dropping
0:00:30.275875036 videomixer2.c:1007:gst_videomixer2_fill_queues:<mixer:sink_1> Too old buffer -- dropping

... Too old buffer -- dropping
Comment 5 Sebastian Dröge (slomo) 2014-09-04 08:35:38 UTC
commit 558f9a2a6fa066ba597838a6793aa639cfd91e49
Author: Andrei Sarakeev <sarakusha@gmail.com>
Date:   Tue Sep 2 11:13:44 2014 +0400

    videomixer: Fix synchronization if dynamically changing the FPS
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735859