其他分享
首页 > 其他分享> > ffmpeg剪辑视频片段

ffmpeg剪辑视频片段

作者:互联网

命令:

ffmpeg -i e:/input.mp4 -ss 00:00:15 -t 00:00:05 -vcodec copy -acodec copy e:/jianji.mp4

执行结果如下:

C:\Users\Administrator>ffmpeg -i e:/input.mp4 -ss 00:00:15 -t 00:00:05 -vcodec copy -acodec copy e:/jianji.mp4
ffmpeg version N-105774-g644b6ed3ff-20220226 Copyright (c) 2000-2022 the FFmpeg
developers
  built with gcc 11.2.0 (crosstool-NG 1.24.0.533_681aaef)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-conf
ig=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw
32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-
pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --en
able-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbi
s --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable
-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-
libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-fre
i0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --ena
ble-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp
 --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-am
rwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libra
v1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --en
able-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-
libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc -
-enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-
libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --e
xtra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp
--extra-version=20220226
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'e:/input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
    description     : Packed by Bilibili XCoder v2.0.2
  Duration: 00:09:51.55, start: 0.000000, bitrate: 905 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progres
sive), 1920x1080 [SAR 1:1 DAR 16:9], 769 kb/s, 30 fps, 30 tbr, 16k tbn (default)

    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo,
fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Output #0, mp4, to 'e:jianji.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : Packed by Bilibili XCoder v2.0.2
    encoder         : Lavf59.17.102
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive)
, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 769 kb/s, 30 fps, 30 tbr, 16k tbn (defau
lt)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp,
 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=
frame=    2 fps=0.0 q=-1.0 Lsize=     209kB time=00:00:05.01 bitrate= 341.7kbits
/s speed= 490x
video:130kB audio:77kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 1.150674%

在这里插入图片描述
e盘已经生成了一个jianji.mp4,用vlc打开确实是从15秒开始截取的5秒的视频

标签:片段,enable,ffmpeg,Stream,--,00,剪辑,mp4,disable
来源: https://blog.csdn.net/chendongpu/article/details/123177750