Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
jobmanager
Commits
33ec8268
Commit
33ec8268
authored
Apr 15, 2017
by
Andreas Valder
Browse files
debian ships python 3.4...
parent
12cc6fff
Changes
1
Hide whitespace changes
Inline
Side-by-side
worker.py
View file @
33ec8268
...
...
@@ -24,9 +24,9 @@ if (jobtype == 'thumbnail'):
inputfile
=
config
[
'MAIN'
][
'VIDEOS_RELEASED'
]
+
'/'
+
data
[
'path'
]
outputfile
=
config
[
'MAIN'
][
'VIDEOS_RELEASED'
]
+
'/'
+
config
[
'thumbnail'
][
'folder'
]
+
'/'
+
'l_'
+
str
(
data
[
'lectureid'
])
+
'.jpg'
api
.
job_ping
(
id
=
id
)
duration
=
float
(
subprocess
.
run
([
"ffprobe"
,
"-v"
,
"error"
,
"-show_entries"
,
"format=duration"
,
"-of"
,
"default=noprint_wrappers=1:nokey=1"
,
inputfile
]
,
stdout
=
subprocess
.
PIPE
).
stdout
)
duration
=
float
(
subprocess
.
check_output
([
"ffprobe"
,
"-v"
,
"error"
,
"-show_entries"
,
"format=duration"
,
"-of"
,
"default=noprint_wrappers=1:nokey=1"
,
inputfile
]
)
)
api
.
job_ping
(
id
=
id
)
if
subprocess
.
run
([
"ffmpeg"
,
"-loglevel"
,
"error"
,
"-y"
,
"-ss"
,
str
(
duration
*
0.4
),
"-i"
,
inputfile
,
"-vf"
,
"scale=640:-1"
,
"-frames:v"
,
"1"
,
outputfile
])
.
returncode
==
0
:
if
subprocess
.
call
([
"ffmpeg"
,
"-loglevel"
,
"error"
,
"-y"
,
"-ss"
,
str
(
duration
*
0.4
),
"-i"
,
inputfile
,
"-vf"
,
"scale=640:-1"
,
"-frames:v"
,
"1"
,
outputfile
])
==
0
:
api
.
job_ping
(
id
=
id
,
state
=
'finished'
)
else
:
api
.
job_ping
(
id
=
id
,
state
=
'failed'
)
...
...
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