diff --git a/ffmpeg.c b/ffmpeg.c
index d9027aeaffdab0289b207892c11a2e5e112f9f17..c7ea0f0746e6950dce8cff1d204161afb629c24a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -48,6 +48,10 @@
 #include <windows.h>
 #endif
 
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #if defined(HAVE_TERMIOS_H)
 #include <fcntl.h>
 #include <sys/ioctl.h>