diff --git a/examples/Makefile.am b/examples/Makefile.am
index 40c72f06d1eb5c3bdb67502a99ede36c0d8fa181..999b0d90cba970effa841ad7a9addbdca4a52612 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -5,6 +5,7 @@ noinst_PROGRAMS = dump_video dump_psnr libtheora_info \
 
 # possible contents of BUILDABLE_EXAMPLES:
 EXTRA_PROGRAMS = player_example encoder_example png2theora tiff2theora
+EXTRA_DIST = encoder_example_ffmpeg
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = $(OGG_CFLAGS)
diff --git a/examples/encoder_example_ffmpeg b/examples/encoder_example_ffmpeg
new file mode 100755
index 0000000000000000000000000000000000000000..424df787b3ae9789abf37df3bb7e6d3b77e4782e
--- /dev/null
+++ b/examples/encoder_example_ffmpeg
@@ -0,0 +1,29 @@
+#!/bin/sh
+####################################################################
+#                                                                  #
+# THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   #
+# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     #
+# GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE #
+# IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       #
+#                                                                  #
+# THE Theora SOURCE CODE IS COPYRIGHT (C) 2009,2025                #
+# by the Xiph.Org Foundation and contributors http://www.xiph.org/ #
+#                                                                  #
+####################################################################
+
+set -x
+
+video=`mktemp`
+audio=`mktemp`
+
+rm -f $video $audio
+mkfifo $video $audio
+
+# A single process can handle both, but this results in deadlock because
+# mplayer is single-threaded.
+mplayer "$1" -ao null -vo yuv4mpeg:file=$video > /dev/null 2>&1 &
+mplayer "$1" -vo null -ao pcm:file=$audio > /dev/null 2>&1 &
+
+theora_encoder_example $video $audio > "$2".new && mv "$2".new $2
+
+rm -f $video $audio