[FFmpeg-devel] [PATCH] fix timestamps in vc1testenc
Reimar Döffinger
Reimar.Doeffinger
Tue Dec 7 08:18:38 CET 2010
Hello,
this muxer currently when writing the timestamps does not take into
account the stream time base, leading to completely "random" scaling
of the frame time at least when using mencoder.
Below patch rescales the pts values like other muxers do.
Index: libavformat/vc1testenc.c
===================================================================
--- libavformat/vc1testenc.c (revision 25845)
+++ libavformat/vc1testenc.c (working copy)
@@ -55,11 +55,14 @@
{
RCVContext *ctx = s->priv_data;
ByteIOContext *pb = s->pb;
+ uint32_t pts = av_rescale(pkt->pts,
+ 1000 * (uint64_t)s->streams[0]->time_base.num,
+ s->streams[0]->time_base.den);
if (!pkt->size)
return 0;
put_le32(pb, pkt->size | ((pkt->flags & AV_PKT_FLAG_KEY) ? 0x80000000 : 0));
- put_le32(pb, pkt->pts);
+ put_le32(pb, pts);
put_buffer(pb, pkt->data, pkt->size);
put_flush_packet(pb);
ctx->frames++;
More information about the ffmpeg-devel
mailing list