動画サムネイルはjpegに

This commit is contained in:
tamaina 2022-02-07 03:22:00 +09:00
parent e7d9221a71
commit fdb17e08b9

View file

@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as tmp from 'tmp';
import { IImage, convertToWebp } from './image-processor';
import { IImage, convertToJpeg } from './image-processor';
import * as FFmpeg from 'fluent-ffmpeg';
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 thumbnail = await convertToWebp(outPath, 498, 280);
// JPEGに変換 (Webpでもいいが、MastodonはWebpをサポートせず表示できなくなる)
const thumbnail = await convertToJpeg(outPath, 498, 280);
// cleanup
await fs.promises.unlink(outPath);