diff --git a/main/file.c b/main/file.c
index 1bef768bad728adbeb682acb749c5eb550f2c946..2f1789481accca9beda9e510438a719c0961df49 100644
--- a/main/file.c
+++ b/main/file.c
@@ -379,7 +379,8 @@ static int ast_filehelper(const char *filename, const void *arg2, const char *fm
 				struct ast_filestream *s;
 
 				if ( !(chan->writeformat & f->format) &&
-				     !(f->format & AST_FORMAT_AUDIO_MASK && fmt)) {
+				     !((f->format & AST_FORMAT_AUDIO_MASK && fmt) ||
+					  (f->format & AST_FORMAT_VIDEO_MASK && fmt))) {
 					ast_free(fn);
 					continue;	/* not a supported format */
 				}