Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-worker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-video-worker
Commits
547f270f
Commit
547f270f
authored
Feb 09, 2018
by
Gregory Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final cleanup
parent
b340f9c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
scripts/reencode_422_forceoverride.py
+17
-7
No files found.
scripts/reencode_422_forceoverride.py
View file @
547f270f
...
@@ -8,6 +8,7 @@ Meant to enforce a lack of DB connection, so information about sequential IDs in
...
@@ -8,6 +8,7 @@ Meant to enforce a lack of DB connection, so information about sequential IDs in
import
logging
import
logging
import
os
import
os
import
subprocess
import
sys
import
sys
import
yaml
import
yaml
...
@@ -16,6 +17,8 @@ from boto.exception import S3ResponseError
...
@@ -16,6 +17,8 @@ from boto.exception import S3ResponseError
from
boto.s3.key
import
Key
from
boto.s3.key
import
Key
from
os.path
import
expanduser
from
os.path
import
expanduser
from
video_worker.reporting
import
Output
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
homedir
=
expanduser
(
"~"
)
homedir
=
expanduser
(
"~"
)
...
@@ -73,7 +76,6 @@ class ForceColorspaceEncode(object):
...
@@ -73,7 +76,6 @@ class ForceColorspaceEncode(object):
)
)
encoding
.
run_file
()
encoding
.
run_file
()
x
+=
100
x
+=
100
break
class
FileReEncode
(
object
):
class
FileReEncode
(
object
):
...
@@ -140,11 +142,19 @@ class FileReEncode(object):
...
@@ -140,11 +142,19 @@ class FileReEncode(object):
sys_cmd
+=
" -crf 27 -movflags faststart {new_filepath}"
.
format
(
sys_cmd
+=
" -crf 27 -movflags faststart {new_filepath}"
.
format
(
new_filepath
=
new_filepath
new_filepath
=
new_filepath
)
)
return_code
=
os
.
system
(
sys_cmd
)
if
return_code
!=
0
:
Output
.
status_bar
(
print
(
'[SCRIPT] Encode Error : {code}'
.
format
(
code
=
return_code
))
process
=
subprocess
.
Popen
(
return
sys_cmd
,
print
(
'[SCRIPT] Encode Complete : {code}'
.
format
(
code
=
return_code
))
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
,
universal_newlines
=
True
)
)
# to be polite
print
print
(
'[SCRIPT] Encode Complete'
)
def
upload_file
(
self
):
def
upload_file
(
self
):
"""
"""
...
@@ -170,8 +180,8 @@ class FileReEncode(object):
...
@@ -170,8 +180,8 @@ class FileReEncode(object):
"""
"""
Delete working files
Delete working files
"""
"""
print
(
'[SCRIPT] Cleaning Workdir'
)
for
file
in
os
.
listdir
(
self
.
workdir
):
for
file
in
os
.
listdir
(
self
.
workdir
):
print
file
os
.
remove
(
os
.
path
.
join
(
self
.
workdir
,
file
))
os
.
remove
(
os
.
path
.
join
(
self
.
workdir
,
file
))
...
...
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