[FFmpeg-devel] [PATCH] fix stream copy

Maksym Veremeyenko verem
Wed Jan 20 09:34:57 CET 2010


Maksym Veremeyenko ???????(??):
> 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;
Are there any notes against applying this patch?

-- 
________________________________________
Maksym Veremeyenko



More information about the ffmpeg-devel mailing list