0

I'm trying to convert .avi files to .mp4 using ffmpeg, as lossless-ly as possible.

I tried this command:

 ffmpeg -i filename.avi -c:v copy -c:a copy -y filename.mp4

and received this output:

 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.101 / 59.  1.101
  libavformat    59.  3.100 / 59.  3.100
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.102 /  8.  0.102
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, avi, from 'Filename.avi':
  Metadata:
    TAPE            : Filename
    TCOD            : 653986667
  Duration: 00:01:54.01, start: 0.000000, bitrate: 30411 kb/s
  Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28779 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
[mp4 @ 000001d0ca8a1480] Could not find tag for codec dvvideo in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

It outputs an .mp4 file with an error message that the file can't be played and the error code 0xc10100be.

Can anyone interpret what is happening? What command would you recommend here?

Thank you very much!

0

You are trying to include a codec (dvvideo) into a container (mp4), which doesn't support it (at least in ffmpeg). See difference between codec and container. You better use a codec supported by mp4, say H.265 using libx265 and try converting. See the docs for additional options you may want to apply. Here is the extensive list of codecs supported by mp4, but all of them may not be supported by ffmpeg. Here are some popular codecs. Also, pcm_s16le is a raw audio format, convert it to aac. Try

ffmpeg -i filename.avi -c:v libx265 -x265-params lossless=1 -c:a libfdk_aac -b:a 128k -y filename.mp4

It has H.265 lossless encoding and uses libfdk_aac, which is of better quality than native one.

2
  • Thank you very much for this helpful information! Jul 31 at 20:35
  • Most welcome @stars.in.the.sky, If this solution works for you, you may mark the answer as accepted. Aug 4 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.