diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-01-28 19:56:13 +0100 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-01-28 22:01:09 +0100 |
commit | 47a5274104cf1b0a33c3405aa6e2842fe4aea46d (patch) | |
tree | c14f35b6449c73ee9bfbfb6be4999062ba0d380d | |
parent | 836110665f181465f4d44b57ca86599677fd12b9 (diff) | |
download | ffmpeg-47a5274104cf1b0a33c3405aa6e2842fe4aea46d.tar.gz |
Add -vsync drop.
This allows to work around any non-monotonic time-stamp errors
by just discarding all time stamps.
This will be necessary to allow H.264 conformance tests to pass
after fixing time stamps to be passed through rawenc.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r-- | doc/ffmpeg.texi | 5 | ||||
-rw-r--r-- | ffmpeg.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index ecf147ab55..55748f1e83 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -939,6 +939,8 @@ This option is deprecated, use -loop. Thread count. @item -vsync @var{parameter} Video sync method. +For compatibility reasons old values can be specified as numbers. +Newly added values will have to be specified as strings always. @table @option @item 0, passthrough @@ -949,6 +951,9 @@ constant framerate. @item 2, vfr Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. +@item drop +As passthrough but destroys all timestamps, making the muxer generate +fresh timestamps based on frame-rate. @item -1, auto Chooses between 1 and 2 depending on muxer capabilities. This is the default method. @@ -97,6 +97,7 @@ #define VSYNC_PASSTHROUGH 0 #define VSYNC_CFR 1 #define VSYNC_VFR 2 +#define VSYNC_DROP 0xff const char program_name[] = "ffmpeg"; const int program_birth_year = 2000; @@ -1474,7 +1475,7 @@ static void do_video_out(AVFormatContext *s, if (format_video_sync == VSYNC_AUTO) format_video_sync = (s->oformat->flags & AVFMT_VARIABLE_FPS) ? ((s->oformat->flags & AVFMT_NOTIMESTAMPS) ? VSYNC_PASSTHROUGH : VSYNC_VFR) : 1; - if (format_video_sync != VSYNC_PASSTHROUGH) { + if (format_video_sync != VSYNC_PASSTHROUGH && format_video_sync != VSYNC_DROP) { double vdelta = sync_ipts - ost->sync_opts + duration; // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c if (vdelta < -1.1) @@ -1569,6 +1570,8 @@ static void do_video_out(AVFormatContext *s, if (enc->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY; + if (format_video_sync == VSYNC_DROP) + pkt.pts = pkt.dts = AV_NOPTS_VALUE; write_frame(s, &pkt, ost); *frame_size = ret; video_size += ret; @@ -4927,6 +4930,7 @@ static int opt_vsync(const char *opt, const char *arg) if (!av_strcasecmp(arg, "cfr")) video_sync_method = VSYNC_CFR; else if (!av_strcasecmp(arg, "vfr")) video_sync_method = VSYNC_VFR; else if (!av_strcasecmp(arg, "passthrough")) video_sync_method = VSYNC_PASSTHROUGH; + else if (!av_strcasecmp(arg, "drop")) video_sync_method = VSYNC_DROP; if (video_sync_method == VSYNC_AUTO) video_sync_method = parse_number_or_die("vsync", arg, OPT_INT, VSYNC_AUTO, VSYNC_VFR); |