mpv_animated导出带字幕的gif失败
同一个视频,导出带字幕的gif报错,不带字幕的gif可以成功导出,请问是什么原因?视频是内嵌简体和繁体中文两个字幕。日志报错信息如下:
[ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"text":"[mpv_animated] Creating GIF"}"] [ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"style":"{\\1c&H7a77f2&}{\\3c&H111111&}","text":"[mpv_animated] [Parsed_subtitles_4 @ 000002540262c240] Unable to parse option value \"/磁力链接下载/Witch Watch/[Sakurato] Witch Watch [05][HEVC-10bit 1080p AAC][CHS&CHT].mkv\" as image size\r","terminal_style":"\u001b[31m"}"] [ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"style":"{\\1c&H7a77f2&}{\\3c&H111111&}","text":"[mpv_animated] Error applying option 'original_size' to filter 'subtitles': Invalid argument\r","terminal_style":"\u001b[31m"}"] [ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"style":"{\\1c&H7a77f2&}{\\3c&H111111&}","text":"[mpv_animated] Failed to set value 'fps=15,scale=trunc(ih*dar/2)*2:trunc(ih/2)*2,setsar=1/1,scale=600:-1:flags=lanczos,subtitles=E\\:/磁力链接下载/Witch Watch/\\[Sakurato\\] Witch Watch \\[05\\]\\[HEVC-10bit 1080p AAC\\]\\[CHS&CHT\\].mkv:si=0,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse' for option 'lavfi': Invalid argument\r","terminal_style":"\u001b[31m"}"] [ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"style":"{\\1c&H7a77f2&}{\\3c&H111111&}","text":"[mpv_animated] Error parsing global options: Invalid argument\r","terminal_style":"\u001b[31m"}"] [ 22.865][d][cplayer] Run command: script-message-to, flags=64, args=[target="console", args="log", args="{"text":"[mpv_animated] Failed to creat D:/MPV_TK/mpv_config-2025.04.12/portable_config/files/animated/[Sakurato] Witch Watch [05][HEVC-10bit 1080p AAC][CHS&CHT]_000.gif"}"]
这个脚本对于字幕场景适配的不是很好,主要是转义问题。不好修复所以不怎么推荐尝试截带字幕的动图 顺便 ffmpeg 的某个更新似乎也破坏了字幕截取的功能(