我正在尝试使用以下命令将avi转换为mp4:
ffmpeg -i avi_videos.avi -c copy new.mp4
我收到了一个错误(见下文),我真的不明白。我需要添加哪些其他参数才能将其编码为mp4?你能为我提供一个样本片段吗?有关原始avi的信息也在下面。提前谢谢了。
不确定这是否相关,但我也尝试在linux中获得类似的输出:
leke@leke:~/Videos$ ffmpeg -i avi_videos.avi -c copy new.mp4
ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'avi_videos.avi':
Metadata:
encoder : Lavf57.50.100
Duration: 02:04:21.06, start: 0.000000, bitrate: 14664 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg), 640x480, 14571 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 11024 Hz, 1 channels, u8, 88 kb/s
[mp4 @ 0xed93c0] Tag [1][0][0][0]/0x00000001 incompatible with output codec id '65541' ([0][0][0][0])
Output #0, mp4, to 'new.mp4':
Metadata:
encoder : Lavf57.50.100
Stream #0:0: Video: mjpeg (l[0][0][0] / 0x006C), yuvj422p, 640x480, q=2-31, 14571 kb/s, 30 fps, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 11024 Hz, mono, 88 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
答案 0 :(得分:2)
您当前的命令正在尝试复制流,但ffmpeg不支持MP4中的PCM音频。使用
ffmpeg -i avi_videos.avi -c:v copy new.mp4