質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

FFmpeg

FFmpegは、動画と音声を交換できるフリーソフトウェアです。UNIX系OSから派生した、MS-DOSから操作するコマンドラインツールです。libavcodecやlibavformat、libswscale、libavfilterなどを含みます。ライセンスは、コンパイルの際のオプションによりLGPLもしくはGPLに決定されます。対応コーデックや使用できるオプションが多く、幅広く利用されています。

Q&A

0回答

484閲覧

scene.js の実行時にエラーが起こる

zuisho

総合スコア0

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

FFmpeg

FFmpegは、動画と音声を交換できるフリーソフトウェアです。UNIX系OSから派生した、MS-DOSから操作するコマンドラインツールです。libavcodecやlibavformat、libswscale、libavfilterなどを含みます。ライセンスは、コンパイルの際のオプションによりLGPLもしくはGPLに決定されます。対応コーデックや使用できるオプションが多く、幅広く利用されています。

0グッド

0クリップ

投稿2023/05/04 13:08

実現したいこと

scene.js のコマンドを実行し、htmlファイルから動画を生成したい。

前提

以下を参考に、 scenejs をインストールした後実行したところ、timeout などのエラーが発生しました。
https://github.com/daybrush/scenejs-render/tree/master/packages/render

install

npm install @scenejs/render

目的の実行

npx @scenejs/render -i index.html --name scene -h 720 -w 1280 -d 3 -o out.mp4

発生している問題・エラーメッセージ

このコマンドの実行時、

npx @scenejs/render -i index.html --name scene -h 720 -w 1280 -d 3 -o out.mp4

このエラーが発生しました。

Start Render Puppeteer old Headless deprecation warning: In the near feature `headless: true` will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passing `headless: "new"` to `puppeteer.launch()` If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose. (node:37097) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) /path/to/node_modules/@ffmpeg/core/dist/ffmpeg-core.js:12 if(l){ra=oa?require("path").dirname(ra)+"/":__dirname+"/";ta=function(a,b){wa||(wa=require("fs"));xa||(xa=require("path"));a=xa.normalize(a);return wa.readFileSync(a,b?null:"utf8")};va=function(a){a=ta(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};1<process.argv.length&&(ka=process.argv[1].replace(/\\/g,"/"));ja=process.argv.slice(2);process.on("uncaughtException",function(a){if(!(a instanceof ca))throw a;});process.on("unhandledRejection",u);la=function(a){process.exit(a)};f.inspect= ^ RuntimeError: abort(TypeError: Failed to parse URL from /path/to/node_modules/@ffmpeg/core/dist/ffmpeg-core.wasm). Build with -s ASSERTIONS=1 for more info. at process.u (/path/to/node_modules/@ffmpeg/core/dist/ffmpeg-core.js:25:109) at process.emit (node:events:513:28) at emit (node:internal/process/promises:149:20) at processPromiseRejections (node:internal/process/promises:283:27) at process.processTicksAndRejections (node:internal/process/task_queues:96:32) Node.js v18.12.0``` ### 該当のソースコード node_modules/@scenejs/render/dist/render.cjs.js はこのようになっています。 ```javascript async function openPage(browser, { width, height, path, scale, name, media, referer, }) { let page = null; try { page = await browser.newPage(); page.setUserAgent(browser.userAgent() + " Scene.js"); page.setViewport({ width: width / scale, height: height / scale, deviceScaleFactor: scale, }); await page.goto(path, { referer, }); } catch (e) { throw new Error(`Puppeteer Error in opening page.\npath: ${path}, width: ${width}, height: ${height}, scale: ${scale}, referer: ${referer}\n${e.message}`); } const result = await page.evaluate(`(async () => { const timeout = Date.now() + 10000; async function retry() { if (Date.now() > timeout) { return false; } if (typeof ${name} !== "undefined") { return true; } return await new Promise(resolve => { setTimeout(async () => { resolve(retry()); }, 500); }) } return await retry(); })()`); if (!result) { throw new Error("Timeout: 10000ms"); } try { await page.evaluate(`${name}.finish()`); } catch (e) { // } try { await page.evaluate(`${media}.finish()`); } catch (e) { // } return page; }

試したこと

オプションを減らし、以下のように実行しても同じ結果でした。

npx @scenejs/render -i index.html

ローカルにあるffmpegのパスを入力することも可能だったので、以下のようにしたところ、

npx @scenejs/render -i index.html -F /usr/local/bin/ffmpeg

このようなエラーになりました。

/path/to/node_modules/@scenejs/render/dist/render.cjs.js:78 throw new Error("Timeout: 10000ms"); ^ Error: Timeout: 10000ms at openPage (/path/to/node_modules/@scenejs/render/dist/render.cjs.js:78:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async render (/path/to/node_modules/@scenejs/render/dist/render.cjs.js:531:18) Node.js v18.12.0

補足情報(FW/ツールのバージョンなど)

OS: MacBookPro Ventrura 13.2.1, Intel Core i5 2GHz クアッドコア
Node.js: v18.12.0

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問