fix: FFmpeg mjpeg 缩略图/封面生成添加 format=yuvj420p
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 31s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 39s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m9s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m31s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m40s
AI Code Review / AI Code Review (pull_request) Successful in 1m57s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m3s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 2m3s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m23s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 3m6s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 3m51s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m42s
CI/CD Pipeline / CI Gate (pull_request) Successful in 6s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 43s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 1m2s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 891h45m30s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 891h45m30s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 891h45m31s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 891h45m30s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 891h48m50s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 891h45m31s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 891h48m51s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 891h49m20s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 891h49m21s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 891h49m22s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 891h49m24s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 891h49m24s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 892h18m58s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 892h22m17s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 892h22m47s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 892h22m51s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 31s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 39s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m9s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m31s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m40s
AI Code Review / AI Code Review (pull_request) Successful in 1m57s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m3s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 2m3s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m23s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 3m6s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 3m51s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m42s
CI/CD Pipeline / CI Gate (pull_request) Successful in 6s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 43s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 1m2s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 891h45m30s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 891h45m30s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 891h45m31s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 891h45m30s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 891h48m50s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 891h45m31s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 891h48m51s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 891h49m20s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 891h49m21s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 891h49m22s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 891h49m24s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 891h49m24s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 892h18m58s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 892h22m17s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 892h22m47s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 892h22m51s
修复 FFmpeg 新版中 mjpeg 编码器拒绝非全范围 YUV 输入的问题: - thumbnail_generator.py: scale filter 添加 format=yuvj420p - processor.py: 添加 pix_fmt=yuvj420p - cover_generator.py: 两处 vf filter 添加 format=yuvj420p - cover_service.py: vf filter + simple fallback 添加 pix_fmt - asset_analyzer.py: 添加 -pix_fmt yuvj420p 修复错误: Non full-range YUV is non-standard, set strict_std_compliance to at most unofficial to use it.
This commit is contained in:
@@ -215,7 +215,7 @@ class CoverService:
|
||||
import subprocess
|
||||
|
||||
# scale + crop 实现 cover 裁剪
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height}"
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height},format=yuvj420p"
|
||||
|
||||
command = [
|
||||
"ffmpeg",
|
||||
@@ -258,6 +258,8 @@ class CoverService:
|
||||
"1",
|
||||
"-q:v",
|
||||
str(quality),
|
||||
"-pix_fmt",
|
||||
"yuvj420p",
|
||||
"-f",
|
||||
"mjpeg",
|
||||
str(output_path),
|
||||
|
||||
@@ -93,7 +93,7 @@ class CoverGenerator:
|
||||
time_sec = 0
|
||||
|
||||
# scale + crop 实现 cover 裁剪(铺满输出尺寸)
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height}"
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height},format=yuvj420p"
|
||||
|
||||
command = [
|
||||
FFMPEG_BIN,
|
||||
@@ -281,7 +281,7 @@ class CoverGenerator:
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# scale + crop 实现 cover 裁剪
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height}"
|
||||
vf = f"scale={width}:{height}:force_original_aspect_ratio=increase," f"crop={width}:{height},format=yuvj420p"
|
||||
|
||||
command = [
|
||||
FFMPEG_BIN,
|
||||
|
||||
@@ -159,7 +159,7 @@ class VideoProcessor:
|
||||
try:
|
||||
(
|
||||
ffmpeg.input(video_path, ss=timestamp)
|
||||
.output(output_path, vframes=1, format="image2", vcodec="mjpeg")
|
||||
.output(output_path, vframes=1, format="image2", vcodec="mjpeg", pix_fmt="yuvj420p")
|
||||
.overwrite_output()
|
||||
.run(capture_stdout=True, capture_stderr=True)
|
||||
)
|
||||
|
||||
@@ -60,7 +60,7 @@ def extract_first_frame(
|
||||
# -ss 放在 -i 前面(input seeking,更快但精度稍低,缩略图够用)
|
||||
# -vframes 1 只取一帧
|
||||
# -q:v 2 jpeg 高质量
|
||||
scale_filter = f"scale={width}:{height}:force_original_aspect_ratio=decrease"
|
||||
scale_filter = f"scale={width}:{height}:force_original_aspect_ratio=decrease,format=yuvj420p"
|
||||
cmd = [
|
||||
FFMPEG_BIN,
|
||||
"-y",
|
||||
|
||||
@@ -157,6 +157,8 @@ class AssetAnalyzer:
|
||||
"1",
|
||||
"-q:v",
|
||||
"2", # 高质量
|
||||
"-pix_fmt",
|
||||
"yuvj420p", # mjpeg 需要全范围 YUV
|
||||
"-f",
|
||||
"image2",
|
||||
output_path,
|
||||
|
||||
Reference in New Issue
Block a user