cds-videos
cds-videos copied to clipboard
Re-run transcoding for missing slaves
There was a small problem with TranscodeQuiet fixed here https://github.com/CERNDocumentServer/cds-videos/pull/1421
Running this should create all the slaves missing.
from cds.modules.deposit.api import Video
from cds.modules.migrator.records import CDSRecordDumpLoader
from invenio_pidstore.models import PersistentIdentifier
from invenio_records.api import Record
for pid in PersistentIdentifier.query.filter(
PersistentIdentifier.pid_type == 'depid').all():
deposit = Record.get_record(pid.object_uuid)
if deposit['$schema'] != 'video':
continue
deposit = Video.get_record(pid.object_uuid)
CDSRecordDumpLoader._create_missing_subformats(None, deposit)
Better version :)
from cds.modules.deposit.api import deposit_video_resolver
from invenio_pidstore.models import PersistentIdentifier
from cds.modules.records.api import Record
# Only videos have DOIs
pids = PersistentIdentifier.query.filter(PersistentIdentifier.pid_type=='doi').all()
for pid in pids:
record = Record.get_record(pid.object_uuid)
if record.get('_files') and not record['_files'][0].get('subformat'):
try:
video = deposit_video_resolver(record['_deposit']['id']))
CDSRecordDumpLoader._create_missing_subformats(None, video)
except KeyError:
print record['recid']
posible duplicate https://github.com/CERNDocumentServer/cds-videos/issues/1401
We had 1631 videos without slaves, mostly Footage. After running the script above we still have 1459 left because Sorenson runs out of disk space when running tasks in batch (probably it doesn't clean up as fast as it should)
Before running the script again we need to see with Ruben/Marek what is the best course of action.
Also, check how many missing/(in error state) slaves we have since we moved to videos.cern.ch
@ludmilamarian @egabancho before re-run transcoding, maybe we should wait for: https://github.com/CERNDocumentServer/cds-videos/issues/1570, otherwise some of the regenerated subformats will re-create a wrong playlist
file.