Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-plugins-ugly gst-plugins-ugly
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gst-plugins-uglygst-plugins-ugly
  • Issues
  • #28
Closed
Open
Issue created Dec 14, 2019 by Dmitry Shusharin@Ded_Zerom

x264enc: CEA-708 cc_data structure contains invalid values

Hi,

CEA-708 Closed Captions injection support was introduced in encoder by commit c4456d57. However em_data field (see this line of gstx264enc.c) should not be zero. As CEA-708-D states (section 4.4 table 2) this field should be initialized with all bits set (i.e. 0xFF). h264parse element also expects this value while validating CC SEI message. I could suppose that other decoders (such as FFMpeg) also rely on this.

I've attached a test problematic stream which can reproduce the issue. Sample pipeline is:

$ gst-launch-1.0 -v filesrc location=bbb_sei_cc.h264 ! h264parse ! identity silent=false ! fakesink

You should notice no metadata on buffers. I've also added correct stream to compare against.

I'd propose following fix:

diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index f313b211..ca9ccb8d 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -2413,7 +2413,7 @@ gst_x264_enc_add_cc (GstBuffer * buffer, x264_picture_t * pic_in)
      */
     pic_in->extra_sei.payloads[i].payload[8] =
         ((cc_meta->size / 3) & 0x1f) | 0x40;
-    pic_in->extra_sei.payloads[i].payload[9] = 0;       /* 8 bits em_data, unused */
+    pic_in->extra_sei.payloads[i].payload[9] = 255;     /* 8 bits em_data, unused */
     pic_in->extra_sei.payloads[i].payload[cc_meta->size + 10] = 255;    /* 8 marker bits */
   }
 }

Reproduced on:

Ubuntu 19.04 Disco Dingo

GStreamer: 1.15.90 (installed by package manager, first installation, git version from tag 1.15.90 also reproduces the issue)

Edited Dec 14, 2019 by Dmitry Shusharin
Assignee
Assign to
Time tracking