AVI fails to encode to MP4

1

I'm trying to convert an avi to mp4 with the following command:

ffmpeg -i avi_videos.avi -c copy new.mp4 

I'm getting an error though (see below) and I don't really understand it. What other parameters would I need to add to get it to encode to mp4? Could you provide a sample snippet for me, please? Info about the original avi is also below.

enter image description here

Not sure if this is relevant, but I also tried it in linux and got similar output:

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
video
ffmpeg
asked on Stack Overflow Sep 21, 2016 by user126440 • edited Feb 11, 2020 by TylerH

1 Answer

2

Your current command is trying to copy the streams over, but ffmpeg does not support PCM audio in MP4. Use

ffmpeg -i avi_videos.avi -c:v copy new.mp4
answered on Stack Overflow Sep 21, 2016 by Gyan

User contributions licensed under CC BY-SA 3.0