cds-videos icon indicating copy to clipboard operation
cds-videos copied to clipboard

Re-run transcoding for missing slaves

Open ntarocco opened this issue 7 years ago • 5 comments

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']

egabancho avatar Dec 07 '17 15:12 egabancho

posible duplicate https://github.com/CERNDocumentServer/cds-videos/issues/1401

egabancho avatar Dec 07 '17 18:12 egabancho

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.

egabancho avatar Dec 11 '17 09:12 egabancho

Also, check how many missing/(in error state) slaves we have since we moved to videos.cern.ch

ludmilamarian avatar Feb 21 '18 10:02 ludmilamarian

@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.

ntarocco avatar Mar 06 '18 17:03 ntarocco