Loading

ffmpeg常用命令

1.查看视频详情

[root@localhost video_1]# ffprobe -show_streams sh.mp4   ##输出太多,我这里就不贴出来了
ffprobe version 2.6.8 Copyright (c) 2007-2016 the FFmpeg developers

 2.转码mp4转ts

[root@localhost ~]# ffmpeg -i video_1/sh.mp4 -r 25 -s 1920*1080 -aspect 16:9 -b:v 2000K -bufsize 2000k -maxrate 2500k -vcodec h264 -strict -2 -acodec aac -ab 48k -ar 48000 -ac 2  video_2/sh.ts

  ..... #转码过程太多内容输出

  [root@localhost ~]# tree
  .
  ├── video_1
  │   └── sh.mp4
  └── video_2
  └── sh.ts

  2 directories, 2 files

-i video_1/sh.mp4  源视频

-r 25 帧数

-s 1920*1080 分辨率

-aspect 16:9  屏幕比例

-b:v 2000K   视频码率 

-maxrate 2500k  最大视频码率,如果加这个参数就是vbr编码

-vcodec h264  视频格式

-strict -2      格式必选项

-acodec aac    音频格式

-ab 48k      音频码率

-ar 48000    音频采样

-ac 2        音频通道

video_2/sh.ts 目标视频

posted @ 2017-11-11 23:16  宋某人  阅读(326)  评论(0编辑  收藏  举报