[FFmpeg-devel] [PATCH] fix stream copy
Maksym Veremeyenko
verem
Fri Jan 15 09:42:27 CET 2010
Michael Niedermayer ???????(??):
[...]
>> video_size += data_size;
>> - ost->sync_opts++;
>> + ost->sync_opts += pkt->duration;
>
> sync_opts and pkt->duration can be in diferent units so this cant be correct
updated patch attached.
pkt->duration represented in ist->st->time_base unites, but
ost->sync_opts required (if i correctly understand)
ost->st->codec->time_base units. so the solution would be to scale
packet duration:
Index: ffmpeg.c
===================================================================
--- ffmpeg.c (revision 21217)
+++ ffmpeg.c (working copy)
@@ -1477,7 +1477,7 @@
audio_size += data_size;
else if (ost->st->codec->codec_type ==
CODEC_TYPE_VIDEO) {
video_size += data_size;
- ost->sync_opts++;
+ ost->sync_opts +=
av_rescale_q(pkt->duration, ist->st->time_base, ost->st->codec->time_base);
}
opkt.stream_index= ost->index;
--
________________________________________
Maksym Veremeyenko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg_sync_opts_value_fix_v2.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100115/e454613d/attachment.bin>
More information about the ffmpeg-devel
mailing list