On Sun, 27 Mar 2016 14:26:43 +0200
Anton Khirnov <[email protected]> wrote:
> For video, frame_number tracks the number of frames sent to the encoder.
> So it should be incremented when we submit a frame, not when we get a
> packet back.
> ---
> avconv.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/avconv.c b/avconv.c
> index 087cc0c..00e50ee 100644
> --- a/avconv.c
> +++ b/avconv.c
> @@ -537,6 +537,13 @@ static void do_video_out(AVFormatContext *s,
> if (ret < 0)
> goto error;
>
> + /*
> + * For video, number of frames in == number of packets out.
> + * But there may be reordering, so we can't throw away frames on encoder
> + * flush, we need to limit them here, before they go into encoder.
> + */
The comment is wrong (even if you disregard the new API). vp9 already
does not output a frame for certain frame types (because that is how vp9
works).
I would say avconv should only rely on decoder _output_ and timestamps,
instead of assuming anything about packets.
On a side note, -frames did not work for remuxing, right?
> + ost->frame_number++;
> +
> while (1) {
> ret = avcodec_receive_packet(enc, &pkt);
> if (ret == AVERROR(EAGAIN))
> @@ -554,12 +561,6 @@ static void do_video_out(AVFormatContext *s,
> }
>
> ost->sync_opts++;
> - /*
> - * For video, number of frames in == number of packets out.
> - * But there may be reordering, so we can't throw away frames on
> encoder
> - * flush, we need to limit them here, before they go into encoder.
> - */
> - ost->frame_number++;
> }
>
> return;
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel