私人论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1072|回复: 1

ffmpeg 命令

[复制链接]

156

主题

303

帖子

1664

积分

新手上路

Rank: 1

积分
1664
发表于 2019-11-4 17:20:03 | 显示全部楼层 |阅读模式
ffmpeg -i input_file -vcodec copy -an output_file_video  //分离视频流
ffmpeg -i input_file -acodec copy -vn output_file_audio  //分离音频流

比如:
ffmpeg -i 01.mp4 -vcodec copy -an 01b.avi
ffmpeg -i 01.mp4 -acodec copy -vn 01v.flv

将视频散成图片
ffmpeg -i 视频文件 -r 帧率 -q:v 2 -f image2 保存路径/%d.jpeg

图片聚成视频:
ffmpeg -f image2 -i %d.jpeg -r 30 i02.mp4

视频封装
ffmpeg –i video_file –i audio_file –vcodec copy –acodec copy output_file
比如:
ffmpeg -i 01v.avi -i 20191104_4.mp3 -vcodec copy -acodec copy 004.mp4


在视频编辑软件AP中出现导入的视频声音不同步时,可先转换成mts格式
ffmpeg -i abc.mp4 -acodec copy -vcodec copy test.mts

【合并mp4】
先编写 filelist.txt 内容为:
file 'part1.mp4'
file 'part2.mp4'
file 'part3.mp4'
file 'part4.mp4'
file 'part5.mp4'
file 'part6.mp4'
file 'part7.mp4'
file 'part8.mp4'
file 'part9.mp4'
file 'part10.mp4'
file 'part11.mp4'
file 'part12.mp4'

再执行命令
ffmpeg -f concat -i filelist.txt -c copy output.mp4
回复

使用道具 举报

156

主题

303

帖子

1664

积分

新手上路

Rank: 1

积分
1664
 楼主| 发表于 2020-2-24 18:17:13 | 显示全部楼层
视频画面上下翻转:
ffmpeg -i 0.mp4 -vf vflip a.mp4
左右翻转:
ffmpeg -i 0.mp4 -vf hflip b.mp4
画面顺时针旋转90度:
ffmpeg -i 0.mp4 -vf transpose=1 c.mp4
画面逆时针旋转90°:
ffmpeg -i x01.mp4 -vf transpose=2 x012.mp4
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|私人论坛

GMT+8, 2026-2-20 11:23 , Processed in 0.038086 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表