--- /dev/null
+--- pHash-0.9.6/configure.ac.ffmpeg 2017-02-12 14:14:03.665670491 +0100
++++ pHash-0.9.6/configure.ac 2017-02-12 14:14:31.025702743 +0100
+@@ -110,7 +110,7 @@ fi])
+ AC_DEFUN([AC_CHECK_FFMPEG],
+ [
+ AC_MSG_CHECKING([whether FFmpeg is present])
+-AC_CHECK_LIB([avcodec], [avcodec_alloc_frame], [], [AC_MSG_ERROR([
++AC_CHECK_LIB([avcodec], [avcodec_parameters_alloc], [], [AC_MSG_ERROR([
+
+ *** libavcodec not found.
+ You need FFmpeg. Get it at <http://ffmpeg.org/>])])
+--- pHash-0.9.6/src/cimgffmpeg.cpp.ffmpeg 2017-02-12 14:56:45.098900259 +0100
++++ pHash-0.9.6/src/cimgffmpeg.cpp 2017-02-12 15:29:15.201289349 +0100
+@@ -39,11 +39,11 @@ void vfinfo_close(VFInfo *vfinfo){
+ int ReadFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList, unsigned int low_index, unsigned int hi_index)
+ {
+ //target pixel format
+- PixelFormat ffmpeg_pixfmt;
++ AVPixelFormat ffmpeg_pixfmt;
+ if (st_info->pixelformat == 0)
+- ffmpeg_pixfmt = PIX_FMT_GRAY8;
++ ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
+ else
+- ffmpeg_pixfmt = PIX_FMT_RGB24;
++ ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
+
+ st_info->next_index = low_index;
+
+@@ -100,30 +100,30 @@ int ReadFrames(VFInfo *st_info, CImgList
+ AVFrame *pFrame;
+
+ // Allocate video frame
+- pFrame=avcodec_alloc_frame();
++ pFrame=av_frame_alloc();
+ if (pFrame==NULL)
+ return -1;
+
+ // Allocate an AVFrame structure
+- AVFrame *pConvertedFrame = avcodec_alloc_frame();
++ AVFrame *pConvertedFrame = av_frame_alloc();
+ if(pConvertedFrame==NULL)
+ return -1;
+
+ uint8_t *buffer;
+ int numBytes;
+ // Determine required buffer size and allocate buffer
+- numBytes=avpicture_get_size(ffmpeg_pixfmt, st_info->width,st_info->height);
++ numBytes=av_image_get_buffer_size(ffmpeg_pixfmt, st_info->width,st_info->height,1);
+ buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
+ if (buffer == NULL)
+ return -1;
+
+- avpicture_fill((AVPicture *)pConvertedFrame,buffer,ffmpeg_pixfmt,st_info->width,st_info->height);
++ av_image_fill_arrays(pConvertedFrame->data,pConvertedFrame->linesize,buffer,ffmpeg_pixfmt,st_info->width,st_info->height,1);
+
+ int frameFinished;
+ int size = 0;
+
+
+- int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
++ int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
+
+ AVPacket packet;
+ int result = 1;
+@@ -160,7 +160,7 @@ int ReadFrames(VFInfo *st_info, CImgList
+ }
+ st_info->current_index++;
+ }
+- av_free_packet(&packet);
++ av_packet_unref(&packet);
+ }
+ }
+
+@@ -189,11 +189,11 @@ int ReadFrames(VFInfo *st_info, CImgList
+
+ int NextFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList)
+ {
+- PixelFormat ffmpeg_pixfmt;
++ AVPixelFormat ffmpeg_pixfmt;
+ if (st_info->pixelformat == 0)
+- ffmpeg_pixfmt = PIX_FMT_GRAY8;
++ ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
+ else
+- ffmpeg_pixfmt = PIX_FMT_RGB24;
++ ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
+
+ if (st_info->pFormatCtx == NULL)
+ {
+@@ -254,10 +254,10 @@ int NextFrames(VFInfo *st_info, CImgList
+ AVFrame *pFrame;
+
+ // Allocate video frame
+- pFrame=avcodec_alloc_frame();
++ pFrame=av_frame_alloc();
+
+ // Allocate an AVFrame structure
+- AVFrame *pConvertedFrame = avcodec_alloc_frame();
++ AVFrame *pConvertedFrame = av_frame_alloc();
+ if(pConvertedFrame==NULL){
+ return -1;
+ }
+@@ -265,13 +265,13 @@ int NextFrames(VFInfo *st_info, CImgList
+ uint8_t *buffer;
+ int numBytes;
+ // Determine required buffer size and allocate buffer
+- numBytes=avpicture_get_size(ffmpeg_pixfmt, st_info->width,st_info->height);
++ numBytes=av_image_get_buffer_size(ffmpeg_pixfmt, st_info->width,st_info->height,1);
+ buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
+ if (buffer == NULL){
+ return -1;
+ }
+
+- avpicture_fill((AVPicture *)pConvertedFrame,buffer,ffmpeg_pixfmt,st_info->width,st_info->height);
++ av_image_fill_arrays(pConvertedFrame->data,pConvertedFrame->linesize,buffer,ffmpeg_pixfmt,st_info->width,st_info->height,1);
+
+ int frameFinished;
+ int size = 0;
+@@ -287,7 +287,7 @@ int NextFrames(VFInfo *st_info, CImgList
+ break;
+ if(packet.stream_index == st_info->videoStream) {
+
+- int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
++ int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = packet.data;
+@@ -318,7 +318,7 @@ int NextFrames(VFInfo *st_info, CImgList
+ st_info->current_index++;
+ }
+ }
+- av_free_packet(&packet);
++ av_packet_unref(&packet);
+ }
+
+ av_free(buffer);
+--- pHash-0.9.6/src/cimgffmpeg.h.ffmpeg 2017-02-12 15:12:22.272120451 +0100
++++ pHash-0.9.6/src/cimgffmpeg.h 2017-02-12 15:13:11.995922157 +0100
+@@ -38,6 +38,7 @@ extern "C" {
+ #include "./libavformat/avformat.h"\r
+ #include "./libavcodec/avcodec.h"\r
+ #include "./libswscale/swscale.h"\r
++ #include <libavutil/imgutils.h>
+ }\r
+ \r
+ using namespace cimg_library;\r