GNOME Bugzilla – Bug 744612
splitmuxsink: add property for specifing maximum number of files to store
Last modified: 2016-04-13 18:19:37 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.
Created attachment 296967 [details] [review] Add new "max-files-number" property New patch submitted. It is matched for newest changeset from git.
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.
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.
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.
Created attachment 297406 [details] [review] Add max-files property (similar to max-files property from multifilesink) Patch prepared
Created attachment 297407 [details] [review] Add max-files property (similar to max-files property from multifilesink)
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.
Jan Schmidt, does this ticket already scheduled to some release?
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.
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