avconv: set the encoding framerate when the output is CFR

Message ID 1475315277-13164-1-git-send-email-anton@khirnov.net
State Committed
Commit d10102d23c9467d4eb84f58e0cd12be284b982f6
Headers show

Commit Message

Anton Khirnov Oct. 1, 2016, 9:47 a.m.
---
 avconv.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Thompson Oct. 1, 2016, 10:55 a.m. | #1
On 01/10/16 10:47, Anton Khirnov wrote:
> ---
>  avconv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/avconv.c b/avconv.c
> index 59eb300..87923b9 100644
> --- a/avconv.c
> +++ b/avconv.c
> @@ -1978,6 +1978,8 @@ static int init_output_stream_encode(OutputStream *ost)
>              ost->filter->filter->inputs[0]->sample_aspect_ratio;
>          enc_ctx->pix_fmt = ost->filter->filter->inputs[0]->format;
>  
> +        enc_ctx->framerate = ost->frame_rate;
> +
>          ost->st->avg_frame_rate = ost->frame_rate;
>  
>          if (dec_ctx &&
> 

LGTM :)

(With this but not the patch immediately before it, we get:
@94    VUI: num_units_in_tick                          00000000000000000000000000111100 ( 60)
@126   VUI: time_scale                                 00000000000000000000000000000010 (  2)
from h264_vaapi.)

Patch

diff --git a/avconv.c b/avconv.c
index 59eb300..87923b9 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1978,6 +1978,8 @@  static int init_output_stream_encode(OutputStream *ost)
             ost->filter->filter->inputs[0]->sample_aspect_ratio;
         enc_ctx->pix_fmt = ost->filter->filter->inputs[0]->format;
 
+        enc_ctx->framerate = ost->frame_rate;
+
         ost->st->avg_frame_rate = ost->frame_rate;
 
         if (dec_ctx &&