Revision: 3530
Author: grepper
Date: Sun Feb 15 22:47:24 2015 UTC
Log: Use ffmpeg to identify file in is_video()
https://code.google.com/p/tovid/source/detail?r=3530
Modified:
/trunk/tovid/src/todisc
=======================================
--- /trunk/tovid/src/todisc Wed Feb 11 16:08:18 2015 UTC
+++ /trunk/tovid/src/todisc Sun Feb 15 22:47:24 2015 UTC
@@ -699,10 +699,16 @@
(( ${ff_ver:2:1} == test_version )) 2>/dev/null
}
-is_video()
-{
- { file -biL "$1" |grep -qw video; } || { file -bL "$1" | grep -qw
video; }
+# check if file is a video. Usage: is_video FILE
+is_video ()
+{
+ local result=$(ffmpeg -i "$1" 2>&1);
+ # ffmpeg calls an image a video stream, so eliminate that
+ grep -qi image2 <<< "$result" && return 1;
+
+ grep -qi Stream.*Video <<< "$result"
}
+
check_filetype()
{