国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

如何用python反轉(zhuǎn)圖片,視頻

瀏覽:4日期:2022-06-21 11:55:22
利用python反轉(zhuǎn)圖片/視頻 準(zhǔn)備:一張圖片/一段視頻 python庫:Pillow,moviepy 安裝庫

pip install Pillow -i https://mirrors.aliyun.com/pypi/simplepip install moviepy -i https://mirrors.aliyun.com/pypi/simple

默認(rèn)官方鏡像源,我這里嘗試的時候沒有任何進(jìn)度。切換到國內(nèi)的源,比如阿里鏡像,清華鏡像即可。第一次使用國內(nèi)源,簡直是神速!

反轉(zhuǎn)效果

如何用python反轉(zhuǎn)圖片,視頻

反轉(zhuǎn)后

如何用python反轉(zhuǎn)圖片,視頻

實現(xiàn)代碼

圖片

from PIL import Image, ImageOpsimg = Image.open(’img/python.jpg’)img_mirror = ImageOps.mirror(img)img_mirror.save(’img/python_mirror.jpg’)

視頻

import moviepyfrom moviepy.editor import VideoFileClip,vfxvideo = VideoFileClip(’video/video.mp4’)reversed_video = video.fx(vfx.mirror_x)reversed_video.write_videofile(’video/vide_reverse.mp4’)項目地址

https://github.com/coder-chin/reverseImg

以上就是如何用python反轉(zhuǎn)圖片,視頻的詳細(xì)內(nèi)容,更多關(guān)于python反轉(zhuǎn)圖片,視頻的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 古田县| 松原市| 平顺县| 南丹县| 全州县| 万山特区| 沙洋县| 田林县| 西吉县| 都兰县| 兰西县| 新绛县| 临汾市| 石河子市| 甘孜| 新丰县| 乳源| 河间市| 西吉县| 河北区| 新化县| 宜章县| 桃园市| 通山县| 上饶市| 龙山县| 瓦房店市| 巴南区| 织金县| 丹棱县| 正阳县| 永顺县| 济源市| 承德市| 金乡县| 深水埗区| 万源市| 米泉市| 于都县| 浦北县| 道孚县|