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 595930 - [matroskamux] Finalize matroska files upon custom event
[matroskamux] Finalize matroska files upon custom event
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-22 10:33 UTC by Ognyan Tonchev (redstar_)
Modified: 2009-09-26 05:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
finalize matroska files upon custom event (3.08 KB, patch)
2009-09-22 10:33 UTC, Ognyan Tonchev (redstar_)
none Details | Review
finalize matroska files upon custom event (3.12 KB, patch)
2009-09-22 10:46 UTC, Ognyan Tonchev (redstar_)
rejected Details | Review

Description Ognyan Tonchev (redstar_) 2009-09-22 10:33:03 UTC
This patch introduces support for finalizing matroska files upon custom event (Currently files are finalized only at EOS).

example:

  GstPad *src_pad = gst_element_get_static_pad (matroska, "src");

  /* Tell matroska muxer to finalize the file */
  gst_pad_send_event (src_pad, gst_event_new_custom (GST_EVENT_CUSTOM_BOTH,
      gst_structure_empty_new ("FinalizeMatroskaFile")));
Comment 1 Ognyan Tonchev (redstar_) 2009-09-22 10:33:44 UTC
Created attachment 143678 [details] [review]
finalize matroska files upon custom event
Comment 2 Ognyan Tonchev (redstar_) 2009-09-22 10:46:28 UTC
Created attachment 143680 [details] [review]
finalize matroska files upon custom event
Comment 3 Jan Schmidt 2009-09-22 10:53:57 UTC
I'm not sure why this is useful. Why not just send an EOS event to close things out?
Comment 4 Tim-Philipp Müller 2009-09-22 11:28:29 UTC
I would like some more information about the exact use cases here as well.

If it is indeed useful, it seems like something that should maybe be standardised so it can be used everywhere in the same way, instead of cooking up custom events for each muxer.
Comment 5 Tim-Philipp Müller 2009-09-22 11:29:33 UTC
Oops, didn't mean to change bug status.
Comment 6 Ognyan Tonchev (redstar_) 2009-09-22 11:59:30 UTC
Well, i need to split a live stream(h264) into multiple matroska files but i also have a queue in the pipeline and i don't want any buffers from that queue to be discarded at any cost. So what i am basically doing is issuing segment seeks and changing file upon SEGMENT_DONE.

If i was using regular seeks and changing file upon EOS i would also have to do either flushing seeks or perform PAUSED->READY->PAUSED state transitions to cancel the EOS state, but that would discard the buffers that are in the queue ;(
Comment 7 Arnout Vandecappelle 2009-09-24 07:34:12 UTC
I don't think this will work without putting a block on the queue src pad.  And your second file will have timestamps starting at non-zero, which results in faulty playback.  Also filesink will not open a new file unless you bring it down to NULL state and back to PLAYING again.

What I do is sending an EOS event down to the queue's peer pad before disconnecting the mux-filesink chain.  And I have a resettime element to reset the timestamps back to zero.
Comment 8 Ognyan Tonchev (redstar_) 2009-09-24 08:17:14 UTC
Yep, i break the link mux-filesink and set filesinks state to NULL in order to be able to change the file and also reset the timestamps so new files have timestamps always starting from zero. Blocking the queues src pad is not necessary.
Comment 9 Ognyan Tonchev (redstar_) 2009-09-24 09:48:39 UTC
Well putting a block on the queue src pad is necessary in the general case when file change is made right away upon SEGMENT_DONE but doing that may also result into lost delta units. I have an extra element within the pipeline that handles this nicely.
Comment 10 Ognyan Tonchev (redstar_) 2009-09-25 11:34:33 UTC
Sending an EOS event down to the queue's peer pad(when i want to switch file) worked fine so this patch is not really useful.