264 编码,写了个脚本,实现批量编码
来源:互联网 发布:2016淘宝卖家开店流程 编辑:程序博客网 时间:2024/05/21 17:46
# -*- coding: cp936 -*-import os import sysimport repattern = re.compile(r'[0-9]{2,4}')# find the successive 2~4 num.DataSet_264='C:/Users/Dell/Desktop/264DataSet/' #destination folder for saving output .264 files.YUV_VIDEO_FOLDER='C:/Users/Dell/Desktop/YUVDataSet/' #source folder containing YUV videosfor YUV_video in os.listdir(YUV_VIDEO_FOLDER): #yuv video的名字里面包含了高度,宽度,视频长度等信息。所以只需要在名字中提取。 #print YUV_video video_inf=pattern.findall(YUV_video) video_width=int(video_inf[0]) video_height=int(video_inf[1]) video_frame=int(video_inf[2]) inputfile=YUV_VIDEO_FOLDER+YUV_video outputfile=DataSet_264+YUV_video+'.264' fin=open('C:/Users/Dell/Desktop/jm_16.1_xmltrace_v1.5/jm_16.1/bin/encoder_baseline.cfg',"rb") fout= open('C:/Users/Dell/Desktop/jm_16.1_xmltrace_v1.5/jm_16.1/bin/encoder_baseline_new.cfg', "w") for index, line in enumerate(fin): #枚举出所打开文件的行数和改行的内容。 if index==12: line=" InputFile = %s " % inputfile if index==15: line="FramesToBeEncoded = %d " % video_frame if index==17: line=" SourceWidth = %d " % video_width if index==18: line="SourceHeight = %d " % video_height if index==20: line="OutputWidth = %d " % video_width if index==21: line="OutputHeight = %d " % video_height if index==25: line="OutputFile = %s " % outputfile fout.write(line+'\n')# 将修改写入新文件。 fin.close() fout.close() os.system('C:/Users/Dell/Desktop/jm_16.1_xmltrace_v1.5/jm_16.1/bin/lencod.exe -d C:/Users/Dell/Desktop/jm_16.1_xmltrace_v1.5/jm_16.1/bin/encoder_baseline_new.cfg') #利用CMD运行lencod.exe 执行编码。
0 0
- 264 编码,写了个脚本,实现批量编码
- python写的批量将c/c++代码文件转换为utf8编码脚本
- 使用vbs脚本进行批量编码转换
- huffman编码的实现(有空了再写!!!!!!)
- 利用notepad++中安装python脚本实现批量转换文件编码
- 写Shell脚本时的编码问题
- python实现批量转换文件编码(批转换编码示例)
- eclipse、MyEclipse实现批量修改文件编码
- EditPlus实现文件编码批量转换
- 写了一个UUE编码的类.
- 一上午搞java编码问题,写了一个将批量文件编码转为UTF-8的小程序(有BUG-.-!)
- linux下GBK->UTF-8文件编码批量转换脚本
- linux下GBK->UTF-8文件编码批量转换脚本
- 批量转换字符编码perl脚本iconvs-v0.5.pl
- 使用批处理脚本(BAT)调用FFMPEG批量编码视频
- shell脚本 批量转换目录下文件编码
- linux 下 GBK-UTF-8文件编码批量转换脚本
- shell脚本中使用iconv批量改变文件编码
- 隐藏gridview的ID列
- Intellij13 IDEA常用快捷键 (mac 10.5 +),优化,使用出现的问题汇总
- 第9周项目3-输出星号图(b)
- 第九周 输出星号图
- 第九周项目2--分数的累加
- 264 编码,写了个脚本,实现批量编码
- 更新UI--更新ListView条目中的图片
- C#中生成静态文本并保存地址
- 在该窗体上,放置一个按钮、一个标签。单击按钮时,在标签上显示当前系统时间。
- twelfth(输出*号)(2)
- long时间类型(格林尼治)转为标准时间
- oracle ORA-01722无效数字
- 第九周项目二分数的累加
- 常用省市区无刷新联动实例