mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffmpeg: Support queing filter commands for later times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3d8176d2f5
commit
50be0b911a
13
ffmpeg.c
13
ffmpeg.c
@ -2683,14 +2683,19 @@ static int transcode(AVFormatContext **output_files,
|
||||
}
|
||||
if (key == 'c' || key == 'C'){
|
||||
char ret[4096], target[64], cmd[256], arg[256]={0};
|
||||
fprintf(stderr, "\nEnter command: <target> <command>[ <argument>]\n");
|
||||
if(scanf("%4095[^\n\r]%*c", ret) == 1 && sscanf(ret, "%63[^ ] %255[^ ] %255[^\n]", target, cmd, arg) >= 2){
|
||||
double ts;
|
||||
fprintf(stderr, "\nEnter command: <target> <time> <command>[ <argument>]\n");
|
||||
if(scanf("%4095[^\n\r]%*c", ret) == 1 && sscanf(ret, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &ts, cmd, arg) >= 3){
|
||||
for(i=0;i<nb_ostreams;i++) {
|
||||
int r;
|
||||
ost = ost_table[i];
|
||||
if(ost->graph){
|
||||
r= avfilter_graph_send_command(ost->graph, target, cmd, arg, ret, sizeof(ret), key == 'c' ? AVFILTER_CMD_FLAG_ONE : 0);
|
||||
fprintf(stderr, "Command reply for %d: %d, %s\n", i, r, ret);
|
||||
if(ts<0){
|
||||
r= avfilter_graph_send_command(ost->graph, target, cmd, arg, ret, sizeof(ret), key == 'c' ? AVFILTER_CMD_FLAG_ONE : 0);
|
||||
fprintf(stderr, "Command reply for %d: %d, %s\n", i, r, ret);
|
||||
}else{
|
||||
r= avfilter_graph_queue_command(ost->graph, target, cmd, arg, 0, ts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user