動画サムネイルはjpegに
This commit is contained in:
parent
e7d9221a71
commit
fdb17e08b9
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as tmp from 'tmp';
|
import * as tmp from 'tmp';
|
||||||
import { IImage, convertToWebp } from './image-processor';
|
import { IImage, convertToJpeg } from './image-processor';
|
||||||
import * as FFmpeg from 'fluent-ffmpeg';
|
import * as FFmpeg from 'fluent-ffmpeg';
|
||||||
|
|
||||||
export async function GenerateVideoThumbnail(path: string): Promise<IImage> {
|
export async function GenerateVideoThumbnail(path: string): Promise<IImage> {
|
||||||
|
@ -27,7 +27,8 @@ export async function GenerateVideoThumbnail(path: string): Promise<IImage> {
|
||||||
|
|
||||||
const outPath = `${outDir}/output.png`;
|
const outPath = `${outDir}/output.png`;
|
||||||
|
|
||||||
const thumbnail = await convertToWebp(outPath, 498, 280);
|
// JPEGに変換 (Webpでもいいが、MastodonはWebpをサポートせず表示できなくなる)
|
||||||
|
const thumbnail = await convertToJpeg(outPath, 498, 280);
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
await fs.promises.unlink(outPath);
|
await fs.promises.unlink(outPath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue