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 730750 - [vaapiencoder_h264] fix some sps fields creation for encode
[vaapiencoder_h264] fix some sps fields creation for encode
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-26 08:50 UTC by Tifaine Inguère
Modified: 2017-08-09 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for the modifications on the sps creation (3.29 KB, patch)
2014-05-26 08:50 UTC, Tifaine Inguère
none Details | Review

Description Tifaine Inguère 2014-05-26 08:50:04 UTC
Created attachment 277179 [details] [review]
patch for the modifications on the sps creation

Some sps fields had fixed value or aren't coded. This patch aim to enable them. The time-scale was also modified to match the real encoding parameter.

test pipeline
=> gst-launch-1.0 -v videotestsrc num-buffers=200 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! vaapiencode_h264 rate-control=vbr cpb-length=2000 bitrate=2000 ! qtmux ! filesink location=test.mp4

I have compared the sps created with the one done by ffmpeg with the same kind of parameters.
Comment 1 Gwenole Beauchesne 2014-06-17 15:18:17 UTC
Review of attachment 277179 [details] [review]:

Overall, I am OK with the proposed changes except for those I have commented on.

Does your firmware strictly define what comes out of the hardware or could this be more flexible to honour what comes from VAEncSequenceParameterBufferH264 and VAEncPictureParameterBufferH264?
Would it be possible to (privately) know what features the HW offer and more precisely what coding tools can be configured?

For direct_8x8_inference_flag = TRUE, that should be OK. However, there should be a way for your HW to honour that flag too. :)

::: gst-libs/gst/vaapi/gstvaapiencoder_h264.c
@@ +1148,2 @@
   g_assert (encoder->log2_max_frame_num >= 4);
+  encoder->log2_max_frame_num = 4;

This needs to be calculated from the maximum IDR period. Currently, the FrameNum wraps on new IDR frames, and this is set to 512. That's precisely 9. :)

@@ +1151,3 @@
       encoder->log2_max_frame_num - 4;
   /* picture order count */
+  seq_param->seq_fields.bits.pic_order_cnt_type = 2;

POC type = 2 imposes additional requirements which need to be tracked of. This is additional work that does not really worth it, is it?

Is your HW bound to only support POC type = 2, or can it bear user-defined headers to be inserted instead?

@@ +1200,3 @@
     if (seq_param->vui_fields.bits.timing_info_present_flag) {
       seq_param->num_units_in_tick = GST_VAAPI_ENCODER_FPS_D (encoder);
+      seq_param->time_scale = 2000000000;

Some people use the VUI timing_info to derive a framerate. Using that value (2000000000) is not very convenient for 30fps for instance.
Comment 2 sreerenj 2015-06-19 12:27:12 UTC
Any update???
Comment 3 sreerenj 2016-03-24 16:55:28 UTC
Moving to Product:GStreamer, Component:gstreamer-vaapi
Comment 4 Víctor Manuel Jáquez Leal 2017-08-09 08:56:32 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!