Skip to content

Commit

Permalink
examples: fix transcoding priority option
Browse files Browse the repository at this point in the history
  • Loading branch information
fthiery committed Jun 28, 2021
1 parent 02b66a4 commit 22bff48
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions examples/transcode_all_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import sys


DEFAULT_TASKS_PRIORITY = 5


def transcode_all_videos(msc, priority):
def transcode_all_videos(msc):
more = True
start = ''
index = 0
Expand All @@ -36,7 +33,7 @@ def transcode_all_videos(msc, priority):
msc.api('medias/task/', method='post', data=dict(
oid=item['oid'],
task='transcoding',
params=json.dumps(dict(priority=priority or DEFAULT_TASKS_PRIORITY, behavior='delete'))
params=json.dumps(dict(priority='low', behavior='delete'))
), timeout=300)
except Exception as e:
if 'has no usable ressources' in str(e):
Expand All @@ -63,6 +60,4 @@ def transcode_all_videos(msc, priority):
msc = MediaServerClient(local_conf)
msc.check_server()

priority = int(sys.argv[2] if len(sys.argv) > 2 else '0')

transcode_all_videos(msc, priority)
transcode_all_videos(msc)

0 comments on commit 22bff48

Please sign in to comment.