// @ts-nocheck import { v4 as uuid } from 'uuid'; import { Rrtq } from '@ownzones/rrtq'; import { config, log } from '../config'; const rrtq = new Rrtq({ redis: { host: 'mv-test-dev.gkdzto.0001.use1.cache.amazonaws.com', port: 6379, database: 5, }, }); // const rrtq = new Rrtq({ // redis: config.redis, // }); // const rrtq = new Rrtq({ // redis: { // host: 'localhost', // port: 6000, // database: 5, // }, // }); const uhdJ2kSegment = { id: '5030644094c1be9dd0ea215680bae13c', cacheLocation: 's3://oz_zl_api_test-dev/test/mv-cache/', orgId: 'test', url: 's3://oz_zl_api_test-dev/test/aa_UHD_01_bt709_23976.mxf', entryPoint: 480, editUnits: 5 * 24, duration: 5 * 1.001, totalStartTime: 20.02, startTime: 20.02, pixFmt: 'yuv422p10le', width: 3840, height: 2160, editRate: 23.976023976023978, streamIndex: 0, codec: 'jpeg2000', bitDepth: '10', type: 'image', }; // const uhdProresSegment = { // id: '5030644094c1be9dd0ea215680bae13c', // cacheLocation: 's3://oz_zl_api_test-dev/test/mv-cache/', // orgId: 'test', // url: 's3://oz_zl_api_test-dev/test/arrival_UHD.mov', // entryPoint: 600, // editUnits: 5 * 24, // duration: 5 * 1.001, // totalStartTime: 25.025, // startTime: 25.025, // pixFmt: 'yuv422p10le', // width: 3840, // height: 2160, // editRate: 23.976023976023978, // streamIndex: 0, // codec: 'prores', // bitDepth: '10', // type: 'image', // }; void (async () => { // const queue = await Queue.fromNameAndNamespace(rrtq.redisClient, 'mediaview', 'mediaviewVideo'); const queue = await rrtq.createQueue('mediaview', { namespace: config.rrtq.videoNamespace, uniqueTasks: true, taskTimeout: 160000, checkTaskVisibility: true, taskGCTimeout: 10000, // 10s expire: 100000, }); log.info(JSON.stringify(queue)); const task = await queue.addTask( uhdJ2kSegment, // uhdJ2kSegment, // udhSegment.id, uuid(), 600 * 1000, ); const t0 = Date.now(); await task.waitForResponse(600 * 1000, 10); log.info(`Segment took ${(Date.now() - t0) / 1000}s`); })();