[FFmpeg-devel] [PATCH v3 7/8] fate: run command and get logs
Nicolas Gaullier
nicolas.gaullier at arkena.com
Mon Feb 19 15:16:49 EET 2018
rungetavlogs() allows to get avlog messages (instead of stdout)
---
tests/fate-run.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 05f4ca5e20..0f28af5858 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -84,6 +84,20 @@ runecho(){
$target_exec $target_path/"$@" >&3
}
+# $1=regex $2..$n=command
+# catch av_log messages
+rungetavlogs(){
+ test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"${@:2}" >&3
+ $target_exec $target_path/"${@:2}" 3>&2 2>&1 1>&3|awk -F' ' "{
+ if (/${@:1:1}/) {
+ for(i=4; i<=NF; ++i)
+ printf \$i FS
+ print \"\"
+ } else {
+ print > \"/dev/stderr\"}
+ }"
+}
+
probefmt(){
run ffprobe${PROGSUF} -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@"
}
--
2.15.0
More information about the ffmpeg-devel
mailing list