<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I am encoding video with a new framerate expecting a slowdown or speed up in the final result.<br></div>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)<br><br></div>Encoder setup:<br><br>out_codec = avcodec_find_encoder(AV_CODEC_ID_H264);<br> if (!out_codec) {<br> cout << "out_codec found" << endl;<br> exit(1);<br> }<br><br> pOutputContext = avcodec_alloc_context3(out_codec);<br> if (!pOutputContext) {<br> cout << "Could not allocate video codec context" << endl;<br> exit(1);<br> }<br><br> // put sample parameters<br> pOutputContext->bit_rate = FILE_OUTPUT_WIDTH * FILE_OUTPUT_HEIGHT * 4;<br><br> pOutputContext->width = FILE_OUTPUT_WIDTH;<br> pOutputContext->height = FILE_OUTPUT_HEIGHT;<br><br> // frames per second<br> pOutputContext->time_base.den = OUT_FRAMERATE; //FPS<br> pOutputContext->time_base.num = 1;<br><br> pOutputContext->gop_size = 10;<br><br> pOutputContext->max_b_frames = 1;<br><br> pOutputContext->pix_fmt = AV_PIX_FMT_YUV420P;<br><br> av_opt_set(pOutputContext->priv_data, "preset", "slow", 0);<br><br><br><br></div>Any thoughts what might cause this behaviour?<br><br></div>/Kris</div>