[Bug 706885] New: videoencoder: Fix forwarding of GstForceKeyUnit events

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Aug 27 06:05:42 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=706885
  GStreamer | gst-plugins-base | git

           Summary: videoencoder: Fix forwarding of GstForceKeyUnit events
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: ylatuya at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=253242)
 View: https://bugzilla.gnome.org/attachment.cgi?id=253242
 Review: https://bugzilla.gnome.org/review?bug=706885&attachment=253242

0001-videoencoder-fix-forwarding-of-GstForceKeyUnit-event.patch

The algorithm to match the output sync frame with a GstForceKeyUnit event
should be using the frame_id instead of trying to match using times.

With the current code the output is as follows:
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:00.083333333
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:02.041666666
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:00.000000000, all_headers 0, count 0
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:04.000000000
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:06.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:04.000000000, all_headers 0, count 1
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:05.125000000, all_headers 0, count 2
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:08.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:06.000000000, all_headers 0, count 3
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:08.000000000, all_headers 0, count 4
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:10.166666666
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:12.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:10.166666666, all_headers 0, count 5
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:14.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:12.000000000, all_headers 0, count 6
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:14.000000000, all_headers 0, count 7
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:16.166666666


The problem comes with the second force keyframe, which has a running-time
lower than 0:00:02.000000000, so the event for 0:00:04.000000000 is pushed
instead. Next come a non-forced keyframe at 0:00:05.125000000 which is pushed
because its running-time is bigger than 0:00:02.000000000.

Using the frame id to match the keyframe with the event get:
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:00.083333333
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:02.041666666
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:00.000000000, all_headers 0, count 0
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:04.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:01.958333333, all_headers 0, count 1
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:06.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:04.000000000, all_headers 0, count 2
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:08.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:06.000000000, all_headers 0, count 3
gst_video_encoder_chain:<x264enc0> Forcing a key unit at running time
0:00:10.000000000
gst_video_encoder_finish_frame:<x264enc0> Forced key unit: running-time
0:00:08.000000000, all_headers 0, count 4

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list