[Libav-user] Transcoding frame rate mismatch

Vassilis bpantazhs at gmail.com
Wed Nov 6 07:47:24 EET 2019


>
> Send a patch made with "git format-patch" to the FFmpeg development
> mailing list.
>
> Please find out what top-posting means and avoid it on all FFmpeg
> mailing lists, Carl Eugen
>

I don't have any repos set up for ffmpeg maybe you or someone else who does
could do this very quickly? I wouldn't want to waste anyone's time with bad
patches.
The code, as it fits in the transcoding example is this:

    av_packet_rescale_ts(&enc_pkt,
                         stream_ctx[stream_index].enc_ctx->time_base,
                         ofmt_ctx->streams[stream_index]->time_base);

    // Calculate packet duration, using input frame rate as there is no
frame rate conversion
    if (ifmt_ctx->streams[stream_index]->codecpar->codec_type ==
        AVMEDIA_TYPE_VIDEO){

        enc_pkt.duration = ofmt_ctx->streams[stream_index]->time_base.den /
ofmt_ctx->streams[stream_index]->time_base.num /
ifmt_ctx->streams[stream_index]->avg_frame_rate.num *
ifmt_ctx->streams[stream_index]->avg_frame_rate.den;
    }

Thanks for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20191106/94119c48/attachment.html>


More information about the Libav-user mailing list