为了使用 ffmpeg 拼接 mp4 文件,我需要什么编解码器?

为了使用 ffmpeg 拼接 mp4 文件,我需要什么编解码器?

我非常确定我已经安装了所有必要的软件包...这是我尝试剪掉视频的前 14 分钟。

meder@meder-desktop:/media/12dbbb01-4f96-433d-96a0-9b6c88598a51$ sudo ffmpeg -i HDV_0178.MP4 -ss 00:00:00 -t 00:14:32 out.mp4 -acodec copy
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3

Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 59.94 (60000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HDV_0178.MP4':
  Duration: 00:17:51.85, start: 0.000000, bitrate: 12134 kb/s
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, 59.94 tbr, 90k tbn, 180k tbc
    Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16
File 'out.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'out.mp4':
    Stream #0.0(eng): Video: mpeg4, yuv420p, 1280x720, q=2-31, 200 kb/s, 90k tbn, 59.94 tbc
    Stream #0.1(eng): Audio: 0x0000, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Unsupported codec for output stream #0.1

我是否需要重新编译 ffmpeg 或者有没有办法获取必要的音频编解码器?

答案1

放在.-acodec copy之前out.mp4,引用 manpage ffmpeg

 As a general rule, options are applied to the next specified file. For
 example, if you give the -b 64 option, it sets the video bitrate of the
 next file. Format option may be needed for raw input files.

相关内容