worker.postMessage({
type: "command",
arguments: args,
files: [
{
"name": "input001.png",
"data": imgArray[index++]
},
{
"name": "input002.png",
"data": imgArray[index++]
},
/*** **/
{
"name": "input999.png",
"data": imgArray[index++]
}
]});ffmpeg.jsとworker.jsをjsdo.itのドメインで動かす必要がある。
- ファイルを分割する 任意のドロップされたファイルを指定したバイト数でブツ切りにする
- 既存のJSコードをpngにするヤツでそれぞれを画像化
sampleVideoDataの中身を任意の対象データにすれば良いだけ この形式はUint8Arrayである必要がある。
importScripts('../build/ffmpeg.js');DOMの使えないワーカー内で評価しないといけないからevalするしかないか。。
function print(text) {
console.log(text);
});
}
var message={};
message.files = [
{
"name": "input001.png",
"data": imgArray[index++]
},
{
"name": "input002.png",
"data": imgArray[index++]
},
/*** **/
{
"name": "input999.png",
"data": imgArray[index++]
}
];
var Module = {
print: print,
printErr: print,
files: message.files || [],
arguments: message.arguments || [],
TOTAL_MEMORY: message.TOTAL_MEMORY || false
// Can play around with this option - must be a power of 2
// TOTAL_MEMORY: 268435456
};
var result = ffmpeg_run(Module);