diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index ca5e107db3561ed8c7afad66d319f7ad3473d95d..4e62b8727a6f4ee220aa5317d168127716ff1cf7 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -203,12 +203,6 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
 
     c = st->codec;
 
-    /* find the video encoder */
-    codec = avcodec_find_encoder(codec_id);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
     avcodec_get_context_defaults3(c, codec);
 
     c->codec_id = codec_id;