aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-29 00:07:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-29 20:16:13 +0200
commit50be0b911a61e537878b2d65587ef303a56b3e91 (patch)
treef924bd8d7a28ed9151d43f37f911fe77eb0aac29 /ffmpeg.c
parent3d8176d2f5766eb6c10f9c99ffd9efc1f682459e (diff)
downloadffmpeg-50be0b911a61e537878b2d65587ef303a56b3e91.tar.gz
ffmpeg: Support queing filter commands for later times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index e9dbc66416..20adfe4055 100644
--- a/ffmpeg.c
+++ b/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{