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 696437 - qtmux: add support for mp4 timed text
qtmux: add support for mp4 timed text
Status: RESOLVED DUPLICATE of bug 581295
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-23 04:30 UTC by Matej Knopp
Modified: 2014-09-28 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use timestamp delta as duration if possible (1.44 KB, patch)
2013-03-23 04:31 UTC, Matej Knopp
committed Details | Review
Add support for MP4 timed text (22.15 KB, patch)
2013-03-23 04:31 UTC, Matej Knopp
none Details | Review
Patch (22.11 KB, patch)
2013-03-31 00:27 UTC, Matej Knopp
none Details | Review
Patch (26.25 KB, patch)
2013-04-01 14:22 UTC, Matej Knopp
needs-work Details | Review
Patch to add support for timed text (26.23 KB, patch)
2013-09-14 14:11 UTC, Matej Knopp
needs-work Details | Review

Description Matej Knopp 2013-03-23 04:30:30 UTC
First patch changes the way sample delta is calculated. The variable is called duration, but it is used as timestamp delta for samples so it probably should be calculated as dts (or pts if no dts are present) delta instead from duration. Otherwise sparse streams and streams with discontinuities will have wrong timestamps.
Comment 1 Matej Knopp 2013-03-23 04:31:04 UTC
Created attachment 239607 [details] [review]
Use timestamp delta as duration if possible
Comment 2 Matej Knopp 2013-03-23 04:31:34 UTC
Created attachment 239608 [details] [review]
Add support for MP4 timed text
Comment 3 David Schleef 2013-03-30 22:31:15 UTC
First patch applied.

Second patch:

In gst_qt_mux_request_new_pad(), please use the AUDIO/VIDEO/SUBTITLE enum instead of name[0].

As I mentioned on IRC, I would like to see a test that generates a file that we can attempt to play in different players.  But as we don't have that for other cases, it's not critical.
Comment 4 David Schleef 2013-03-30 22:43:49 UTC
Also, I get this:

  CC     libgstisomp4_la-atoms.lo
atoms.c: In function 'atom_trak_set_subtitle_type':
atoms.c:3480:25: error: variable 'entry' set but not used [-Werror=unused-but-set-variable]
Comment 5 Matej Knopp 2013-03-30 23:52:02 UTC
I'll change it to enum, not sure how I could have missed the variable.
Comment 6 Matej Knopp 2013-03-31 00:27:29 UTC
Created attachment 240183 [details] [review]
Patch

Fixed warning, left the other thing alone (as discussed on IRC)
Comment 7 Matej Knopp 2013-04-01 14:22:55 UTC
Created attachment 240307 [details] [review]
Patch 

Previous patch did not account for overlapping subtitles. There is no way to store overlapping subtitles in MP4. In order to not lose overlapped subtitles there needs to be some merging done in the muxer.
Comment 8 Matej Knopp 2013-09-04 12:55:57 UTC
Review of attachment 239607 [details] [review]:

Seems to be committed.
Comment 9 Matej Knopp 2013-09-04 12:57:24 UTC
Review of attachment 240307 [details] [review]:

Needs to be rebased.
Comment 10 Matej Knopp 2013-09-14 14:11:30 UTC
Created attachment 254922 [details] [review]
Patch to add support for timed text

Rebased and slightly updated. I know it is a big patch, but would be nice if someone reviewed it. Been using it for a while and it seems to work well.
Comment 11 Sebastian Dröge (slomo) 2013-09-16 08:56:40 UTC
Review of attachment 254922 [details] [review]:

::: gst/isomp4/gstqtmux.c
@@ +272,3 @@
   }
 
+  if (params->subtitle_sink_caps) {

Shouldn't you check for non-empty caps here? You use GST_STATIC_CAPS_NONE below

@@ +575,3 @@
+
+  gst_buffer_map (buf, &map_old, GST_MAP_READ);
+  size = (gint16) _strnlen ((const char *) map_old.data, map_old.size);

Why don't you just use strnlen() here?

@@ +2521,3 @@
+    GST_BUFFER_PTS (res) = time_span_min;
+    GST_BUFFER_DURATION (res) = time_span_max - time_span_min;
+    g_string_free (string, TRUE);

You could just reuse the GString memory here and use gst_memory_new_wrapped()
Comment 12 Matej Knopp 2013-12-01 20:34:52 UTC
> +  if (params->subtitle_sink_caps) {
> Shouldn't you check for non-empty caps here? You use GST_STATIC_CAPS_NONE below

This is actually handled in gst_qt_mux_register
    params->subtitle_sink_caps =
        gst_static_caps_get (&prop->subtitle_sink_caps);
    if (gst_caps_is_empty (params->subtitle_sink_caps))
      params->subtitle_sink_caps = NULL;

> Why don't you just use strnlen() here?
Not sure really, gstregistrychunks.c has its own implementation as well, I though that there are some compatibility issues

> You could just reuse the GString memory here and use gst_memory_new_wrapped()
Which flags should I use?
Comment 13 Sebastian Dröge (slomo) 2014-04-02 21:42:34 UTC
(In reply to comment #12)

> > Why don't you just use strnlen() here?
> Not sure really, gstregistrychunks.c has its own implementation as well, I
> though that there are some compatibility issues

I'm not aware of any :)

> > You could just reuse the GString memory here and use gst_memory_new_wrapped()
> Which flags should I use?

None, i.e. 0 seems correct here
Comment 14 Matej Knopp 2014-09-21 15:12:06 UTC
Looks like this has already been implemented (581295)
Comment 15 Matej Knopp 2014-09-28 12:04:34 UTC

*** This bug has been marked as a duplicate of bug 581295 ***