lottieJson = frames.reduce(
function(lottie, frame, index) {
const id = "fr_" + index;
const w = outputWidth;
const w2 = Math.floor(w / 2);
const h = outputHeight;
const h2 = Math.floor(h / 2);
lottie.assets.push({
id,
w,
h,
u: "",
p: frame.data,
e: 1
});
lottie.layers.push({
ddd: 0,
ind: index + 1,
ty: 2,
nm: id + ".jpg",
cl: "jpg",
refId: id,
sr: 1,
ks: {
o: { a: 0, k: 100, ix: 11 },
r: { a: 0, k: 0, ix: 10 },
p: { a: 0, k: [w2, h2, 0], ix: 2 },
a: { a: 0, k: [w2, h2, 0], ix: 1 },
s: { a: 0, k: [100, 100, 100], ix: 6 }
},
ao: 0,
ip: index,
op: index + 1,
st: index,
bm: 0
});
return lottie;
},
{
v: "5.5.2",
fr: outputFrameRate,
ip: 0,
op: options.numFrames,
w: outputWidth,
h: outputHeight,
nm: "@forresto/movie-to-lottie",
ddd: 0,
assets: [],
layers: [],
markers: []
}
)