当前位置: 首页 > news >正文

浙江省工程造价信息网网站排名云优化工具

浙江省工程造价信息网,网站排名云优化工具,百度应用中心,优秀网站建设模板因为需要将结果动画保存为MP4视频文件需要ffmepg软件的的支持。 一#xff1a;安装ffmpeg软件#xff1a; ffmpeg是一套可以用来记录、转换数字音频、视频#xff0c;并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方…因为需要将结果动画保存为MP4视频文件需要ffmepg软件的的支持。 一安装ffmpeg软件 ffmpeg是一套可以用来记录、转换数字音频、视频并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。下载网址为https://ffmpeg.zeranoe.com/builds/。本实验下载的是windows 64位Static的版本下载的压缩包为ffmpeg-20190407-ecdaa4b-win64-static.zip解压然后将bin目录加入系统环境变量的路径中例如解压后bin目录为C:\ProgramFiles\ffmpeg-20190407-ecdaa4b-win64-static\bin。 最后测试ffmpeg是否配置成功打开Windows的cmd窗口输入ffmpeg -version。如果能看到如下ffmpeg关于软件版本的信息表示成功了。 ffmpeg version N-93542-gecdaa4b4fa Copyright (c) 2000-2019 the FFmpeg developersbuilt with gcc 8.2.1 (GCC) 20190212 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libblu ray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable -libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --ena ble-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-l ibvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable -libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enab le-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enab le-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --ena ble-dxva2 --enable-avisynth --enable-libopenmpt libavutil      56. 26.100 / 56. 26.100 libavcodec     58. 48.101 / 58. 48.101 libavformat    58. 27.100 / 58. 27.100 libavdevice    58.  7.100 / 58.  7.100 libavfilter     7. 48.100 /  7. 48.100 libswscale      5.  4.100 /  5.  4.100 libswresample   3.  4.100 /  3.  4.100 libpostproc    55.  4.100 / 55.  4.100二、运行保存Python示例程序 示例程序一正弦波动画 A simple example of an animated plotimport numpy as np from matplotlib import pyplot as plt from matplotlib import animation# First set up the figure, the axis, and the plot element we want to animate fig plt.figure() # create our line object which will be modified in the animation ax plt.axes(xlim(0, 2), ylim(-2, 2)) # we simply plot an empty line: well add data to the line later line, ax.plot([], [], lw2)# initialization function: plot the background of each frame def init():line.set_data([], [])return line,# animation function. This is called sequentially # It takes a single parameter, the frame number i def animate(i):x np.linspace(0, 2, 1000)y np.sin(2 * np.pi * (x - 0.01 * i)) # update the dataline.set_data(x, y)return line,# Makes an animation by repeatedly calling a function func # frames can be a generator, an iterable, or a number of frames. # interval draws a new frame every interval milliseconds. # blitTrue means only re-draw the parts that have changed. # 在这里设置一个200帧的动画每帧之间间隔20毫秒 anim animation.FuncAnimation(fig, animate, init_funcinit,frames200, interval20, blitTrue) # save the animation as an mp4. This requires ffmpeg or mencoder to be # installed. The extra_args ensure that the x264 codec is used, so that # the video can be embedded in html5. You may need to adjust this for # your system: for more information, see # http://matplotlib.sourceforge.net/api/animation_api.html #保存的动画视频文件名为当前文件夹下的basic_animation.mp4帧率为30帧每秒格式为MP4。 anim.save(basic_animation.mp4, fps30, extra_args[-vcodec, libx264])plt.show() # plt.show() 会一直循环播放动画 示例程序2贝叶斯曲线动画 import mathimport numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimationdef beta_pdf(x, a, b):return (x ** (a - 1) * (1 - x) ** (b - 1) * math.gamma(a b)/ (math.gamma(a) * math.gamma(b)))class UpdateDist(object):def __init__(self, ax, prob0.5):self.success 0self.prob probself.line, ax.plot([], [], k-)self.x np.linspace(0, 1, 200)self.ax ax# Set up plot parametersself.ax.set_xlim(0, 1)self.ax.set_ylim(0, 15)self.ax.grid(True)# This vertical line represents the theoretical value, to# which the plotted distribution should converge.self.ax.axvline(prob, linestyle--, colorblack)def init(self):self.success 0self.line.set_data([], [])return self.line,def __call__(self, i):# This way the plot can continuously run and we just keep# watching new realizations of the processif i 0:return self.init()# Choose success based on exceed a threshold with a uniform pickif np.random.rand(1, ) self.prob:self.success 1y beta_pdf(self.x, self.success 1, (i - self.success) 1)self.line.set_data(self.x, y)return self.line,# Fixing random state for reproducibility np.random.seed(19680801)fig, ax plt.subplots() ud UpdateDist(ax, prob0.7) anim FuncAnimation(fig, ud, framesnp.arange(100), init_funcud.init,interval5, blitTrue) #保存动画视频文件名为当前文件夹下的bayes_animation.mp4帧率为30帧每秒格式为MP4。 anim.save(bayes_animation.mp4, fps30, extra_args[-vcodec, libx264]) plt.show()三运行程序并查看结果。 请注意以上程序直接在Python的IDE环境中运行例如PyCharm和Jupyter Notebook运行可能报错或者只显示一张静态的空白图。 正确的方式是在Windows的cmd命令窗口下执行命令python 代码文件名.py。才能看到动态的结果并且得到相应的MP4文件。
http://www.pierceye.com/news/519230/

相关文章:

  • 我的世界做皮肤网站企业网站风格
  • 京东网站建设的基本情况做哪类网站赚钱
  • 淘宝上网站建设续费个人网站做什么类型的
  • 牙克石网站建设wordpress 跳过ftp
  • 中国建设银行官网站e路通下载店铺设计图纸及效果图大全
  • 福州网站推广公司烟台网络公司有哪些
  • 福建省建设注册管理中心网站那些做面点的网站好
  • 天津网站建设方案托管wordpress 批量删除
  • 网站后台管理系统域名在线设计房屋装修
  • 郑州网站建设工作室wordpress 编辑器字号
  • 内容聚合网站开发教程WordPress文章首页缩进
  • saas云建站平台源码新冠2024中国又要封城了
  • 济南网站建设认可搜点网络滨州网站建设
  • 政务公开及网站建设意见网站的策划方案怎么写
  • 网站培训制度郑州建网站哪个公司好
  • 网站建设优化怎么做微信公众平台开发网站
  • 网站建设的什么是网站建设的第一阶段公司简介概况怎么写
  • 玛伊网站做兼职加入要多少钱装修房子的app软件哪个好
  • 免费空间asp网站公众号编辑器排行榜
  • 鲜花培训网站建设网站建设技术部奖惩制度
  • 国内优秀设计网站站长营销型网站建设 案例
  • 织梦网站维护唐山网站建设哪家专业
  • 网上打字兼职正规网站深圳各区房价一览表
  • 怎样建设网站是什么怎么看网站空间多大
  • 如何备份网站的手机版免费申请微网站
  • 淘宝不允许 网站建设wordpress页面无法编辑器
  • 个人怎么做课程网站seo神马网站推广器
  • 做购物比价的网站有哪些外贸移动商城网站建设
  • 网站开发的特点做直通车任务的网站
  • 分类信息系统网站模板wordpress黑客