1

I have problem with ffmpeg properly recognizing a video encoded with Microsoft Fast Mpeg 4v2 codec. Apparently it's a software codec. VLC plays the video fine. The codec reported by VLC is:

Codec: MPEG-4 Video (mp4v)
Video resolution: 8192x8192
Frame rate: 7.549296

Additional info that MediaInfo reports:

Codec ID: mp4v-20
Bit rate mode: Variable
Minimum frame rate: 3.429 FPS
Maximum frame rate: 24.000 FPS

However, when trying to read this stream with ffmpeg, it reports the following errors:

$ ffmpeg -v error -i Somefile_01_31_17_08_21.mp4 -f null -
[mpeg4 @ 000002394e221800] [IMGUTILS @ 000000edaf9ff890] Picture size 0x0 is invalid
[mpeg4 @ 000002394e221800] video_get_buffer: image parameters invalid
[mpeg4 @ 000002394e221800] get_buffer() failed
[mpeg4 @ 000002394e221800] thread_get_buffer() failed
[mpeg4 @ 000002394e221800] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 000002394e1f3300] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 000002394e1f3300] [IMGUTILS @ 000000edafbff450] Picture size 0x0 is invalid
[mpeg4 @ 000002394e1f3300] video_get_buffer: image parameters invalid
[mpeg4 @ 000002394e1f3300] get_buffer() failed
[mpeg4 @ 000002394e1f3300] thread_get_buffer() failed
[mpeg4 @ 000002394e1f3300] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 000002394e214480] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 000002394e214480] [IMGUTILS @ 000000edafdff6a0] Picture size 0x0 is invalid
(...)
[mpeg4 @ 000002394e247780] video_get_buffer: image parameters invalid
[mpeg4 @ 000002394e247780] get_buffer() failed
[mpeg4 @ 000002394e247780] thread_get_buffer() failed
[mpeg4 @ 000002394e247780] get_buffer() failed (-22 0000000000000000)
Too many packets buffered for output stream 0:1.
[mpeg4 @ 000002394e221800] Context scratch buffers could not be allocated due to unknown size.

ffmpeg -codecs doesn't show it as one of the codecs. This question suggests that this is a standard mp4 codec supported by ffmpeg module in VLC. How is it that ffmpeg module in VLC decodes the video properly but ffmpeg itself doesn't? Any idea how to convert this video to h264/h265?

EDIT

Full log without error:

$ ffmpeg -i SomeFile_01_31_17_08_21.mp4 -f null -
ffmpeg version git-2020-08-07-fab00b0 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.1 (GCC) 20200805
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 58.100 / 56. 58.100
  libavcodec     58. 99.100 / 58. 99.100
  libavformat    58. 49.100 / 58. 49.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000220cc12d900] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000220cc12d900] Could not find codec parameters for stream 0 (Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 45242 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SomeFile_01_31_17_08_21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf54.6.100
  Duration: 00:01:11.00, start: 0.000000, bitrate: 45440 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 45242 kb/s, 7.55 fps, 24 tbr, 24 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Side data:
      stereo3d: top and bottom
      spherical: equirectangular (0.000000/0.000000/0.000000)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[mpeg4 @ 00000220cc136240] [IMGUTILS @ 000000e95b9ff2b0] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc136240] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc136240] get_buffer() failed
[mpeg4 @ 00000220cc136240] thread_get_buffer() failed
[mpeg4 @ 00000220cc136240] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc193300] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc193300] [IMGUTILS @ 000000e95bbff530] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc193300] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc193300] get_buffer() failed
[mpeg4 @ 00000220cc193300] thread_get_buffer() failed
[mpeg4 @ 00000220cc193300] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc14e040] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc14e040] [IMGUTILS @ 000000e95bdff8b0] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc14e040] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc14e040] get_buffer() failed
[mpeg4 @ 00000220cc14e040] thread_get_buffer() failed
[mpeg4 @ 00000220cc14e040] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc151400] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc151400] [IMGUTILS @ 000000e95bfff520] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc151400] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc151400] get_buffer() failed
[mpeg4 @ 00000220cc151400] thread_get_buffer() failed
[mpeg4 @ 00000220cc151400] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc154c80] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc154c80] [IMGUTILS @ 000000e95c1ff430] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc154c80] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc154c80] get_buffer() failed
[mpeg4 @ 00000220cc154c80] thread_get_buffer() failed
[mpeg4 @ 00000220cc154c80] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1a9a00] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1a9a00] [IMGUTILS @ 000000e95c3ffa40] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1a9a00] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1a9a00] get_buffer() failed
[mpeg4 @ 00000220cc1a9a00] thread_get_buffer() failed
[mpeg4 @ 00000220cc1a9a00] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1aa7c0] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1aa7c0] [IMGUTILS @ 000000e95c5ff300] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1aa7c0] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1aa7c0] get_buffer() failed
[mpeg4 @ 00000220cc1aa7c0] thread_get_buffer() failed
[mpeg4 @ 00000220cc1aa7c0] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1aac40] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1aac40] [IMGUTILS @ 000000e95c7ff290] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1aac40] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1aac40] get_buffer() failed
[mpeg4 @ 00000220cc1aac40] thread_get_buffer() failed
[mpeg4 @ 00000220cc1aac40] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1aa300] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1aa300] [IMGUTILS @ 000000e95c9ff970] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1aa300] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1aa300] get_buffer() failed
[mpeg4 @ 00000220cc1aa300] thread_get_buffer() failed
[mpeg4 @ 00000220cc1aa300] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1ab0c0] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1ab0c0] [IMGUTILS @ 000000e95cbff530] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1ab0c0] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1ab0c0] get_buffer() failed
[mpeg4 @ 00000220cc1ab0c0] thread_get_buffer() failed
[mpeg4 @ 00000220cc1ab0c0] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1a9e80] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1a9e80] [IMGUTILS @ 000000e95cdff8a0] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1a9e80] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1a9e80] get_buffer() failed
[mpeg4 @ 00000220cc1a9e80] thread_get_buffer() failed
[mpeg4 @ 00000220cc1a9e80] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1e4d40] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1e4d40] [IMGUTILS @ 000000e95cfff550] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1e4d40] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1e4d40] get_buffer() failed
[mpeg4 @ 00000220cc1e4d40] thread_get_buffer() failed
[mpeg4 @ 00000220cc1e4d40] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1e3f80] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1e3f80] [IMGUTILS @ 000000e95d1ff8e0] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1e3f80] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1e3f80] get_buffer() failed
[mpeg4 @ 00000220cc1e3f80] thread_get_buffer() failed
[mpeg4 @ 00000220cc1e3f80] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1e5f80] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1e5f80] [IMGUTILS @ 000000e95d3ff640] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1e5f80] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1e5f80] get_buffer() failed
[mpeg4 @ 00000220cc1e5f80] thread_get_buffer() failed
[mpeg4 @ 00000220cc1e5f80] get_buffer() failed (-22 0000000000000000)
[mpeg4 @ 00000220cc1e9640] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 @ 00000220cc1e9640] [IMGUTILS @ 000000e95d5ff670] Picture size 0x0 is invalid
[mpeg4 @ 00000220cc1e9640] video_get_buffer: image parameters invalid
[mpeg4 @ 00000220cc1e9640] get_buffer() failed
[mpeg4 @ 00000220cc1e9640] thread_get_buffer() failed
[mpeg4 @ 00000220cc1e9640] get_buffer() failed (-22 0000000000000000)
Too many packets buffered for output stream 0:1.
[mpeg4 @ 00000220cc136240] Context scratch buffers could not be allocated due to unknown size.
Conversion failed!

EDIT

More logs

% ffmpeg -probesize 100M -analyzeduration 100M -i SomeFile_01_31_17_08_21.mp4
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with FreeBSD clang version 10.0.0 (git@github.com:llvm/llvm-project.git llvmorg-10.0.0-0-gd32170dbd5b)
  configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --enable-alsa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libaom --disable-libaribb24 --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcelt --enable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --enable-libfdk-aac --enable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libfribidi --disable-gcrypt --enable-libgme --enable-gmp --disable-gnutls --enable-version3 --enable-libgsm --enable-iconv --enable-libilbc --enable-libjack --disable-libklvanc --enable-libkvazaar --disable-ladspa --enable-libmp3lame --enable-liblensfun --enable-libbluray --enable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --enable-lv2 --disable-mbedtls --disable-libmfx --enable-mmx --enable-libmodplug --enable-libmysofa --enable-nonfree --enable-openal --enable-opencl --enable-libopencv --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-openssl --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --enable-librav1e --enable-runtime-cpudetect --enable-librubberband --enable-sdl2 --enable-libsmbclient --enable-libsnappy --disable-sndio --enable-libsoxr --enable-libspeex --disable-libsrt --enable-sse --enable-libssh --enable-libsvtvp9 --disable-libtensorflow --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --enable-libxvid --enable-libzimg --enable-libzmq --disable-libzvbi
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x80d0d2000] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x80d0d2000] Could not find codec parameters for stream 0 (Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 45242 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SomeFile_01_31_17_08_21.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf54.6.100
  Duration: 00:01:11.00, start: 0.000000, bitrate: 45440 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 45242 kb/s, 7.55 fps, 24 tbr, 24 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Side data:
      stereo3d: top and bottom
      spherical: equirectangular (0.000000/0.000000/0.000000) 
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified
5
  • Share full log without -v error – Gyan Feb 7 at 5:14
  • @Gyan added the log – Greg Feb 7 at 21:07
  • And the log of ffmpeg -probesize 100M -analyzeduration 100M -i SomeFile_01_31_17_08_21.mp4? – Gyan Feb 8 at 4:42
  • @Gyan added the log – Greg Feb 9 at 19:51
  • Possibly a regression in decoding. Get an older version (< 3.0) and see if it works. – Gyan Feb 11 at 4:19

Your Answer

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

Browse other questions tagged or ask your own question.