Automatic File Splitting #5078
Replies: 4 comments 15 replies
-
I'd like to make a proposal for Automatic File Splitting. Proposal of implementationThis proposal mainly changes a backend built-in plugin Backend (ffmpeg-mux)This is the main part of the implementation. The plugin obs-studio/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c Lines 656 to 659 in cd5873e Suggestion: if (is_network && !is_http)
output_format = av_guess_format("mpegts", NULL, "video/M2PT");
else if (is_segment)
output_format = av_guess_format("segment", ffm->params.file, NULL);
else
output_format = av_guess_format(NULL, ffm->params.file, NULL); When passing obs-studio/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c Lines 594 to 595 in cd5873e Suggestion: AVDictionary *dict = NULL;
if (is_segment) {
av_dict_set(&dict, "segment_format_options", ffm->params.muxer_settings, 0);
av_dict_set_int(&dict, "segment_time", segment_time, 0);
// TODO: and other parameters if necessary.
}
else if ((ret = av_dict_parse_string(&dict, ffm->params.muxer_settings, "=", Backend (ffmpeg-output)According to the feedback from Jim, the change in Create a obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c Lines 573 to 575 in 725fce7 Suggestion: AVOutputFormat *output_format = av_guess_format(
is_segment ? "segment" :
is_rtmp ? "flv" : data->config.format_name, data->config.url,
is_rtmp ? NULL : data->config.format_mime_type); The format information will be passed through a obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c Lines 398 to 407 in 725fce7 Suggestion: AVDictionary *dict = NULL;
if (is_segment) {
av_dict_set(&dict, "segment_format", data->config.format_name, 0);
av_dict_set(&dict, "segment_format_options", data->config.muxer_settings, 0);
// TODO: set some other options such as `segment_time`
}
else if ((ret = av_dict_parse_string(&dict, data->config.muxer_settings, "=",
" ", 0))) {
ffmpeg_log_error(LOG_WARNING, data,
"Failed to parse muxer settings: %s\n%s",
av_err2str(ret), data->config.muxer_settings);
av_dict_free(&dict);
return false;
} Configuration and data structureNeed to implement two data structures;
In addition to the new settings, also need to consider UIThe settings will be implemented into Settings/Output/Recording tab for both These settings will be added
Optionally, add some settings as below. Suggestion is welcome.
File nameCurrently the file name is generated by
Considerations between other features
Satisfaction of the requirementsRequirements
Pros
Open issues
Time estimationIt will take roughly 1-2 weeks including implementation and some debugging but excluding the segment-by-size option. It may vary depending on my other activities. CommentThis proposal addresses the feature to split the file by the time. However the other feature to split by the size is also considered, I think it is a reasonable choice not to implement the "split by the size" feature for now in terms of the simplicity and maintainability of the OBS Studio's code. Possible solutions and workarounds are discussed above. |
Beta Was this translation helpful? Give feedback.
-
This is another proposal to implement in Basic Concept of Splitting the StreamThe proposal suggest to follow the implementation of the
The splitting timing is controlled by the video stream. Since the packets of video and audio have already been ordered, we don't need to hold both previous and new files for audio when splitting but just switch to the new file. Unfortunately, the Implementation in the PluginAPI of the PluginAdd new settings (same as that for
Above settings subject to change. File name generationFile names for the 2nd and later files will be generated in the output plugin UIThe settings will be implemented into Settings/Output/Recording tab for both Standard and Advanced output modes. BackendSource file: Call Pros:
Cons:
If overhead of the subprocess creation matters, I will consider this idea. Other Considerations
Completion Criteria
|
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I was looking for this feature to do some custom streaming because I have issues with internet so I need to basically do HLS file uploads manually... And it struck me, this "feature" can already be done! Just go to Recording and set m3u8 Format. For my use case this ideal because I can just upload the files as fast as I can and remux them else where for streaming. For the proposed solutions.. I would not use a key frame longer than 10 seconds because any data corruption within that segment will cause artefacts. The proposal is the be able to almost.. group these files , or remux them locally to desired lengths, maybe 10 minute segments that contain 2 second key intervals. Just food for thought.. |
Beta Was this translation helpful? Give feedback.
-
Automatic File Splitting
THIS BOUNTY HAS BEEN COMPLETED! 🎉
Commit: 0e81c66
Feature Summary
Allow users to choose to save recordings in split files instead of one monolithic file.
Background and Motivation
When recording video files in OBS Studio, files are saved as a single video file. This makes sense in the general case, but there are some situations where having one single file is awkward. For example:
Request For Proposal
Submit a proposal explaining how you will implement this feature such that it meets the following requirements:
* Multiple contributors may assist with implementation on different platforms and may split the bounty according to the level of contribution they made to the project.
Please read Tips for Writing a Good Proposal for guidance on how to author your proposal.
The OBS development team will consider all submitted proposals and select one submission to be implemented by the developer who submitted it. That developer will be eligible to collect the bounty upon completion of the project according to the criteria listed below.
Bounty
The bounty for implementing this feature is $1500.
You can learn more about the OBS Project Bounty Program here.
If you wish to contribute funds toward increasing the amount on this bounty, contribute to the OBS Project Bounty Fund and select the "Automatic File Splitting" option (or just click here).
Completion Criteria
You may collect the bounty when the following are true:
master
branch of the appropriateobsproject
repositories.Additional Information
Related idea from the OBS Ideas Page:
Related posts on the OBS Forums:
Beta Was this translation helpful? Give feedback.
All reactions