目錄
- 利用python反轉(zhuǎn)圖片/視頻
- 安裝庫
- 反轉(zhuǎn)效果
- 實(shí)現(xiàn)代碼
- 項(xiàng)目地址
利用python反轉(zhuǎn)圖片/視頻
- 準(zhǔn)備:一張圖片/一段視頻
- python庫:Pillow,moviepy
安裝庫
pip install Pillow -i https://mirrors.aliyun.com/pypi/simple
pip install moviepy -i https://mirrors.aliyun.com/pypi/simple
默認(rèn)官方鏡像源,我這里嘗試的時(shí)候沒有任何進(jìn)度。切換到國內(nèi)的源,比如阿里鏡像,清華鏡像即可。第一次使用國內(nèi)源,簡直是神速!
反轉(zhuǎn)效果
反轉(zhuǎn)后
實(shí)現(xiàn)代碼
圖片
from PIL import Image, ImageOps
img = Image.open('img/python.jpg')
img_mirror = ImageOps.mirror(img)
img_mirror.save('img/python_mirror.jpg')
視頻
import moviepy
from moviepy.editor import VideoFileClip,vfx
video = VideoFileClip('video/video.mp4')
reversed_video = video.fx(vfx.mirror_x)
reversed_video.write_videofile('video/vide_reverse.mp4')
項(xiàng)目地址
https://github.com/coder-chin/reverseImg
以上就是如何用python反轉(zhuǎn)圖片,視頻的詳細(xì)內(nèi)容,更多關(guān)于python反轉(zhuǎn)圖片,視頻的資料請關(guān)注腳本之家其它相關(guān)文章!
您可能感興趣的文章:- Python+uiautomator2實(shí)現(xiàn)自動(dòng)刷抖音視頻功能
- Python爬蟲之爬取嗶哩嗶哩熱門視頻排行榜
- python基于tkinter制作m3u8視頻下載工具
- Python使用UDP實(shí)現(xiàn)720p視頻傳輸?shù)牟僮?/li>
- 寫一個(gè)Python腳本自動(dòng)爬取Bilibili小視頻
- 用python制作詞云視頻詳解
- Python通過m3u8文件下載合并ts視頻的操作
- 用Python制作燈光秀短視頻的思路詳解
- Python從視頻中提取音頻的操作
- python爬取梨視頻生活板塊最熱視頻
- 教你如何使用Python下載B站視頻的詳細(xì)教程