From a17432e3b63d659ed73246f37c5d68e45e40aad9 Mon Sep 17 00:00:00 2001 From: richarjiang Date: Tue, 3 Feb 2026 11:19:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=86=E9=A2=91=E6=8A=BD=E5=B8=A7?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=B7=BB=E5=8A=A0=20WebP=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=94=AF=E6=8C=81=E5=B9=B6=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(dashboard)/tools/video-frames/layout.tsx | 8 +++---- .../(dashboard)/tools/video-frames/page.tsx | 24 ++++++++++++++----- src/app/layout.tsx | 4 ++-- src/app/sitemap.ts | 8 +++---- src/components/seo/StructuredData.tsx | 6 ++--- src/lib/frame-extractor.ts | 9 ++++--- src/locales/en.json | 12 +++++----- src/locales/zh.json | 16 ++++++------- 8 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/app/(dashboard)/tools/video-frames/layout.tsx b/src/app/(dashboard)/tools/video-frames/layout.tsx index 15eb4fb..2d69ced 100644 --- a/src/app/(dashboard)/tools/video-frames/layout.tsx +++ b/src/app/(dashboard)/tools/video-frames/layout.tsx @@ -7,13 +7,13 @@ export async function generateMetadata(): Promise { const lang = acceptLanguage.includes("zh") ? "zh" : "en"; const titles = { - en: "Video to Frames - Extract Frames from Videos", - zh: "视频抽帧 - 从视频中提取帧", + en: "Video to Frame Sequence - Extract Frame Sequences from Videos", + zh: "视频转序列帧 - 从视频中提取序列帧", }; const descriptions = { - en: "Extract frames from videos with customizable frame rates. Perfect for sprite animations and game asset preparation. Supports MP4, MOV, AVI, WebM.", - zh: "从视频中提取帧,可自定义帧率。非常适合精灵动画制作和游戏素材准备。支持 MP4、MOV、AVI、WebM。", + en: "Extract frame sequences from videos with customizable frame rates. Perfect for sprite animations and game asset preparation. Supports MP4, MOV, AVI, WebM.", + zh: "从视频中提取序列帧,可自定义帧率。非常适合精灵动画制作和游戏素材准备。支持 MP4、MOV、AVI、WebM。", }; return { diff --git a/src/app/(dashboard)/tools/video-frames/page.tsx b/src/app/(dashboard)/tools/video-frames/page.tsx index c937d9d..5b74d0d 100644 --- a/src/app/(dashboard)/tools/video-frames/page.tsx +++ b/src/app/(dashboard)/tools/video-frames/page.tsx @@ -61,7 +61,7 @@ export default function VideoToFramesPage() { // 设置相关状态 const [frameRate, setFrameRate] = useState(15); - const [format, setFormat] = useState<'image/png' | 'image/jpeg'>('image/png'); + const [format, setFormat] = useState<'image/png' | 'image/jpeg' | 'image/webp'>('image/png'); const [jpegQuality, setJpegQuality] = useState(0.92); // 提取状态 @@ -360,7 +360,7 @@ export default function VideoToFramesPage() { try { const zip = new JSZip(); - const ext = format === 'image/png' ? 'png' : 'jpg'; + const ext = format === 'image/png' ? 'png' : format === 'image/webp' ? 'webp' : 'jpg'; for (const frame of selectedFrames) { // 将 dataUrl 转为 Blob @@ -441,6 +441,14 @@ export default function VideoToFramesPage() { > JPG + {videoFile && (