ildetect.sh: add a quiet mode; verify telecine decision

For quiet mode: ILDETECT_QUIET=1 ildetect.sh ...

Telecine decision (guess by ildetect.so) is verified by retrying the
ildetect run with the pullup filter inserted.
This commit is contained in:
Rudolf Polzer 2013-06-20 19:21:49 +02:00
parent c430d89adb
commit 1fc7dfe68f
1 changed files with 18 additions and 5 deletions

View File

@ -14,6 +14,7 @@ esac
: ${ILDETECT_MPV:=$MPV} : ${ILDETECT_MPV:=$MPV}
: ${ILDETECT_MPVFLAGS:=--start=35% --length=35} : ${ILDETECT_MPVFLAGS:=--start=35% --length=35}
: ${ILDETECT_DRY_RUN:=} : ${ILDETECT_DRY_RUN:=}
: ${ILDETECT_QUIET:=}
: ${MAKE:=make} : ${MAKE:=make}
# exit status: # exit status:
@ -33,7 +34,8 @@ testfun()
--vf=dlopen="$MYDIR/ildetect.so" \ --vf=dlopen="$MYDIR/ildetect.so" \
--o= --vo=null --no-audio --untimed \ --o= --vo=null --no-audio --untimed \
$ILDETECT_MPVFLAGS \ $ILDETECT_MPVFLAGS \
| tee /dev/stderr | grep "^ildetect:" | { if [ -n "$ILDETECT_QUIET" ]; then cat; else tee /dev/stderr; fi } \
| grep "^ildetect:"
} }
out=`testfun "$@"` out=`testfun "$@"`
@ -45,10 +47,21 @@ case "$out" in
exit 0 exit 0
;; ;;
*"probably: TELECINED"*) *"probably: TELECINED"*)
[ -n "$ILDETECT_DRY_RUN" ] || $ILDETECT_MPV "$@" -vf-pre pullup out2=`ILDETECT_MPVFLAGS="$ILDETECT_MPVFLAGS --vf-pre=pullup,scale" testfun "$@"`
r=$? case "$out2" in
[ $r -eq 0 ] || exit $(($r | 16)) *"probably: TELECINED"*|*"probably: INTERLACED"*)
exit 1 [ -n "$ILDETECT_DRY_RUN" ] || $ILDETECT_MPV "$@" -vf-pre yadif
r=$?
[ $r -eq 0 ] || exit $(($r | 16))
exit 2
;;
*)
[ -n "$ILDETECT_DRY_RUN" ] || $ILDETECT_MPV "$@" -vf-pre pullup
r=$?
[ $r -eq 0 ] || exit $(($r | 16))
exit 1
;;
esac
;; ;;
*"probably: INTERLACED"*) *"probably: INTERLACED"*)
[ -n "$ILDETECT_DRY_RUN" ] || $ILDETECT_MPV "$@" -vf-pre yadif [ -n "$ILDETECT_DRY_RUN" ] || $ILDETECT_MPV "$@" -vf-pre yadif