1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videos": [
12 {
13 "name": "Sintel demo",
14 "scenes": [
15 {
16 "image": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-dragon.jpg?signature=11gwPwjv6DDqDYar9BCsG",
17 "duration": 4,
18 "zoom": "in",
19 "texts": [
20 {
21 "text": "SINTEL",
22 "position": "top",
23 "font": "Anton",
24 "fontSize": 120,
25 "end": 3.5
26 }
27 ]
28 },
29 {
30 "video": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-clip.mp4?signature=DqX7vu3jAYw8EvQE12V1",
31 "start": 0.5,
32 "end": 3.5
33 },
34 {
35 "image": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-market.jpg?signature=VuRpSNn2h6bNPNrsPcvL",
36 "duration": 4,
37 "fit": "blur",
38 "zoom": "out"
39 }
40 ],
41 "voiceover": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/narration.mp3?signature=1NvxzbK6Cnw0M9espC1Ov",
42 "music": {
43 "url": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/sintel-music.mp3?signature=FGXdm8vCVD4u2z7EdnQl",
44 "volume": 0.3
45 },
46 "captions": {
47 "url": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/narration.srt?signature=NWQ0GYOx6bBSKbfcJ0AE",
48 "wordsPerCaption": 3,
49 "highlightColor": "#FFD60A"
50 },
51 "logo": {
52 "url": "https://api.apify.com/v2/key-value-stores/RkSrriT2fTvMveOOb/records/logo.png?signature=1gjlJe5nz2Oq9DcMpjQwT",
53 "widthPercent": 8
54 },
55 "fadeOutSeconds": 1
56 }
57 ]
58};
59
60
61const run = await client.actor("steadyscrape/video-render-api").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71