Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #548 #566

Merged
merged 1 commit into from Apr 4, 2023
Merged

Fix #548 #566

merged 1 commit into from Apr 4, 2023

Conversation

myd7349
Copy link
Contributor

@myd7349 myd7349 commented Apr 2, 2023

当视频名称以 - 开头时,音视频合并会失败。以 #548 为例,最终程序生成的合并视频的命令行参数如下:

ffmpeg -loglevel warning -y  -i "762058039/762058039.P1.380418735.mp4"  -i "762058039/762058039.P1.380418735.m4a"  -i "762058039/762058039.jpg"  -map 0  -map 1  -map 2  -disposition:v:1 attached_pic  -metadata title="-魔法少女传奇ABC
第10集    让我们成为一个..._fix" -metadata description="本视频已取得作者独家合作授权,自制投稿为作者意愿。rn全网仅在bilibili发布,禁止在站内或其他平台搬运!rn视频绝大部分收益会转账给作者,以便支持作者后续创作。rn您的三连支持就是我们创作更新的最大动力!rn漫画地址:https://openbook.kr/content/710/listview/128rn作者主页:https://www.youtube.com/channel/UCYwxmi2bpkvzqvyB2VoUr8g" -metadata artist="哲士狗荔枝" -c copy  -c:s mov_text -movflags faststart -strict unofficial -strict -2 -f mp4 "-魔法少女传奇ABC 第10集    让我们成为一个..._fix.mp4"

ffmpeg 在处理如下参数时:

-f mp4 "-魔法少女传奇ABC 第10集    让我们成为一个..._fix.mp4"

看到文件名开头的 - 时,会把它也错误地解析为一个命令行参数,进而导致视频合并失败。

图片

解决方案:

方案一:

-f mp4 -- "-魔法少女传奇ABC 第10集    让我们成为一个..._fix.mp4"

方案二:

-f mp4 "./-魔法少女传奇ABC 第10集    让我们成为一个..._fix.mp4"

参考:

Use -- to indicate the end of options
@nilaoda
Copy link
Owner

nilaoda commented Apr 4, 2023

感谢贡献代码

@nilaoda nilaoda merged commit 7125539 into nilaoda:master Apr 4, 2023
@myd7349 myd7349 deleted the fix-issue-548 branch April 4, 2023 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants