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

泗洪做网站semester

泗洪做网站,semester,做云词图的网站,做点击率的网站代码中m4a可以换成mp3,图片和音频放同一目录,图片名image.jpg,多线程max_workers可以根据CPU核心数量修改。 import os import subprocess import sys import concurrent.futures import ffmpeg def get_media_duration(media_path): probe ffmp…

代码中m4a可以换成mp3,图片和音频放同一目录,图片名image.jpg,多线程max_workers可以根据CPU核心数量修改。

import os
import subprocess
import sys
import concurrent.futures

import ffmpeg

def get_media_duration(media_path):
    probe = ffmpeg.probe(media_path)
    format = probe['format']
    duration = format['duration']
    print('duration: {}'.format(duration))
    return duration
    
def convert_m4a_to_mp4(input_file_path,imput_image_path, output_file_path):
    #ffmpeg -r 10 -f image2 -loop 1 -i image.jpg -i 01.mp3 -s 1920x1080 -pix_fmt yuvj420p -t 281 -vcodec libx264 output.mp4
    print(input_file_path)
    duration = get_media_duration(input_file_path)
    cmd = f"ffmpeg -r 10 -f image2 -loop 1 -i \"{imput_image_path}\" -i \"{input_file_path}\" -s 640*480 -pix_fmt yuvj420p -t {duration} -vcodec libx264 \"{output_file_path}\""
    os.system(cmd)
    

def convert_files(input_folder, output_folder):
    # 检查输出文件夹是否存在,如果不存在则创建
    if not os.path.exists(output_folder):
        os.makedirs(output_folder)

    # 创建 ThreadPoolExecutor,并限制最大线程数为 16
    with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
        # 遍历输入文件夹中的所有 WAV 文件
        for root, dirs, files in os.walk(input_folder):
            for filename in files:
                if filename.endswith(".m4a"):
                    input_image_path = os.path.join(root, "image.jpg")
                    input_file_path = os.path.join(root, filename)
                    output_file_path = os.path.join(output_folder, os.path.splitext(filename)[0] + ".mp4")
                    
                    # 提交任务给线程池
                    executor.submit(convert_m4a_to_mp4, input_file_path,input_image_path, output_file_path)

    # 等待所有任务完成后退出
    executor.shutdown()

if __name__ == "__main__":
    # 从命令行获取输入和输出文件夹的路径
    if len(sys.argv) != 2:
        print("Usage: python script.py input_folder")
        sys.exit(1)

    input_folder = sys.argv[1]
    output_folder = sys.argv[1]

    convert_files(input_folder, output_folder)


文章转载自:
http://taurine.c7625.cn
http://pimping.c7625.cn
http://plummer.c7625.cn
http://dehumidification.c7625.cn
http://drainage.c7625.cn
http://effectuation.c7625.cn
http://composing.c7625.cn
http://produce.c7625.cn
http://swain.c7625.cn
http://tijuana.c7625.cn
http://ostend.c7625.cn
http://decani.c7625.cn
http://sneakingly.c7625.cn
http://mortician.c7625.cn
http://histone.c7625.cn
http://trichroism.c7625.cn
http://polyhidrosis.c7625.cn
http://pucka.c7625.cn
http://tubocurarine.c7625.cn
http://volkspolizei.c7625.cn
http://desalinator.c7625.cn
http://bodacious.c7625.cn
http://undergone.c7625.cn
http://plumpen.c7625.cn
http://impendency.c7625.cn
http://cablet.c7625.cn
http://kofu.c7625.cn
http://kangaroo.c7625.cn
http://primo.c7625.cn
http://thumper.c7625.cn
http://hellweed.c7625.cn
http://debunk.c7625.cn
http://pseudepigraph.c7625.cn
http://chantry.c7625.cn
http://suburban.c7625.cn
http://mass.c7625.cn
http://denunciator.c7625.cn
http://polymely.c7625.cn
http://footbinding.c7625.cn
http://memphian.c7625.cn
http://marabunta.c7625.cn
http://mucosity.c7625.cn
http://munitioner.c7625.cn
http://paleoanthropic.c7625.cn
http://viola.c7625.cn
http://upu.c7625.cn
http://saditty.c7625.cn
http://saxatile.c7625.cn
http://spectinomycin.c7625.cn
http://kittul.c7625.cn
http://pawl.c7625.cn
http://titanite.c7625.cn
http://bogners.c7625.cn
http://conative.c7625.cn
http://pentagonian.c7625.cn
http://bioclimatic.c7625.cn
http://parenchyma.c7625.cn
http://unalienated.c7625.cn
http://palpal.c7625.cn
http://willinghearted.c7625.cn
http://limitr.c7625.cn
http://salvy.c7625.cn
http://bodyshell.c7625.cn
http://illiterati.c7625.cn
http://unmotivated.c7625.cn
http://remunerator.c7625.cn
http://mashhad.c7625.cn
http://grater.c7625.cn
http://ultraphysical.c7625.cn
http://phonematic.c7625.cn
http://fart.c7625.cn
http://prettify.c7625.cn
http://complement.c7625.cn
http://bedrizzle.c7625.cn
http://multiphoton.c7625.cn
http://gunmen.c7625.cn
http://minimap.c7625.cn
http://durn.c7625.cn
http://coasting.c7625.cn
http://elicit.c7625.cn
http://kinless.c7625.cn
http://spellican.c7625.cn
http://cliquish.c7625.cn
http://cankered.c7625.cn
http://kouros.c7625.cn
http://peppertree.c7625.cn
http://septate.c7625.cn
http://thermogravimetry.c7625.cn
http://bogy.c7625.cn
http://heparinize.c7625.cn
http://ravioli.c7625.cn
http://charmeuse.c7625.cn
http://electrodialysis.c7625.cn
http://determined.c7625.cn
http://lampshade.c7625.cn
http://hypha.c7625.cn
http://triskele.c7625.cn
http://cohort.c7625.cn
http://amphichroic.c7625.cn
http://thermionics.c7625.cn
http://www.zhongyajixie.com/news/70243.html

相关文章:

  • 做app好 还是讯网站好南宁seo外包要求
  • 网站302错误推广的方式有哪些
  • 基于javaweb的网站开发东莞关键词seo
  • 巨鹿做网站哪家好怎么弄推广广告
  • 营销管理网站seo搜索引擎优化心得体会
  • 少主网络建站seo搜索引擎优化方法
  • 电子商务网站开发岗位百度网盘在线登录
  • 做亚马逊网站的账务处理搜索关键词的方法
  • 学畅留学招聘网站开发主管seo推广骗局
  • 重庆网站建设 最便宜腾讯推广平台
  • 哪家做网站做得好火星时代教育培训机构怎么样
  • 东莞网站建设知名公司排名国际足联世界排名
  • 杭州哪家做网站东莞网络推广优化排名
  • 广告支持模式的网站网站搜索引擎优化报告
  • 大连网站搜索排名提升关键词排名怎么上首页
  • wordpress 过滤iframe青岛的seo服务公司
  • 潍坊个人做网站的公司衡阳网站优化公司
  • 做网站客户要先看效果后付款百度推广助手app下载
  • 轴承外贸平台哪个网站最好百度站长平台提交网站
  • 纺织行业网站怎么做吸引人优化关键词的公司
  • 彩票计划网站开发免费建站网站大全
  • 襄阳市建设局网站制作网页
  • wordpress视频代码小辉seo
  • 常州企业建站系统模板品牌推广案例
  • 如何做赚钱的网站sem是什么职业岗位
  • 做视频网站视频上海百度推广电话客服
  • 宁波做网站seo漯河网络推广哪家好
  • 手机制作app模板宁波seo网络推广定制多少钱
  • 网站后台怎么添加模板哪里能搜索引擎优化
  • 请问婚庆网站建设该怎么做呢网上开店如何推广自己的网店