1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videoUrls": [
12 "https://www.tiktok.com/@duolingo/video/7683994892506270989",
13 "https://media.w3.org/2010/05/sintel/trailer.mp4"
14 ],
15 "maxVideosPerSource": 5,
16 "mode": "auto",
17 "frameCount": 12,
18 "intervalSeconds": 5,
19 "sceneThreshold": 0.3,
20 "timestamps": [
21 "0:05",
22 "00:00:12.5",
23 "20"
24 ],
25 "maxFramesPerVideo": 50,
26 "thumbnailCount": 3,
27 "skipBlankFrames": true,
28 "skipDuplicates": true,
29 "imageFormat": "jpg",
30 "maxWidth": 1280,
31 "contactSheet": true
32};
33
34
35const run = await client.actor("apimy/video-frame-extractor").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45