功能强大简单的ffmpeg
Tofloor
poster avatar
RucLinux
deepin
2018-01-26 15:25
Author
我平时喜欢使用ffmpeg来进行屏幕录制和视频截取、转码等操作,功能简单又方便,一条命令行就可以实现很多功能。这是我正在截取视频的一条命令。

ffmpeg -ss 00:40:14 -t 00:03:16 -accurate_seek -i new.mp4 -vcodec libx264 -acodec aac -vf scale=1920:1080 a.mp4
-ss 开始时间,即从原始视频的这个时间开始截取
-t   截取时间,即截取时间长度为3分16秒的视频
-accurate_seek 精确跳转
-i 输入文件
new.mp4 原始视频文件
-vcodec 指定视频编码格式
libx264  即mp4
-acodec 指定音频编码格式
aac        即aac格式
-vf 设置视频过滤器
scale=1920:1080 设置视频的宽度和高度,即视频的像素
a.mp4 即截取后的视频


引用:http://www.myzhenai.com.cn/post/2587.html  http://www.myzhenai.com.cn/post/2689.html

[RucLinuxhttps://bbs.deepin.org/user/72751 ~]$ mplayer xiangyu.mp4
MPlayer 1.3.0-4.4.7 (C) 2000-2016 MPlayer Team

正在播放 xiangyu.mp4。
libavformat version 57.25.100 (internal)
检测到文件格式 libavformat。
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb6db4780]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  1920x1080  24bpp  29.970 fps  4231.9 kbps (516.6 kbyte/s)
==========================================================================
正打开视频解码器:[ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.24.102 (internal)
所选视频编解码器为:[ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
媒体剪辑信息:
major_brand: isom
minor_version: 512
compatible_brands: isomiso2avc1mp41
title: 40
encoder: Lavf57.83.100
Load subtitles in ./
==========================================================================
正打开音频解码器:[ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, floatle, 128.8 kbit/4.19% (ratio: 16095->384000)
所选音频编解码器为:[ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
开始播放...
电影宽高比为 1.33:1 - 预先放大到正确的电影宽高比。
VO: [xv] 1920x1080 => 1920x1440 Planar YV12
Unable to update the static FcBlanks: 0x0600
Unable to update the static FcBlanks: 0x0601
Unable to update the static FcBlanks: 0x0602
Unable to update the static FcBlanks: 0x0603
Unable to update the static FcBlanks: 0x06dd
Unable to update the static FcBlanks: 0x070f
Unable to update the static FcBlanks: 0x2028
Unable to update the static FcBlanks: 0x2029
Unable to update the static FcBlanks: 0xfff9
Unable to update the static FcBlanks: 0xfffa
Unable to update the static FcBlanks: 0xfffb
A:   7.3 V:   7.3 A-V:  0.010 ct:  0.015   0/  0 54%  5%  1.7% 9 0

正在退出...(退出)
[RucLinux@localhost ~]$







Reply Favorite View the author
All Replies
avatar
RucLinux
deepin
2018-01-26 15:57
#1
本帖最后由 ruclinux 于 2018-1-26 08:10 编辑

剪辑视频效果:https://www.ixigua.com/i6515139569992598020/
录制视频效果:https://www.ixigua.com/i6511660619425382915
Reply View the author
avatar
RucLinux
deepin
2018-01-27 04:33
#2
https://bbs.deepin.org/post/152400
现在的 录屏就是这后端吧。。。

是的,很多视频和音频类的软件都是根据ffmpeg的GPL开发的。
Reply View the author