随笔分类 -  python

摘要:00:00:00视频开始的地方 input.mp4是要截取的视频 00:00:07是截取结束的时间 output.mp4是新视频的名字 ffmpeg -copyts -ss 00:00:00 -i input.mp4 -t 00:00:07 -c copy output.mp4 阅读全文
posted @ 2024-01-23 15:08 朝阳1 阅读(64) 评论(0) 推荐(0)
摘要:只能去除固定水印位置。如果水印位置会变,那么后面的就去除不掉。而且如果视频第一帧没有水印出现,那么后面也没办法去掉。。。。。。。。 ffmpeg -i base.mp4 -vf "delogo=x=5:y=5:w=300:h=200" output.mp4 这时候需要直接用ffmpeg或者第三方软件 阅读全文
posted @ 2024-01-23 14:02 朝阳1 阅读(434) 评论(2) 推荐(0)
摘要:abc.txt 我喜欢唱跳rap&篮球 import os import pyttsx3 # 创建一个TTS引擎 engine = pyttsx3.init() voices = engine.getProperty('voices') for v in voices: print("ID:", v 阅读全文
posted @ 2024-01-23 10:53 朝阳1 阅读(59) 评论(0) 推荐(0)
摘要:from moviepy.editor import VideoFileClip video = VideoFileClip('xxxx.mp4') # 剪辑从第1秒到第6秒的视频片段 clipped_video = video.subclip(0, 6) # 保存成gif clipped_vide 阅读全文
posted @ 2024-01-23 10:51 朝阳1 阅读(47) 评论(0) 推荐(0)
摘要:原视频 转换后 import os import cv2 import numpy as np from moviepy.editor import AudioFileClip, VideoFileClip def pixel2char(pixel): char_list = "@#$%&abqwe 阅读全文
posted @ 2024-01-12 14:51 朝阳1 阅读(64) 评论(0) 推荐(0)
摘要:原图 素描图 # 图像转换 import cv2 # 读取图片 img = cv2.imread("./mondtrasl__d4ceb195-183b-4438-a69f-591a8ce62b2c.png") # 灰度 grey = cv2.cvtColor(img, cv2.COLOR_BGR2 阅读全文
posted @ 2024-01-12 14:08 朝阳1 阅读(21) 评论(0) 推荐(0)
摘要:需求 { "sex": { "tome": "male", "jack": "female" }, "age": { "tome": 18, "jack": 20 } } 转换成 { "tome":{ "sex":"male", "age":18 }, "jack":{ "sex":"female" 阅读全文
posted @ 2024-01-12 10:59 朝阳1 阅读(19) 评论(0) 推荐(0)
摘要:from turtle import * def nose(x,y): pu() goto(x,y) pd() seth(-30) begin_fill() a=0.4 for i in range(120): if 0<=i<30 or 60<=i<90: a=a+0.08 lt(3) fd(a) 阅读全文
posted @ 2023-12-27 10:07 朝阳1 阅读(156) 评论(0) 推荐(0)
摘要:之前go写的,转成了python版本,日志是json格式的,按行读取 {"aid":"1111","cid":"2222","callback_url":"http:\/\/ad.toutiao.com\/track\/activate\/?callback=B.eDCQxxxxxGCB&os=0& 阅读全文
posted @ 2023-11-23 12:00 朝阳1 阅读(193) 评论(0) 推荐(0)
摘要:安装 pip install pyinstaller 执行 pyinstaller --onefile xxxxx.py 会在当前文件的同级目录生成dist文件夹,可执行文件就在里面 阅读全文
posted @ 2023-11-23 11:37 朝阳1 阅读(23) 评论(0) 推荐(0)
摘要:import os import subprocess def play_videos_in_folder(folder_path): # 获取所有视频文件 files = [os.path.join(folder_path, f) for f in os.listdir(folder_path) 阅读全文
posted @ 2023-11-16 14:58 朝阳1 阅读(310) 评论(0) 推荐(0)
摘要:临时配置,在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple pip install -i https://pypi.tuna.tsinghua.edu.cn/simple django pip install -r .\requireme 阅读全文
posted @ 2023-10-26 11:39 朝阳1 阅读(261) 评论(0) 推荐(0)