parent
73b88c3a1a
commit
cf17954a3b
@ -1,64 +0,0 @@
|
|||||||
From 5e7d1ec0f6aa3e1627bd4ee959d8470dea2159d0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
|
||||||
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
|
|
@ -1 +1 @@
|
|||||||
SHA512 (os-autoinst-f5d91659fd74b634d31681437f7bd6f7ead6bc41.tar.gz) = 7de54010f3b77569b76c988ca4f5599523dcfea4eadccdb0ef7b03be268465411b9f4c097e75669df15a06d1a5712fc114ae1c586a2ea0091aae563f1e6a74f5
|
SHA512 (os-autoinst-44e93d8dfa546da132a7127a0edf0656cc3e0807.tar.gz) = c070801cb45dc104a4ae606abb12402bd3ffb0a093bbbcf41a29be2a05709db11b2c2c2589c47bf1e70326a4e7d26fa483a520055b67971ab3231252be268f90
|
||||||
|
Loading…
Reference in new issue