しばらくビデオプロジェクトに取り組んでいましたが、ついに壁にぶつかりましたVLC . VLC は、一番ビデオプレーヤー。 ビデオ生成ツールとしても使用できますが、出力ファイルの FPS に関連するいくつかの癖があります。 再調査することにしましたFFmpeg代わりに。 私はずっと前にFFmpegを使用していましたが、すべてのドキュメントを実際に読んでおらず、複雑であることを思い出しました。 そうですね。 今日はドキュメントを読んで過ごしました。 これは、大量のドキュメントを備えたコマンド ライン ツールです (リンクを参照)。 . これを概念実証としてまとめました。 できることは他にもたくさんあります。
以下の JSL は、ビデオ シーケンスの画像を生成するユーザー定義関数と、FFmpeg を実行してビデオを作成する RunProgram 呼び出しで構成されます。 FFmpeg は stdin を介して画像を取得するように指示され、RunProgram はユーザー定義関数を呼び出して画像を提供します。 私は Windows でしか実行していませんが、Mac でも実行できるようにするには、いくつかの小さな変更が必要になると思います。
実行するには、FFmpeg をダウンロードする必要があります。 彼らのウェブサイトは、あなたがそれを入手できる別のサイトを指しています。 公式の Windows バージョンがない理由がわかりません。 インストールが完了すると、このスクリプトが約 30 秒で実行されて 8 秒のビデオが作成され、デフォルトのプレーヤーでビデオが開きます。 VLC で見栄えが良くなるか、YouTube にアップロードして次のように表示できます。
読む法律関係商業的な仕事をする場合は慎重に。
// generate images for ffmpeg stdin on the fly to make a video
// using https://ffmpeg.org/download.html#build-windows
//
// You could make a somewhat simpler version, maybe, by writing
// the files to disk and telling ffmpeg to re-read them. I wanted
// to use the stdin pipe, and didn't try a file. I hope this pipe is
// at least as fast as writing and reading the files.
//
// you can't make a 2nd, parallel stream of audio data using RunProgram,
// so you'll need a disk file for audio. Or http as shown...
outputmp4 = ConvertFilePath("$desktop/VideoMadeByJMPandFFMPEG.mp4", "windows");
nrows = 1080 / 2;// keep the image buffer even in both dimensions
ncols = 1920 / 2;// and maybe a multiple of 16 as well
Open Log( 1 ); // where the action is (may need this window open for the text box to work)
imagex = J( nrows, ncols, RGB Color( 1, 1, 1 ) ); // buffer of JSL color values, updated by getNextImage...
// credit the CC music...write this once, into the buffer
musicCredit = Text Box(
"\!"Pump Sting\!" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/by/4.0/
"||char(asdate(today())),
<<SETWRAP></SETWRAP>