[Libav-user] Odd problem after encoding video

Kristijonas Malisauskas km at sportcaster.dk
Thu Jun 2 17:31:18 CEST 2016


I am encoding video with a new framerate expecting a slowdown or speed up
in the final result.
Odd thing is: "Videos" or ffmpeg player seems to give me expected results
while VLC plays the video at the same-ish framerate (makes no difference
what FPS I set)

Encoder setup:

out_codec = avcodec_find_encoder(AV_CODEC_ID_H264);
    if (!out_codec) {
        cout << "out_codec found" << endl;

    pOutputContext = avcodec_alloc_context3(out_codec);
    if (!pOutputContext) {
        cout << "Could not allocate video codec context" << endl;

    // put sample parameters
    pOutputContext->bit_rate = FILE_OUTPUT_WIDTH * FILE_OUTPUT_HEIGHT * 4;

    pOutputContext->width = FILE_OUTPUT_WIDTH;
    pOutputContext->height = FILE_OUTPUT_HEIGHT;

    // frames per second
    pOutputContext->time_base.den = OUT_FRAMERATE; //FPS
    pOutputContext->time_base.num = 1;

    pOutputContext->gop_size = 10;

    pOutputContext->max_b_frames = 1;

    pOutputContext->pix_fmt = AV_PIX_FMT_YUV420P;

    av_opt_set(pOutputContext->priv_data, "preset", "slow", 0);

Any thoughts what might cause this behaviour?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160602/0c6c98e5/attachment.html>

More information about the Libav-user mailing list