我一直在使用 ffmpeg 从图像创建动画 gif 图像。
每次我使用这个命令时;
ffmpeg.exe -r 120 -f concat -i images.txt ffmpeg.gif
它生成的输出文件比每秒 120 帧慢得多。
我是否缺少将 gif 的 fps 设置为 120 而不是 1 的东西?
Output #0, gif, to 'ffmpeg.gif':
Metadata:
encoder : Lavf57.21.101
Stream #0:0: Video: gif, pal8, 468x60, q=2-31, 200 kb/s, 120 fps, 100 tbn, 120 tbc
Metadata:
encoder : Lavc57.22.100 gif
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> gif (native))
Press [q] to stop, [?] for help
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 3, current: 3; changing to 4. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 4, current: 4; changing to 5. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 5, current: 5; changing to 6. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 6, current: 6; changing to 7. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 7, current: 7; changing to 8. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 8, current: 8; changing to 9. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 9, current: 8; changing to 10. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 10, current: 9; changing to 11. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 11, current: 10; changing to 12. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 12, current: 11; changing to 13. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 13, current: 12; changing to 14. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 14, current: 13; changing to 15. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 15, current: 13; changing to 16. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 16, current: 14; changing to 17. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 17, current: 15; changing to 18. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 18, current: 16; changing to 19. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 19, current: 17; changing to 20. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 20, current: 18; changing to 21. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 21, current: 18; changing to 22. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 22, current: 19; changing to 23. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 23, current: 20; changing to 24. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 24, current: 21; changing to 25. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 25, current: 22; changing to 26. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 26, current: 23; changing to 27. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 27, current: 23; changing to 28. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 28, current: 24; changing to 29. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 29, current: 25; changing to 30. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 30, current: 26; changing to 31. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 31, current: 27; changing to 32. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 32, current: 28; changing to 33. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 33, current: 28; changing to 34. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 34, current: 29; changing to 35. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 35, current: 30; changing to 36. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 36, current: 31; changing to 37. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 37, current: 32; changing to 38. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 38, current: 33; changing to 39. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 39, current: 33; changing to 40. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 40, current: 34; changing to 41. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 41, current: 35; changing to 42. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 42, current: 36; changing to 43. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 43, current: 37; changing to 44. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 44, current: 38; changing to 45. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 45, current: 38; changing to 46. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 46, current: 39; changing to 47. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 47, current: 40; changing to 48. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 48, current: 41; changing to 49. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 49, current: 42; changing to 50. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 50, current: 43; changing to 51. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 51, current: 43; changing to 52. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 52, current: 44; changing to 53. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 53, current: 45; changing to 54. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 54, current: 46; changing to 55. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 55, current: 47; changing to 56. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 56, current: 48; changing to 57. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 57, current: 48; changing to 58. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 58, current: 49; changing to 59. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 59, current: 50; changing to 60. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 60, current: 51; changing to 61. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 61, current: 52; changing to 62. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 62, current: 53; changing to 63. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 63, current: 53; changing to 64. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 64, current: 54; changing to 65. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 65, current: 55; changing to 66. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 66, current: 56; changing to 67. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 67, current: 57; changing to 68. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 68, current: 58; changing to 69. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 69, current: 58; changing to 70. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 70, current: 59; changing to 71. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 71, current: 60; changing to 72. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 72, current: 61; changing to 73. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 73, current: 62; changing to 74. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 74, current: 63; changing to 75. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 75, current: 63; changing to 76. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 76, current: 64; changing to 77. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 77, current: 65; changing to 78. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 78, current: 66; changing to 79. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 79, current: 67; changing to 80. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 80, current: 68; changing to 81. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 81, current: 68; changing to 82. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 82, current: 69; changing to 83. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 83, current: 70; changing to 84. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 84, current: 71; changing to 85. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 85, current: 72; changing to 86. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 86, current: 73; changing to 87. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 87, current: 73; changing to 88. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 88, current: 74; changing to 89. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 89, current: 75; changing to 90. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 90, current: 76; changing to 91. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 91, current: 77; changing to 92. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 92, current: 78; changing to 93. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 93, current: 78; changing to 94. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 94, current: 79; changing to 95. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 95, current: 80; changing to 96. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 96, current: 81; changing to 97. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 97, current: 82; changing to 98. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 98, current: 83; changing to 99. This may result in incorrect timestamps in the output file.
[gif @ 000000a80e3694e0] Non-monotonous DTS in output stream 0:0; previous: 99, current: 83; changing to 100. This may result in incorrect timestamps in the output file.
frame= 101 fps=0.0 q=-0.0 Lsize= 245kB time=00:00:01.01 bitrate=1985.2kbits/s speed=4.84x
video:243kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.646120%
Press any key to continue . . .
最佳答案
尝试
ffmpeg.exe -framerate 120 -f concat -i images.txt -r 120 ffmpeg.gif
如果不是,则重命名图像以形成命名序列,即 img00001.png、img00002.png...
然后运行
ffmpeg.exe -framerate 120 -i ima%05d.png ffmpeg.gif
关于Windows FFmpeg 将 imges 转换为具有正确帧率的 gif,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35003017/
我的目标是转换表单输入,例如“100兆字节”或“1GB”,并将其转换为我可以存储在数据库中的文件大小(以千字节为单位)。目前,我有这个:defquota_convert@regex=/([0-9]+)(.*)s/@sizes=%w{kilobytemegabytegigabyte}m=self.quota.match(@regex)if@sizes.include?m[2]eval("self.quota=#{m[1]}.#{m[2]}")endend这有效,但前提是输入是倍数(“gigabytes”,而不是“gigabyte”)并且由于使用了eval看起来疯狂不安全。所以,功能正常,
我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..
我想将html转换为纯文本。不过,我不想只删除标签,我想智能地保留尽可能多的格式。为插入换行符标签,检测段落并格式化它们等。输入非常简单,通常是格式良好的html(不是整个文档,只是一堆内容,通常没有anchor或图像)。我可以将几个正则表达式放在一起,让我达到80%,但我认为可能有一些现有的解决方案更智能。 最佳答案 首先,不要尝试为此使用正则表达式。很有可能你会想出一个脆弱/脆弱的解决方案,它会随着HTML的变化而崩溃,或者很难管理和维护。您可以使用Nokogiri快速解析HTML并提取文本:require'nokogiri'h
我需要读入一个包含数字列表的文件。此代码读取文件并将其放入二维数组中。现在我需要获取数组中所有数字的平均值,但我需要将数组的内容更改为int。有什么想法可以将to_i方法放在哪里吗?ClassTerraindefinitializefile_name@input=IO.readlines(file_name)#readinfile@size=@input[0].to_i@land=[@size]x=1whilex 最佳答案 只需将数组映射为整数:@land边注如果你想得到一条线的平均值,你可以这样做:values=@input[x]
这道题是thisquestion的逆题.给定一个散列,每个键都有一个数组,例如{[:a,:b,:c]=>1,[:a,:b,:d]=>2,[:a,:e]=>3,[:f]=>4,}将其转换为嵌套哈希的最佳方法是什么{:a=>{:b=>{:c=>1,:d=>2},:e=>3,},:f=>4,} 最佳答案 这是一个迭代的解决方案,递归的解决方案留给读者作为练习:defconvert(h={})ret={}h.eachdo|k,v|node=retk[0..-2].each{|x|node[x]||={};node=node[x]}node[
我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击
question的一些答案关于redirect_to让我想到了其他一些问题。基本上,我正在使用Rails2.1编写博客应用程序。我一直在尝试自己完成大部分工作(因为我对Rails有所了解),但在需要时会引用Internet上的教程和引用资料。我设法让一个简单的博客正常运行,然后我尝试添加评论。靠我自己,我设法让它进入了可以从script/console添加评论的阶段,但我无法让表单正常工作。我遵循的其中一个教程建议在帖子Controller中创建一个“评论”操作,以添加评论。我的问题是:这是“标准”方式吗?我的另一个问题的答案之一似乎暗示应该有一个CommentsController参
我正在使用Rails构建一个简单的聊天应用程序。当用户输入url时,我希望将其输出为html链接(即“url”)。我想知道在Ruby中是否有任何库或众所周知的方法可以做到这一点。如果没有,我有一些不错的正则表达式示例代码可以使用... 最佳答案 查看auto_linkRails提供的辅助方法。这会将所有URL和电子邮件地址变成可点击的链接(htmlanchor标记)。这是文档中的代码示例。auto_link("Gotohttp://www.rubyonrails.organdsayhellotodavid@loudthinking.
我喜欢使用Textile或Markdown为我的项目编写自述文件,但是当我生成RDoc时,自述文件被解释为RDoc并且看起来非常糟糕。有没有办法让RDoc通过RedCloth或BlueCloth而不是它自己的格式化程序运行文件?它可以配置为自动检测文件后缀的格式吗?(例如README.textile通过RedCloth运行,但README.mdown通过BlueCloth运行) 最佳答案 使用YARD直接代替RDoc将允许您包含Textile或Markdown文件,只要它们的文件后缀是合理的。我经常使用类似于以下Rake任务的东西:
我一直致力于让我们的Rails2.3.8应用程序在JRuby下正确运行。一切正常,直到我启用config.threadsafe!以实现JRuby提供的并发性。这导致lib/中的模块和类不再自动加载。使用config.threadsafe!启用:$rubyscript/runner-eproduction'pSim::Sim200Provisioner'/Users/amchale/.rvm/gems/jruby-1.5.1@web-services/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:105:in`co