mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-03 17:10:53 +00:00
avfilter/avf_concat: add next command
This patch makes it possible to dinamically close the current segment and step to the next one by introducing command handling capabilities into the filter. This new feature is very usefull when working with real-time sources or live streams as source. Combinig usage with zmqsend tool you can interactively end the current segment and step to next one. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
This commit is contained in:
parent
40102a2137
commit
d723994449
@ -18153,6 +18153,14 @@ do not have exactly the same duration in the first file.
|
||||
|
||||
@end itemize
|
||||
|
||||
@subsection Commands
|
||||
|
||||
This filter supports the following commands:
|
||||
@table @option
|
||||
@item next
|
||||
Close the current segment and step to the next one
|
||||
@end table
|
||||
|
||||
@section drawgraph, adrawgraph
|
||||
|
||||
Draw a graph using input video or audio metadata.
|
||||
|
@ -418,6 +418,19 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
av_freep(&cat->in);
|
||||
}
|
||||
|
||||
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
|
||||
char *res, int res_len, int flags)
|
||||
{
|
||||
int ret = AVERROR(ENOSYS);
|
||||
|
||||
if (!strcmp(cmd, "next")) {
|
||||
av_log(ctx, AV_LOG_VERBOSE, "Command received: next\n");
|
||||
return flush_segment(ctx);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
AVFilter ff_avf_concat = {
|
||||
.name = "concat",
|
||||
.description = NULL_IF_CONFIG_SMALL("Concatenate audio and video streams."),
|
||||
@ -429,4 +442,5 @@ AVFilter ff_avf_concat = {
|
||||
.outputs = NULL,
|
||||
.priv_class = &concat_class,
|
||||
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_DYNAMIC_OUTPUTS,
|
||||
.process_command = process_command,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user