From 56864d5683ecb0075cb768483cf94829c3fb7d27 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 19 Nov 2018 14:24:22 -0800 Subject: [PATCH] Update to latest git again, backport video timestamp patch --- 1059.patch | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ os-autoinst.spec | 13 +++++++--- 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 1059.patch diff --git a/1059.patch b/1059.patch new file mode 100644 index 0000000..ffc6836 --- /dev/null +++ b/1059.patch @@ -0,0 +1,64 @@ +From 5e7d1ec0f6aa3e1627bd4ee959d8470dea2159d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Wed, 7 Nov 2018 21:17:01 +0100 +Subject: [PATCH] Use video captions to overlay wallclock time + +Although durations and absolute time can be somewhat derived using the +framerate (it is captured with nominally 2 fps), this is cumbersome and +not always correct. There are occasional frame drops due to stalls or long +running screen matches, especially on e.g. aarch64. + +Create a caption file which shows the same time stamps as the autoinst.log, +these can be overlaid over the actual video. + +See poo#42050 for details. +--- + backend/baseclass.pm | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/backend/baseclass.pm b/backend/baseclass.pm +index f1e4ed0ad..1330594a8 100644 +--- a/backend/baseclass.pm ++++ b/backend/baseclass.pm +@@ -307,6 +307,9 @@ sub start_encoder { + + $self->{encoder_pipe}->blocking(0); + ++ open($self->{vtt_caption_file}, '>', "$cwd/video_time.vtt"); ++ $self->{vtt_caption_file}->print("WEBVTT\n"); ++ + return; + } + +@@ -404,6 +407,22 @@ sub cpu_stat { + return []; + } + ++sub format_vtt_timestamp { ++ my ($self, $walltime) = @_; ++ ++ my $frametime_ms = 1000 * $self->{video_frame_number} / 24; ++ my $caption = "\n$self->{video_frame_number}\n"; ++ # presentation time span (one frame) ++ $caption .= sprintf(POSIX::strftime("%T.%%03d", gmtime($frametime_ms / 1000)), $frametime_ms % 1000); ++ $frametime_ms += 1000 / 24; ++ $caption .= " --> "; ++ $caption .= sprintf(POSIX::strftime("%T.%%03d\n", gmtime($frametime_ms / 1000)), $frametime_ms % 1000); ++ # clock value as caption text ++ $caption .= sprintf(POSIX::strftime("[%FT%T.%%03d]\n", localtime($walltime)), 1000 * ($walltime - int($walltime))); ++ ++ return $caption; ++} ++ + sub enqueue_screenshot { + my ($self, $image) = @_; + +@@ -427,6 +446,8 @@ sub enqueue_screenshot { + $self->{min_video_similarity} -= 1; + $self->{min_video_similarity} = $sim if $sim < $self->{min_video_similarity}; + ++ $self->{vtt_caption_file}->print($self->format_vtt_timestamp(gettimeofday)); ++ + # we have two different similarity levels - one (slightly higher value, based + # t/data/user-settings-*) to determine if it's worth it to recheck needles + # and one (slightly lower as less significant) determining if we write the frame diff --git a/os-autoinst.spec b/os-autoinst.spec index d4bd0be..0016760 100644 --- a/os-autoinst.spec +++ b/os-autoinst.spec @@ -23,19 +23,22 @@ %global github_owner os-autoinst %global github_name os-autoinst %global github_version 4.5 -%global github_commit dced72b1424ebac7a2b177fc0a325916047488f2 +%global github_commit f5d91659fd74b634d31681437f7bd6f7ead6bc41 # if set, will be a post-release snapshot build, otherwise a 'normal' build -%global github_date 20181113 +%global github_date 20181119 %global shortcommit %(c=%{github_commit}; echo ${c:0:7}) Name: os-autoinst Version: %{github_version} -Release: 8%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} +Release: 9%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} Summary: OS-level test automation License: GPLv2+ Group: Development/System URL: https://os-autoinst.github.io/openQA/ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz +# Output a video caption file to overlay wallclock time on videos +# https://github.com/os-autoinst/os-autoinst/pull/1059 +Patch0: 1059.patch BuildRequires: autoconf BuildRequires: automake @@ -224,6 +227,10 @@ make check VERBOSE=1 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf %changelog +* Mon Nov 19 2018 Adam Williamson - 4.5-9.2018119gitf5d9165 +- Bump to latest git again +- Backport a patch related to new video timestamp feature + * Wed Nov 14 2018 Adam Williamson - 4.5-8.2018113gitdced72b - Bump to latest git - Resync with upstream spec