diff --git a/libmedia/ffmpeg/VideoConverterFfmpeg.cpp b/libmedia/ffmpeg/VideoConverterFfmpeg.cpp
index 74aa55f..da11e5d 100644
--- a/libmedia/ffmpeg/VideoConverterFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoConverterFfmpeg.cpp
@@ -57,7 +57,7 @@ private:
 
 // The lookup table in this function is adapted from chroma.c from the VLC
 // codebase; its license permits distribution under GPLv3 and later.
-PixelFormat
+AVPixelFormat
 fourcc_to_ffmpeg(ImgBuf::Type4CC code)
 {
 
@@ -68,40 +68,40 @@ fourcc_to_ffmpeg(ImgBuf::Type4CC code)
     static const struct
     {
         ImgBuf::Type4CC  fourcc;
-        PixelFormat ffmpegcode;
+        AVPixelFormat ffmpegcode;
     } pixfmt_table[] =
     {
         // Planar YUV formats
-        {GNASH_FOURCC('I','4','4','4'), PIX_FMT_YUV444P},
-        {GNASH_FOURCC('J','4','4','4'), PIX_FMT_YUVJ444P},
+        {GNASH_FOURCC('I','4','4','4'), AV_PIX_FMT_YUV444P},
+        {GNASH_FOURCC('J','4','4','4'), AV_PIX_FMT_YUVJ444P},
 
 #if LIBAVUTIL_VERSION_INT >= ((49<<16)+(5<<8)+0)
-        {GNASH_FOURCC('I','4','4','0'), PIX_FMT_YUV440P},
-        {GNASH_FOURCC('J','4','4','0'), PIX_FMT_YUVJ440P},
+        {GNASH_FOURCC('I','4','4','0'), AV_PIX_FMT_YUV440P},
+        {GNASH_FOURCC('J','4','4','0'), AV_PIX_FMT_YUVJ440P},
 #endif
 
-        {GNASH_FOURCC('I','4','2','2'), PIX_FMT_YUV422P},
-        {GNASH_FOURCC('J','4','2','2'), PIX_FMT_YUVJ422P},
+        {GNASH_FOURCC('I','4','2','2'), AV_PIX_FMT_YUV422P},
+        {GNASH_FOURCC('J','4','2','2'), AV_PIX_FMT_YUVJ422P},
 
-        {GNASH_FOURCC('I','4','2','0'), PIX_FMT_YUV420P},
-        {GNASH_FOURCC('Y','V','1','2'), PIX_FMT_YUV420P},
-        {GNASH_FOURCC('I','Y','U','V'), PIX_FMT_YUV420P},
-        {GNASH_FOURCC('J','4','2','0'), PIX_FMT_YUVJ420P},
-        {GNASH_FOURCC('I','4','1','1'), PIX_FMT_YUV411P},
-        {GNASH_FOURCC('I','4','1','0'), PIX_FMT_YUV410P},
-        {GNASH_FOURCC('Y','V','U','9'), PIX_FMT_YUV410P},
+        {GNASH_FOURCC('I','4','2','0'), AV_PIX_FMT_YUV420P},
+        {GNASH_FOURCC('Y','V','1','2'), AV_PIX_FMT_YUV420P},
+        {GNASH_FOURCC('I','Y','U','V'), AV_PIX_FMT_YUV420P},
+        {GNASH_FOURCC('J','4','2','0'), AV_PIX_FMT_YUVJ420P},
+        {GNASH_FOURCC('I','4','1','1'), AV_PIX_FMT_YUV411P},
+        {GNASH_FOURCC('I','4','1','0'), AV_PIX_FMT_YUV410P},
+        {GNASH_FOURCC('Y','V','U','9'), AV_PIX_FMT_YUV410P},
 
 #if LIBAVUTIL_VERSION_INT >= ((49<<16)+(0<<8)+1)
-        {GNASH_FOURCC('N','V','1','2'), PIX_FMT_NV12},
-        {GNASH_FOURCC('N','V','2','1'), PIX_FMT_NV21},
+        {GNASH_FOURCC('N','V','1','2'), AV_PIX_FMT_NV12},
+        {GNASH_FOURCC('N','V','2','1'), AV_PIX_FMT_NV21},
 #endif
 
-        {GNASH_FOURCC('Y','U','Y','2'), PIX_FMT_YUYV422},
-        {GNASH_FOURCC('Y','U','Y','V'), PIX_FMT_YUYV422},
-        {GNASH_FOURCC('U','Y','V','Y'), PIX_FMT_UYVY422},
-        {GNASH_FOURCC('Y','4','1','1'), PIX_FMT_UYYVYY411},
+        {GNASH_FOURCC('Y','U','Y','2'), AV_PIX_FMT_YUYV422},
+        {GNASH_FOURCC('Y','U','Y','V'), AV_PIX_FMT_YUYV422},
+        {GNASH_FOURCC('U','Y','V','Y'), AV_PIX_FMT_UYVY422},
+        {GNASH_FOURCC('Y','4','1','1'), AV_PIX_FMT_UYYVYY411},
 
-        { 0, PIX_FMT_NONE}
+        { 0, AV_PIX_FMT_NONE}
     };
 #undef GNASH_FOURCC
 
@@ -112,13 +112,13 @@ fourcc_to_ffmpeg(ImgBuf::Type4CC code)
         }
     }
    
-    return PIX_FMT_NONE;
+    return AV_PIX_FMT_NONE;
 }
 
 VideoConverterFfmpeg::VideoConverterFfmpeg(ImgBuf::Type4CC srcFormat, ImgBuf::Type4CC dstFormat)
     : VideoConverter(srcFormat, dstFormat)
 {
-     if(fourcc_to_ffmpeg(_dst_fmt) == PIX_FMT_NONE) {
+     if(fourcc_to_ffmpeg(_dst_fmt) == AV_PIX_FMT_NONE) {
          throw MediaException(_("VideoConverterFfmpeg cannot convert to the "
                               "requested format"));
      }
@@ -138,9 +138,9 @@ VideoConverterFfmpeg::convert(const ImgBuf& src)
     const int width = src.width;
     const int height = src.height;
 
-    PixelFormat dst_pixFmt = fourcc_to_ffmpeg(_dst_fmt);
-    assert(dst_pixFmt != PIX_FMT_NONE);
-    PixelFormat src_pixFmt = PIX_FMT_RGB24;
+    AVPixelFormat dst_pixFmt = fourcc_to_ffmpeg(_dst_fmt);
+    assert(dst_pixFmt != AV_PIX_FMT_NONE);
+    AVPixelFormat src_pixFmt = AV_PIX_FMT_RGB24;
     
 #ifdef HAVE_SWSCALE_H
 
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index 20d49b9..caa0377 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -51,7 +51,7 @@ namespace {
     void set_vaapi_context(AVCodecContext* avctx, VaapiContextFfmpeg* vactx);
     void clear_vaapi_context(AVCodecContext* avctx);
     void reset_context(AVCodecContext* avctx, VaapiContextFfmpeg* vactx = nullptr);
-    PixelFormat get_format(AVCodecContext* avctx, const PixelFormat* fmt);
+    AVPixelFormat get_format(AVCodecContext* avctx, const AVPixelFormat* fmt);
 #if LIBAVCODEC_VERSION_MAJOR >= 55
     int get_buffer(AVCodecContext* avctx, AVFrame* pic, int flags);
 #else
@@ -251,16 +251,16 @@ VideoDecoderFfmpeg::frameToImage(AVCodecContext* srcCtx,
                                  const AVFrame& srcFrameRef)
 {
     const AVFrame *srcFrame = &srcFrameRef;
-    PixelFormat srcPixFmt = srcCtx->pix_fmt;
+    AVPixelFormat srcPixFmt = srcCtx->pix_fmt;
 
     const int width = srcCtx->width;
     const int height = srcCtx->height;
 
 #ifdef FFMPEG_VP6A
-    PixelFormat pixFmt = (srcCtx->codec->id == AV_CODEC_ID_VP6A) ?
-        PIX_FMT_RGBA : PIX_FMT_RGB24;
+    AVPixelFormat pixFmt = (srcCtx->codec->id == AV_CODEC_ID_VP6A) ?
+        AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24;
 #else 
-    PixelFormat pixFmt = PIX_FMT_RGB24;
+    AVPixelFormat pixFmt = AV_PIX_FMT_RGB24;
 #endif 
 
     std::unique_ptr<image::GnashImage> im;
@@ -306,10 +306,10 @@ VideoDecoderFfmpeg::frameToImage(AVCodecContext* srcCtx,
 
     switch (pixFmt)
     {
-        case PIX_FMT_RGBA:
+        case AV_PIX_FMT_RGBA:
             im.reset(new image::ImageRGBA(width, height));
             break;
-        case PIX_FMT_RGB24:
+        case AV_PIX_FMT_RGB24:
             im.reset(new image::ImageRGB(width, height));
             break;
         default:
@@ -325,7 +325,7 @@ VideoDecoderFfmpeg::frameToImage(AVCodecContext* srcCtx,
     avpicture_fill(&picture, im->begin(), pixFmt, width, height);
 
 #ifndef HAVE_SWSCALE_H
-    img_convert(&picture, PIX_FMT_RGB24, (AVPicture*)srcFrame,
+    img_convert(&picture, AV_PIX_FMT_RGB24, (AVPicture*)srcFrame,
             srcPixFmt, width, height);
 #else
 
@@ -499,15 +499,15 @@ reset_context(AVCodecContext* avctx, VaapiContextFfmpeg* vactx)
 }
 
 /// AVCodecContext.get_format() implementation
-PixelFormat
-get_format(AVCodecContext* avctx, const PixelFormat* fmt)
+AVPixelFormat
+get_format(AVCodecContext* avctx, const AVPixelFormat* fmt)
 {
 #ifdef HAVE_VA_VA_H
     VaapiContextFfmpeg* const vactx = get_vaapi_context(avctx);
 
     if (vactx) {
-        for (int i = 0; fmt[i] != PIX_FMT_NONE; i++) {
-            if (fmt[i] != PIX_FMT_VAAPI_VLD) continue;
+        for (int i = 0; fmt[i] != AV_PIX_FMT_NONE; i++) {
+            if (fmt[i] != AV_PIX_FMT_VAAPI_VLD) continue;
 
             if (vactx->initDecoder(avctx->width, avctx->height)) {
                 return fmt[i];
