Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transcoding to AV1 to default set #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fkbeta/fk/fixtures/frikanalen.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
"fsname": "srt"
}
},
{
"model": "fk.fileformat",
"pk": 9,
"fields": {
"fsname": "av1"
}
},
{
"model": "fk.category",
"pk": 119,
Expand Down
12 changes: 11 additions & 1 deletion utils/move_and_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'original': 6,
'theora': 7,
'srt': 8,
'av1': 9,
}
for k, v in list(VF_FORMATS.items()):
VF_FORMATS[v] = k
Expand All @@ -56,6 +57,10 @@ class Converter(object):
'-qscale:v 7 -qscale:a 2 -vf scale=720:-1'),
'ext': 'ogv',
},
'av1': {
'ffmpeg': '-c:v libaom-av1 -strict -2',
'ext': 'avi',
},
'broadcast': {
'ffmpeg': '-target pal-dv',
'ext': 'dv',
Expand Down Expand Up @@ -95,6 +100,7 @@ def get_formats(cls, filepath):
else:
assert 'broadcast' in path
formats.append('theora')
formats.append('av1')
return formats


Expand All @@ -111,7 +117,11 @@ def run(cls, cmd, filepath=None, reprocess=False):
else:
logging.info("SKIP already existing file: %s", filepath)
return
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex: # error code <> 0
logging.debug(ex.output.decode('utf-8'))
raise
logging.debug(output.decode('utf-8'))


Expand Down
6 changes: 4 additions & 2 deletions utils/test_move_and_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ def test_generate(self):
('/tmp/original/test.ogv', [
'/tmp/large_thumb/test.jpg',
'/tmp/broadcast/test.dv',
'/tmp/theora/test.ogv']),
'/tmp/theora/test.ogv',
'/tmp/av1/test.avi']),
('/tmp/broadcast/test.ogv', [
'/tmp/large_thumb/test.jpg',
'/tmp/theora/test.ogv']),
'/tmp/theora/test.ogv',
'/tmp/av1/test.avi']),
)
nop = lambda *_, **__: None
for t in tests:
Expand Down