20.04.12 crash on opening a big MKV file on Windows

Hi there,

I used a camera that gave me that kind of file:

Input #0, matroska,webm, from 'intro_ports_cuts.mkv':
    ENCODER         : Lavf58.44.100
  Duration: 00:04:47.04, start: 0.000000, bitrate: 187043 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s (default)
      DURATION        : 00:04:46.654000000
    Stream #0:1: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 5.59 fps, 5.59 tbr, 1k tbn, 1k tbc (default)
      DURATION        : 00:04:47.041000000

It’s quite big (6711140776), but plays well with ffplay or vlc. I will try to encode it so that it becomes smaller, but is there anything else I could do?



  • I made a yuyv422 transcode of some other video I had, and it opened in Shotcut fine.

  • I doubt file size is an issue. Shotcut has handled much larger files than 7 GB.

  • So that leaves me wondering about the frame rate (is it variable or constant?) and the integrity of the MKV wrapper (did the camera lose power while recording?). Both could be tested by rewrapping the video in a new container like this:

ffmpeg -i "intro_ports_cuts.mkv" -filter:v fps=5.59 -pix_fmt yuyv422 -codec:v rawvideo -an "rewrapped.mkv"

Then try to import the new file into Shotcut.

Note this is a video-only rewrap. If the new file works, I can walk you through a rewrap that includes audio stretched as necessary for the conversion to constant frame rate.

1 Like

Thanks Austin, but the rewrapped file lead ShotCut to crash too.
It looks like the conversion somehow failed, so…

[matroska,webm @ 0000000000416f00] File ended prematurely31 bitrate=185462.4kbits/s speed=1.71x
frame=  896 fps=9.4 q=-0.0 Lsize= 3628843kB time=00:02:40.10 bitrate=185671.4kbits/s speed=1.68x
video:3628800kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001177%

“File ended prematurely” can’t be a good thing…

What if the conversion is stopped before the end? Does the conversion error go away?

ffmpeg -i "intro_ports_cuts.mkv" -frames:v 890 -filter:v fps=5.59 -pix_fmt yuyv422 -codec:v rawvideo -an "rewrapped.mkv"

1 Like

Thanks Austin.
The conversion ends correctly.

frame=  890 fps= 11 q=-0.0 Lsize= 3604542kB time=00:02:39.03 bitrate=185672.4kbits/s speed=2.02x
video:3604500kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001177%

ShotCut crashes the same way with this new file.
I also rewrapped another file that makes Shotcut crash, and the rewrapped file makes ShotCut crash too.
The command was:

ffmpeg -i ouverture\ carton\,\ \ et\ introduction.avi -filter:v fps=5.60 -pix_fmt yuyv422 -codec:v rawvideo -an "rewrapped.avi"

And it looks like:

ffprobe rewrapped.avi
ffprobe version git-2020-06-08-d29aaf1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200523
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 --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. 50.100 / 56. 50.100
libavcodec     58. 90.100 / 58. 90.100
libavformat    58. 44.100 / 58. 44.100
libavdevice    58.  9.103 / 58.  9.103
libavfilter     7. 84.100 /  7. 84.100
libswscale      5.  6.101 /  5.  6.101
libswresample   3.  6.100 /  3.  6.100
libpostproc    55.  6.100 / 55.  6.100
Input #0, avi, from 'rewrapped.avi':
encoder         : Lavf58.44.100
Duration: 00:01:07.86, start: 0.000000, bitrate: 185796 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 186284 kb/s, 5.60 fps, 5.60 tbr, 5.60 tbn, 5.60 tbc

Hmm, I’m not sure then. It works for me, which isn’t a satisfying answer to you of course. What about transcoding the video to a different format altogether? It could be something lossless like Huffyuv or Ut Video if you wanted to retain full quality.

Thanks Austin, that’s what I did at the end.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.