Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
moodle_rebase10.1.2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Blinov
moodle_rebase10.1.2
Commits
c05343bb
Commit
c05343bb
authored
Jul 22, 2019
by
Boris Kocherov
Committed by
Rafael Monnerat
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5testnode: add x11_video_catcher.sh
parent
f0ab14c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
software/seleniumrunner/software.cfg
software/seleniumrunner/software.cfg
+2
-0
software/seleniumrunner/x11_video_catcher.sh
software/seleniumrunner/x11_video_catcher.sh
+66
-0
No files found.
software/seleniumrunner/software.cfg
View file @
c05343bb
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
extends =
extends =
../../component/xorg/buildout.cfg
../../component/xorg/buildout.cfg
../../component/firefox/buildout.cfg
../../component/firefox/buildout.cfg
../../component/ffmpeg/buildout.cfg
../../component/coreutils/buildout.cfg
../../component/coreutils/buildout.cfg
../../stack/slapos.cfg
../../stack/slapos.cfg
./buildout.hash.cfg
./buildout.hash.cfg
...
@@ -17,6 +18,7 @@ parts =
...
@@ -17,6 +18,7 @@ parts =
slapos-cookbook
slapos-cookbook
template
template
xserver
xserver
ffmpeg
firefox-wrapper
firefox-wrapper
geckodriver
geckodriver
...
...
software/seleniumrunner/x11_video_catcher.sh
0 → 100755
View file @
c05343bb
#!/bin/sh
# scan running process and run ffmpeg
# for write video of xvfb session
while
true
;
do
while
!
[
-f
"
${
ffmpeg_bin
}
"
]
;
do
ffmpeg_bin
=
$(
find ~
-path
*
/bin/ffmpeg
-type
f
)
echo
${
ffmpeg_bin
}
[
-f
"
${
ffmpeg_bin
}
"
]
&&
break
sleep
10
done
ps
-u
$(
id
-u
)
-o
pid
=
|
\
while
read
pid
;
do
display
=
""
resolution
=
""
test
-d
/proc/
$pid
||
continue
cat
/proc/
$pid
/cmdline |
tr
'\0'
'\n'
|
head
-n1
|
grep
/bin/Xvfb
\$
>
/dev/null 2> /dev/null
||
continue
for
line
in
$(
cat
/proc/
$pid
/cmdline |
tr
'\0'
'\n'
2> /dev/null
)
;
do
if
echo
${
line
}
|
grep
-o
':[0-9]*'
>
/dev/null
;
then
display
=
"
${
line
}
"
fi
if
echo
${
line
}
|
grep
-o
'[0-9]*x[0-9]*x[0-9]*'
>
/dev/null
;
then
resolution
=
"
${
line
%x*
}
"
fi
done
if
[
-n
"
${
display
}
"
]
&&
[
-n
"
${
resolution
}
"
]
;
then
firefox_pid
=
""
for
f_pid
in
$(
ps
-u
$(
id
-u
)
-o
pid
=
)
;
do
test
-d
/proc/
${
f_pid
}
||
continue
cat
/proc/
${
f_pid
}
/cmdline |
tr
'\0'
'\n'
|
head
-n1
|
grep
./firefox
\$
>
/dev/null 2> /dev/null
||
continue
cat
/proc/
${
f_pid
}
/environ |
tr
'\0'
'\n'
|
grep
^DISPLAY
=
${
display
}
\$
>
/dev/null 2> /dev/null
||
continue
firefox_pid
=
"
$f_pid
"
break
;
done
if
[
-z
"
${
firefox_pid
}
"
]
;
then
continue
fi
filename
=
"output
${
firefox_pid
}
.webm"
test
-f
${
filename
}
&&
continue
echo
"xvfb
${
pid
}
${
display
}
${
resolution
}
"
echo
"firefox
${
firefox_pid
}
"
export
DISPLAY
=
${
display
}
"
${
ffmpeg_bin
}
"
-loglevel
error
-r
30
-s
${
resolution
}
-f
x11grab
-i
${
display
}
.0
\
-vf
unpremultiply
=
inplace
=
1
\
-c
:v libvpx-vp9
-lossless
1
\
-f
webm
${
filename
}
&
ffmpeg_pid
=
$!
sleep
5
if
!
test
-f
${
filename
}
;
then
kill
${
ffmpeg_pid
}
continue
fi
echo
run ffmpeg
${
ffmpeg_pid
}
while
true
;
do
if
!
[
-d
"/proc/
${
firefox_pid
}
"
]
;
then
echo
"kill ffmpeg
$ffmpeg_pid
"
kill
${
ffmpeg_pid
}
exit
fi
sleep
0.2
done
&
fi
done
sleep
1
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment