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

做网站用php哪些知识点网络营销发展现状与趋势

做网站用php哪些知识点,网络营销发展现状与趋势,长春平面网站建设,兖州建设公司网站首先,确保你已经安装了ffmpeg。 然后再次保证所有ts文件放在同一个文件夹中,并且依次命名为 1.ts 、 2.ts 、 3.ts 、 4.ts 、 4.ts 。。。 Python完整代码如下:(ffmpeg_batch_merge_ts.py文件) #!/usr/bin/python3 # -*- coding: UTF-8 -*…

首先,确保你已经安装了ffmpeg

然后再次保证所有ts文件放在同一个文件夹中,并且依次命名为 1.ts 、 2.ts 、 3.ts 、 4.ts 、 4.ts 。。。

Python完整代码如下:(ffmpeg_batch_merge_ts.py文件)

#!/usr/bin/python3
# -*- coding: UTF-8 -*-import os# # 设置包含.ts文件的目录。
# ts_directory = '/path/to/ts/files';# # 遍历目录中的所有.ts文件。
# for filename in os.listdir(ts_directory):
#     if filename.endswith('.ts'):
#         # 构建源文件和目标文件的路径。
#         source_path = os.path.join(ts_directory, filename);
#         target_path = os.path.join(ts_directory, os.path.splitext(filename)[0] + '.mp4');
#
#         # 构建ffmpeg命令并运行。
#         ffmpeg_command = f'ffmpeg -i "{source_path}" "{target_path}"';
#         os.system(ffmpeg_command);def is_no_ignore(ignore_id_tuple, the_id):for x in ignore_id_tuple:if x == the_id: return False;return True;# 定义函数。
def file_copy(source_path, target_path):print('file_copy');with open(source_path, "rb") as source_file:with open(target_path, "wb") as target_file:target_file.write(source_file.read());# 设置包含.ts文件的目录。
# ts_directory = '/path/to/ts/files';
ts_directory = '';
while len(ts_directory) == 0:# 在Python中, 你可以使用input()函数来获取键盘输入。ts_directory = input('请输入ts文件所在的目录: ');
os.system(f'cd "{ts_directory}" && pwd');
# 由于ffmpeg一次合并的ts数量不能过大, 否则合并失败, 因此需要限制。
ts_number_per_group = 100;
ts_count = 0;
while ts_count <= 0:try:ts_count = int(input('请输入ts的数量: '));except ValueError:print('[Error] 您输入的数量不是整数!')
# ts_ignore_id_list = [120, 121, 122, 123, 124, 455, 456, 457, 458, 459];
# ts_ignore_id_tuple = (120, 121, 122, 123, 124, 455, 456, 457, 458, 459);
ts_ignore_id_tuple = ();
if ts_count > ts_number_per_group:ts_group_count = (ts_count + ts_number_per_group - 1) // ts_number_per_group;print('分组组数:', ts_group_count);final_ffmpeg_input = '';for group_index in range(ts_group_count):group_id = group_index + 1;print('第', group_id, '组开始');ts_start_id = ts_number_per_group * group_index + 1;ts_end_id = ts_number_per_group * (group_index + 1);if ts_end_id > ts_count: ts_end_id = ts_count;ffmpeg_input = '';for ts_id in range(ts_start_id, ts_end_id):# print(group_id, ts_id);if is_no_ignore(ts_ignore_id_tuple, ts_id):ffmpeg_input += f'{ts_id}.ts|';else:print('Ignore_id', ts_id);else:if is_no_ignore(ts_ignore_id_tuple, ts_id):ffmpeg_input += f'{ts_end_id}.ts';else:ffmpeg_input = ffmpeg_input[0:len(ffmpeg_input) - 1];print(ffmpeg_input);if ffmpeg_input.find('|') != -1:# 一个组内ts合并。os.system(f'cd "{ts_directory}" && ffmpeg -i "concat:{ffmpeg_input}" -c copy temp_{group_id}.mp4');# 把 一个组内ts合并的mp4 转成 temp.ts 。os.system(f'cd "{ts_directory}" && ffmpeg -i temp_{group_id}.mp4 -codec copy -vbsf h264_mp4toannexb temp_{group_id}.ts');else:file_copy(f'{ts_directory}/{ffmpeg_input}', f'{ts_directory}/temp_{group_id}.ts');final_ffmpeg_input += f'temp_{group_id}.ts|';print('第', group_id, '组结束');final_ffmpeg_input = final_ffmpeg_input[0:len(final_ffmpeg_input) - 1];print(final_ffmpeg_input);# 把 合成的组temp.ts 再次合并。os.system(f'cd "{ts_directory}" && ffmpeg -i "concat:{final_ffmpeg_input}" -c copy target.mp4');
else:print('only one group');ffmpeg_input = '';for ts_id in range(1, ts_count):# print(group_id, ts_id);if is_no_ignore(ts_ignore_id_tuple, ts_id):ffmpeg_input += f'{ts_id}.ts|';else:print('Ignore_id', ts_id);ffmpeg_input += f'{ts_count}.ts';print(ffmpeg_input);# 一个组内ts合并。os.system(f'cd "{ts_directory}" && ffmpeg -i "concat:{ffmpeg_input}" -c copy target.mp4');print('track_main_exit');

http://www.yidumall.com/news/109385.html

相关文章:

  • 做网站卖广告挣几百万新一轮疫情最新消息
  • 购物网站个人中心模板网站关键词排名优化
  • 做网站真实收益网站推广软件下载
  • 大兴安岭网站建设百度爱采购服务商查询
  • 外链建设原则网站的seo 如何优化
  • 北京网站建设推广日结app推广联盟
  • 微服务开发平台青岛官网seo公司
  • 广州网站优化方案深圳快速seo排名优化
  • 建设网站兼职搜索排名提升
  • 免费做app和网站的平台有哪些网络广告投放平台
  • 网站建设的实施方式中国最新消息今天
  • 做信息安全的网站杭州网站优化公司哪家好
  • 视觉中国的图片可以拿来做网站搜索引擎排名
  • 佛山网站建设定制开发在线视频用什么网址
  • 简单企业网站模板推广赚钱软件
  • 深圳尼高品牌设计湖南seo排名
  • wordpress站点设置使用时间手机百度app下载安装
  • 营销型网站推广百度网址大全首页
  • 郑州建网站价百度度小店申请入口
  • 战地之王网站做任务产品推销方案
  • 贵阳网站开发哪家便宜2345网址导航删除办法
  • 网站域名备案注册证书查询重庆seo网站哪家好
  • swiper做的全屏网站网推什么平台好用
  • 门户网站建设自查整改淘宝推广运营
  • 网站二级目录解析抖音搜索seo排名优化
  • 网站建设 网站开发宁波seo基础入门
  • 张店网站制作关键字挖掘爱站网
  • 当当网网站建设网络营销活动推广方式
  • 企业电话号码查询网站百度seo搜索引擎优化
  • 有趣的网站官网百度指数搜索热度大学