#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
+#include "libavutil/time_internal.h"
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
{\
int sync_file_idx = -1, sync_stream_idx = 0;
char *p, *sync;
char *map;
+ char *allow_unused;
if (*arg == '-') {
negative = 1;
exit_program(1);
}
} else {
+ if (allow_unused = strchr(map, '?'))
+ *allow_unused = 0;
file_idx = strtol(map, &p, 0);
if (file_idx >= nb_input_files || file_idx < 0) {
av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
}
if (!m) {
- av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg);
- exit_program(1);
+ if (allow_unused) {
+ av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; ignoring.\n", arg);
+ } else {
+ av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
+ "To ignore this, add a trailing '?' to the map.\n", arg);
+ exit_program(1);
+ }
}
av_freep(&map);
uint32_t tag = strtol(codec_tag, &next, 0);
if (*next)
tag = AV_RL32(codec_tag);
+ ost->st->codec->codec_tag =
ost->enc_ctx->codec_tag = tag;
}
for (i = 0; i < nb_input_streams; i++) {
int new_area;
ist = input_streams[i];
- new_area = ist->st->codec->width * ist->st->codec->height;
+ new_area = ist->st->codec->width * ist->st->codec->height + 100000000*!!ist->st->codec_info_nb_frames;
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
new_area = 1;
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
if(o-> data_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_DATA)
continue;
+ ost = NULL;
switch (ist->st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break;
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break;
exit_program(1);
}
}
+ if (ost)
+ ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index
+ + map->sync_stream_index];
}
}
}
char type, *val;
const char *stream_spec;
int index = 0, j, ret = 0;
+ char now_time[256];
val = strchr(o->metadata[i].u.str, '=');
if (!val) {
}
*val++ = 0;
+ if (!strcmp(o->metadata[i].u.str, "creation_time") &&
+ !strcmp(val, "now")) {
+ time_t now = time(0);
+ struct tm *ptm, tmbuf;
+ ptm = localtime_r(&now, &tmbuf);
+ if (ptm) {
+ if (strftime(now_time, sizeof(now_time), "%Y-%m-%d %H:%M:%S", ptm))
+ val = now_time;
+ }
+ }
+
parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec);
if (type == 's') {
for (j = 0; j < oc->nb_streams; j++) {