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 744612 - splitmuxsink: add property for specifing maximum number of files to store
splitmuxsink: add property for specifing maximum number of files to store
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 1.8.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-16 17:48 UTC by Damian Ziobro
Modified: 2016-04-13 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
My proposition of implementation of max-number-files property (3.64 KB, patch)
2015-02-16 17:48 UTC, Damian Ziobro
none Details | Review
Add new "max-files-number" property (3.25 KB, patch)
2015-02-16 18:06 UTC, Damian Ziobro
needs-work Details | Review
Add max-files property (similar to max-files property from multifilesink) (4.49 KB, patch)
2015-02-20 14:39 UTC, Damian Ziobro
none Details | Review
Add max-files property (similar to max-files property from multifilesink) (4.49 KB, patch)
2015-02-20 14:41 UTC, Damian Ziobro
none Details | Review
[PATCH] splitmuxsink: Add max_files_number property (4.46 KB, patch)
2016-04-13 17:49 UTC, Damian Ziobro
none Details | Review

Description Damian Ziobro 2015-02-16 17:48:33 UTC
Created attachment 296962 [details] [review]
My proposition of implementation of max-number-files property

There would be useful to have property for specifing maximum number of files which could be stored during spliting file using splitmuxsink element. 
After achieving mux number of files, files should be overwritten.
Ex. if max-number-files=2 and location=file%02d.mp4 
Then only files file00.mp4 and file01.mp4 should be stored. Another parts of stream should override file00.mp4 and file01.mp4 respecitevly.
Comment 1 Damian Ziobro 2015-02-16 18:06:54 UTC
Created attachment 296967 [details] [review]
Add new "max-files-number" property

New patch submitted. It is matched for newest changeset from git.
Comment 2 Tim-Philipp Müller 2015-02-17 14:47:14 UTC
Comment on attachment 296967 [details] [review]
Add new "max-files-number" property

Thanks for the patch. Could you please create a patch in "git format-patch" format. You can create it by making a local git commit (with author and proper commit message) and then running "git format-patch -1". When you attach the new patch please mark the old one as obsolete (there should be a 'this patch obsoletes this other patch' check box).

I think a simple guint is probably sufficient for this property.
Comment 3 Tim-Philipp Müller 2015-02-17 14:48:40 UTC
Question is also what should happen when the max number is reached? Should it EOS automatically? You want it to go back to 0 and overwrite old files, others might want it to continue writing but remove old files.
Comment 4 Thiago Sousa Santos 2015-02-18 16:19:20 UTC
multifilesink has a property for this as well, I guess we should just expose the same API in both for consistency.

multifilesink currently deletes old files but keeps the increasing number of its indexes.
Comment 5 Damian Ziobro 2015-02-20 14:39:17 UTC
Created attachment 297406 [details] [review]
Add max-files property (similar to max-files property from multifilesink)

Patch prepared
Comment 6 Damian Ziobro 2015-02-20 14:41:28 UTC
Created attachment 297407 [details] [review]
Add max-files property (similar to max-files property from multifilesink)
Comment 7 Jan Schmidt 2015-09-05 14:07:55 UTC
Review of attachment 297407 [details] [review]:

Mostly looks fine. It'll probably need a little merging with the later patches that add a custom signal for apps to specify the next filename manually.

::: gst/multifile/gstsplitmuxsink.c
@@ +1507,3 @@
+  while (splitmux->max_files && splitmux->fragment_id >= splitmux->max_files) {
+    splitmux->fragment_id = 0;
+  }

I think you mean 'if' instead of 'while' here.
Comment 8 Alexander 2015-12-19 09:46:51 UTC
Jan Schmidt, does this ticket already scheduled to some release?
Comment 9 Damian Ziobro 2016-04-13 17:49:55 UTC
Created attachment 325877 [details] [review]
[PATCH] splitmuxsink: Add max_files_number property

Sorry for late response. Didn't realized that this ticket is still open. 

Commited new patch after Jan Schmidt's suggestions.
Comment 10 Jan Schmidt 2016-04-13 18:19:37 UTC
Thanks, pushed to master and 1.8:

commit ae4484c2baa585de817a029a6cb57aab0681d836
Author: Damian Ziobro <damian@xmementoit.com>
Date:   Wed Apr 13 18:45:07 2016 +0100

    splitmuxsink: Add max_files_number property
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744612