当前位置:网站首页>ffmpeg基本命令
ffmpeg基本命令
2022-08-02 04:17:00 【屁小猪】
//----------------------------------------------------------------
将png生成yuv数据
ffmpeg -i 222.png -pix_fmt yuv420p 222_I420_fromPNG.yuv
ffplay.exe -f rawvideo -pixel_format yuv420p -video_size 200x200 test2.yuv
#1.jpg 转 I420
ffmpeg -i 001.jpg -pix_fmt yuv420p 001_I420_fromJPG.yuv
#2.png 转 I420
ffmpeg -i 222.png -pix_fmt yuv420p 222_I420_fromPNG.yuv
#3.bmp 转 I420
ffmpeg -i xxx.bmp -pix_fmt yuv420p xxx_I420_fromBMP.yuv
#4.jpg 转 NV21
ffmpeg -i 001.jpg -pix_fmt nv21 001_NV21_fromJPG.yuv
#5.jpg 转 NV12
ffmpeg -i 001.jpg -pix_fmt nv12 001_NV12_fromJPG.yuv
#6.jpg 转 YUYV
ffmpeg -i 001.jpg -pix_fmt yuyv422 001_YUYV_fromJPG.yuv
#7.jpg 转 RGB24
ffmpeg -i 001.jpg -pix_fmt rgb24 001_RGB24_fromJPG.RGB
#8.jpg 转 BGR24
ffmpeg -i 001.jpg -pix_fmt bgr24 001_BGR24_fromJPG.RGB
#9.添加水印
ffmpeg命令添加文字水印
ffmpeg -i input.flv -vf “drawtext=fontfile=simhei.ttf: text=‘雷’:x=100:y=10:fontsize=24:fontcolor=yellow:shadowy=2” drawtext.mp4
缩放
ffmpeg -i e:/281639865661818000.mkv -vf “scale=w=720/ihiw:h=720,pad=1280:720:(1280-720/ihiw)/2” -y -strict -2 e:/ttt.mkv
宽度固定400,高度成比例:
ffmpeg -i input.avi -vf scale=400:-2
相反地,高度固定300,宽度成比例:
ffmpeg -i input.avi -vf scale=-2:300
链接:https://www.jianshu.com/p/a31607c195eb
//--------------------------------------------------------
拉流保存MP4文件:
ffmpeg -i rtsp://145.192.1.20:554/live/stream -c copy xt520.mp4
//------------------------------------------------------
推流:
1、使用rtsp方式推流
h264推流
ffmpeg -re -i “/path/to/test.mp4” -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
h265推流
ffmpeg -re -i “/path/to/test.mp4” -vcodec h265 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
2、使用rtmp方式推流
#如果未安装FFmpeg,你也可以用obs推流
ffmpeg -re -i “/path/to/test.mp4” -vcodec h264 -acodec aac -f flv rtmp://127.0.0.1/live/test
RTMP标准不支持H265,但是国内有自行扩展的,如果你想让FFmpeg支持RTMP-H265,请按照此文章编译:https://github.com/ksvc/FFmpeg/wiki/hevcpush
3、使用rtp方式推流
h264推流
ffmpeg -re -i “/path/to/test.mp4” -vcodec h264 -acodec aac -f rtp_mpegts rtp://127.0.0.1:10000
h265推流
ffmpeg -re -i “/path/to/test.mp4” -vcodec h265 -acodec aac -f rtp_mpegts rtp://127.0.0.1:10000
//---------------------------------------------------
边栏推荐
- C程序调试过程常见的错误
- 多主复制的适用场景(1)-多IDC
- Minecraft 1.18.1、1.18.2模组开发 23.3D动画盔甲制作
- Research Notes (6) Indoor Path Planning Method Based on Environment Perception
- falco 【1】入门
- 使用 Fastai 构建食物图像分类器
- 轮询和长轮询的区别
- 复制延迟案例(3)-单调读
- 8月1日“海豹数藏”将全网首发民族英雄林则徐《四行行书》数字藏品!
- Deep Learning Basics Overfitting, Underfitting Problems, and Regularization
猜你喜欢

ADSP21489数据手册表摘要

Visual SLAM Lecture Fourteen - Lecture 13 Practice: Designing a SLAM system (the most detailed code debugging and running steps)

Research Notes (6) Indoor Path Planning Method Based on Environment Perception

PyQt5_pyqtgraph鼠标在折线图上画方形

Jetson Nano 2GB Developer Kit Installation Instructions

Research Notes (8) Deep Learning and Its Application in WiFi Human Perception (Part 1)

Pycharm平台导入scikit-learn

Andrew Ng's Machine Learning Series Course Notes - Chapter 18: Application Example: Image Text Recognition (Application Example: Photo OCR)

26. 如何判断一个对象是否存活?(或者GC对象的判定方法)?

强化学习(西瓜书第16章)思维导图
随机推荐
Platts Analysis-MATLAB Toolbox Function
开放原子开源峰会落幕,百度超级链牵头成立XuperCore开源工作组
micro-ros arduino esp32 ros2 笔记
SCI writing strategy - with common English writing sentence patterns
Computer Basics
lvm扩容(实战无废话)
Deep Blue Academy - Fourteen Lectures of Visual SLAM - Chapter 4 Homework
强化学习(西瓜书第16章)思维导图
最后写入胜利(丢弃并发写入)
ROS visualization of 3D target detection
Deep Blue Academy - Visual SLAM Lecture Fourteen - Chapter 5 Homework
nr部分计算
PyQt5_pyqtgraph鼠标在折线图上画直线
不会多线程还想进 BAT?精选 19 道多线程面试题,有答案边看边学
爬虫_爬取wasde月度供需平衡表(实例)
CODESYS指针型变量编程应用(配方)
Visual SLAM Lecture Fourteen - Lecture 13 Practice: Designing a SLAM system (the most detailed code debugging and running steps)
使用GD32F207的高级定时器来产生PWM波出现的隐藏BUG
WordPress是什么?我也想用 WordPress~
DOM系列之 click 延时解决方案