合并/连接图像和使用 mencoder 或 ffmpeg 将视频文件放在一起
嗨,我有合并视频文件的命令 但我想将图像加入到视频文件中。
我正在做什么:
1)使用 ffmpeg 将图像转换为 mp4
2)使用 mencoder 将此转换后的视频加入到我选择的视频中,
但它提示错误: 无法将纯视频文件与音频视频文件混合尝试 -nosound。
我还添加了 -nosound 但生成的文件不包含任何音频。
该怎么办?
ffmpeg 命令:
-y -i Garden.jpg -s 640x480 converted.mp4
此转换后的 .mp4 文件已正确创建,但没有音频
mencoder 命令:
-oac mp3lame -ovc lavc -noodml -o output.mp4 converted.mp4 selected.mp4
请帮忙..
Hi i have command to merge video files
but i want to join an image to a video file.
What i am doing:
1) convert image to mp4 using ffmpeg
2) joining this converted video to my selected video using mencoder
but it prommpts an error:
cannot mix video only files with audio-video files try -nosound.
i also added -nosound but with this the resultant file does not contains any audio.
what to do?
ffmpeg command:
-y -i Garden.jpg -s 640x480 converted.mp4
this converted .mp4 file is created properly but with no audio
mencoder command:
-oac mp3lame -ovc lavc -noodml -o output.mp4 converted.mp4 selected.mp4
Please help..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的目标是 Windows,则将结果转换为 msmpeg4v2 (avi) 或 mpeg1video (mpg) 或 asf (wmv) 可能效果最好。
请注意,ASF 文件在 Windows 中通常具有 .wmv 或 .wma 扩展名。还应该提到的是,微软声称拥有 ASF 格式的专利,并且可能会起诉或威胁使用非微软软件创建 ASF 文件的用户。强烈建议尽可能避免非洲猪瘟。
阅读本文以获取完整列表 。
If you target is Windows, converting the result to msmpeg4v2 (avi) or mpeg1video (mpg) or asf (wmv) would probably work best.
Note, ASF files often have .wmv or .wma extensions in Windows. It should also be mentioned that Microsoft claims a patent on the ASF format, and may sue or threaten users who create ASF files with non-Microsoft software. It is strongly advised to avoid ASF where possible.
Read this for full list.
这是一个免费的命令行工具,可以加入 MPEG 1 文件:
http://mpgtx.sourceforge.net/#Download
(Windows 可执行文件可用)。不过,我自己并没有尝试过。
编辑:另一种选择可能是利用 VirtualDub。您必须将合并命令写入脚本并在每个命令行传递脚本名称:
http://www.virtualdub.org/blog/pivot/entry.php?id=20
但是,您必须熟悉脚本语言的语法
http://www.virtualdub.org/docs/vdscript.txt
(我自己没有以编程方式尝试过这个,只使用过通过 GUI 界面进行虚拟配音来连接视频文件,效果非常好。)
Here is a free command line tool which can join MPEG 1 files:
http://mpgtx.sourceforge.net/#Download
(Windows exe available). Did not try it on my own, however.
EDIT: another alternative may be to utilize VirtualDub. You have to write your merge command to a script and pass the script name per command line:
http://www.virtualdub.org/blog/pivot/entry.php?id=20
However, you have to get yourself through the syntax of the scripting language
http://www.virtualdub.org/docs/vdscript.txt
(I did not try this by myself programmatically, have only used virtual dub via GUI interface to concat video files, which worked really well.)
FFmpeg 可以使用以下命令轻松完成此操作:
FFmpeg can accomplish this easily with the following command: