当前位置:网站首页>Use ffmpeg to rotate, flip up and down, and flip horizontally
Use ffmpeg to rotate, flip up and down, and flip horizontally
2022-07-05 06:30:00 【Third master takes you to fly】
brief introduction : In the use of ffmpeg do .h264 After coding, you may use vlc When playing, the image is vertically reversed . Probable cause :RGB There are two ways to store images : One is to scan from top to bottom ; The other is scanning from bottom to top .OpenCV Scanning from top to bottom ,ffmpeg It may also be a top-down storage method , and OpenGL/Unity The frame buffer data in may be scanned from bottom to top , This leads to the problem of vertical flipping of the image .
Vertical rotation :
ffmpeg -i Original video .mp4 -vf vflip -y Flip left and right .mp4
Flip left and right horizontally :
ffmpeg -i Original video .mp4 -vf hflip -y Flip left and right .mp4
The picture rotates clockwise 90 degree :
ffmpeg -i Original video .mp4 -vf transpose=1 along 90 degree .mp4
The picture rotates counterclockwise 90°:
ffmpeg -i Original video .mp4 -vf transpose=2 The inverse 90 degree .mp4
The processing method of pictures is consistent with that of videos , Switch the corresponding type to picture .
ffmpeg -i Original picture .png -vf vflip -y Flip up and down .png
ffmpeg -i Original picture .png -vf hflip -y Flip left and right .png
ffmpeg -i Original picture .png -vf transpose=1 along 90 degree .png
ffmpeg -i Original picture .png -vf transpose=2 The inverse 90 degree .png
Final execution result :
WeChat official account : Play with test development
Welcome to your attention , Common progress , thank you !
边栏推荐
猜你喜欢
代码中的英语全部
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
MySQL advanced part 2: MySQL architecture
Speedtree01 generator properties
高斯消元 AcWing 884. 高斯消元解异或線性方程組
Game theory acwing 894 Split Nim game
什么是套接字?Socket基本介绍
Simple selection sort of selection sort
Game theory acwing 893 Set Nim game
求组合数 AcWing 887. 求组合数 III
随机推荐
时间很快,请多做有意义的事情
2. Addition and management of Oracle data files
[wustctf2020] plain_ WP
[leetcode] day95 effective Sudoku & matrix zeroing
数据库Mysql全部
Package webapp or H5 pages into apps
June 29, 2022 daily
RecyclerView的应用
MySQL advanced part 2: SQL optimization
达梦数据库全部
[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian
LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
C - XOR to all (binary topic)
Inclusion exclusion principle acwing 890 Divisible number
Niu Mei's math problems
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
MySQL advanced part 2: the use of indexes
2022/6/29-日报
vsCode创建自己的代码模板
Paper reading report