diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca3a308..83086c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Append `frame_rate=%d/%d` input parameter in `FFmpegFrameFilter` as required by `xfade` ([issue #1776](https://github.com/bytedeco/javacv/issues/1776)) * Update `FFmpegStreamingTimeout` sample to use `timeout` instead of `stimeout` for RTSP ([pull #1758](https://github.com/bytedeco/javacv/pull/1758)) * Restore static calls to `FFmpegFrameGrabber.tryLoad()` and `FFmpegFrameRecorder.tryLoad()` ([issue #1756](https://github.com/bytedeco/javacv/issues/1756)) * Enable by default on `RealSense2FrameGrabber.start()` all color, depth, and IR streams as `videoStream` ([pull #1750](https://github.com/bytedeco/javacv/pull/1750)) diff --git a/src/main/java/org/bytedeco/javacv/FFmpegFrameFilter.java b/src/main/java/org/bytedeco/javacv/FFmpegFrameFilter.java index 725cfec2..909a7b77 100644 --- a/src/main/java/org/bytedeco/javacv/FFmpegFrameFilter.java +++ b/src/main/java/org/bytedeco/javacv/FFmpegFrameFilter.java @@ -323,7 +323,8 @@ private void startVideoUnsafe() throws Exception { AVFilter setpts = avfilter_get_by_name("setpts"); AVFilterInOut[] outputs = new AVFilterInOut[videoInputs]; AVFilterInOut inputs = avfilter_inout_alloc(); - AVRational time_base = av_inv_q(av_d2q(frameRate, 1001000)); + AVRational frame_rate = av_d2q(frameRate, 1001000); + AVRational time_base = av_inv_q(frame_rate); int pix_fmts[] = { pixelFormat, AV_PIX_FMT_NONE }; try { @@ -334,8 +335,8 @@ private void startVideoUnsafe() throws Exception { /* buffer video source: the decoded frames from the decoder will be inserted here. */ AVRational r = av_d2q(aspectRatio > 0 ? aspectRatio : 1, 255); - String args = String.format(Locale.ROOT, "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", - imageWidth, imageHeight, pixelFormat, time_base.num(), time_base.den(), r.num(), r.den()); + String args = String.format(Locale.ROOT, "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d:frame_rate=%d/%d", + imageWidth, imageHeight, pixelFormat, time_base.num(), time_base.den(), r.num(), r.den(), frame_rate.num(), frame_rate.den()); buffersrc_ctx = new AVFilterContext[videoInputs]; setpts_ctx = new AVFilterContext[videoInputs]; for (int i = 0; i < videoInputs; i++) {