diff --git a/cmdutils.c b/cmdutils.c
index b87eea363ae87b2d32294097e337cd553e608832..d4afc02f6ae97fc30395b81b66ec8373173e5d72 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -413,6 +413,16 @@ void show_license(void)
     );
 }
 
+void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
+{
+    int i;
+    char fmt_str[128];
+    for (i=-1; i < nb_fmts; i++) {
+        get_fmt_string (fmt_str, sizeof(fmt_str), i);
+        fprintf(stdout, "%s\n", fmt_str);
+    }
+}
+
 void show_formats(void)
 {
     AVInputFormat *ifmt=NULL;
diff --git a/cmdutils.h b/cmdutils.h
index c2734a1e313a3a2e64b1c4404508030b676d3aa4..40bdea36d1e9e17bbdfc135fbd24c97d0f4862cb 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -131,6 +131,8 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags);
 
 void print_error(const char *filename, int err);
 
+void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts);
+
 /**
  * Prints the program banner to stderr. The banner contents depend on the
  * current version of the repository and of the libav* libraries used by
diff --git a/ffmpeg.c b/ffmpeg.c
index d1a00b81d0647a3954f728e18b594a3311decd9f..a1abd30cfed69b304d39a0e83e6885c4fe884efe 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2564,16 +2564,6 @@ static void opt_frame_pad_right(const char *arg)
     }
 }
 
-static void list_fmts(void (*get_fmt_string)(char *buf, int buf_size, int fmt), int nb_fmts)
-{
-    int i;
-    char fmt_str[128];
-    for (i=-1; i < nb_fmts; i++) {
-        get_fmt_string (fmt_str, sizeof(fmt_str), i);
-        fprintf(stdout, "%s\n", fmt_str);
-    }
-}
-
 static void opt_frame_pix_fmt(const char *arg)
 {
     if (strcmp(arg, "list")) {