> Still investigating the problem, by constraining my application with -qmin=10 
> -qmax=10, and doing the same using ffmpeg command line I have the exact same 
> bitrate and file size.

I had similar problems and I found that the problem was my video stream 
time_base.

When you call avformat_write_header() avformat silently change your stream 
time_base to some values that it likes, so you cannot assume that the video 
stream time_base was the one you have configured on the stream creation but you 
need to do before encoding every frame:

av_packet_rescale_ts(pkt_, vc_->time_base, vs_->time_base);
av_interleaved_write_frame(oc_, pkt_);

if you don't do that x264 (and other encoders) will think that the frame 
duration is different from the real one and will behave accordingly.

The problem was more evident when encoding with videotoolbox on macOS that has 
a fixed bitrate mode.
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to