summaryrefslogtreecommitdiff
path: root/examples/force_keyframe.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/force_keyframe.txt')
-rw-r--r--examples/force_keyframe.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/force_keyframe.txt b/examples/force_keyframe.txt
new file mode 100644
index 000000000..a9c16be82
--- /dev/null
+++ b/examples/force_keyframe.txt
@@ -0,0 +1,28 @@
+@TEMPLATE encoder_tmpl.c
+Forcing A Keyframe
+==================
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
+This is an example demonstrating how to control placement of keyframes
+on a frame-by-frame basis.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
+
+
+Configuration
+-------------
+Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the
+flags passed to `vpx_codec_control()`. In this example, we force a
+keyframe every 8 frames.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
+if(!(frame_cnt & 7))
+ flags |= VPX_EFLAG_FORCE_KF;
+else
+ flags &= ~VPX_EFLAG_FORCE_KF;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
+
+
+Observing The Effects
+---------------------
+The output of the encoder examples shows a 'K' rather than a dot '.'
+when the encoder generates a keyframe. Note that every 8 frames a 'K'
+is output.