From af9e3fc7a09f2a0ee3b64d04a88282b8c640fd18 Mon Sep 17 00:00:00 2001 From: Edison Wang Date: Sun, 10 Aug 2014 15:49:58 -0400 Subject: [PATCH] ffmpeg will only assign the correct keyframe flag to the video pkt, which is the one used later to be written to the final file. --- src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java b/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java index c242bf4a..005d19c6 100644 --- a/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java +++ b/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java @@ -725,7 +725,7 @@ public boolean record(IplImage image, int pixelFormat) throws Exception { } } } - return picture.key_frame() != 0; + return (video_pkt.flags() & AV_PKT_FLAG_KEY) == 1; } @Override public boolean record(int sampleRate, int audioChannels, Buffer ... samples) throws Exception {