diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 1f59b0c5445b189fc56cfee0a5bbf4512824f4ae..ec179112c2e12d047f5c37176aa4c99645ae4417 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3289,6 +3289,7 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
 /**
  * @deprecated Use av_get_pix_fmt_string() instead.
  */
+attribute_deprecated
 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
 #endif