Opened 2 years ago

Closed 2 years ago

#9749 closed defect (needs_more_info)

ffmpeg on mkv freezes system

Reported by: eyrieowl Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by eyrieowl)

Summary of the bug:

I have been running into an issue where when I try to transcode an mkv file above...some duration which I'm not quite certain about, it freezes the whole system after it's encoded to a certain point in time. With the input file that I'm sending information about, this seems to happen after it's encoded about 20 min of the movie. I'm running on Linux (extra info below); however, I've also attempted to get around the issue by running the encode in a VMWare VM running a Windows 10 guest and ffmpeg 5...and I saw the same behavior. I limited the guest to only two cores, and it never had the full memory available, and the same thing happened. It didn't just freeze the guest, it froze the entire machine.... When this happens, the machine is entirely unresponsive. The screen is still on, the time frozen, and no keyboard input or mouse input or remote login is possible. I've left the machine sitting overnight and well into the next day, nothing changes, the only remedy is to hard power off the machine. I've also tried using taskset in the linux host to limit the CPU ffmpeg can use, and that had the same result as well.

My speculation is that something ffmpeg is doing is maybe hitting a bug in the CPU? I don't know. It does seem to be something about the mkv package...I've encoded many mp4 files without an issue. But I've encoded a couple mkv which both had the same outcome. I'll include information for both. I think I can't provide the original files, though, for legal reasons, but also size. The first file is 41GB. I'm happy to do whatever steps you want to gather more information, though.

I also tried using Handbrake, with the goal of having it pick a different set of options. That also failed.

How to reproduce:

% # the command for the first file
% ffmpeg -i THE\ GODFATHER_t00.mkv -map 0 -c:s copy TheGodfather.mkv
%
% # the command for the second file
% ffmpeg -i Turn\ -\ Washington\'s\ Spies\ -\ s02e01\ -\ Thoughts\ of\ a\ Free\ Man.mkv  -vf scale=-1:720 output.mkv

Attachments (5)

linuxdebug.out (30.9 KB ) - added by eyrieowl 2 years ago.
linux ffmpeg debug output
cpus.out (2.6 KB ) - added by eyrieowl 2 years ago.
lscpu output
uname.out (113 bytes ) - added by eyrieowl 2 years ago.
uname output
windebug.out (30.1 KB ) - added by eyrieowl 2 years ago.
windows 10 / ffmpeg 5 debug output
secondFileLinuxDebug.out (11.4 KB ) - added by eyrieowl 2 years ago.
linux debug on the 2nd file had issue with

Download all attachments as: .zip

Change History (9)

by eyrieowl, 2 years ago

Attachment: linuxdebug.out added

linux ffmpeg debug output

by eyrieowl, 2 years ago

Attachment: cpus.out added

lscpu output

by eyrieowl, 2 years ago

Attachment: uname.out added

uname output

by eyrieowl, 2 years ago

Attachment: windebug.out added

windows 10 / ffmpeg 5 debug output

by eyrieowl, 2 years ago

Attachment: secondFileLinuxDebug.out added

linux debug on the 2nd file had issue with

comment:1 by eyrieowl, 2 years ago

Description: modified (diff)

comment:2 by mkver, 2 years ago

  1. Does it become slower and slower until it freezes or does it just freeze at an instant?
  2. If you encode to mp4 first and then remux this mp4 (no reencoding) to Matroska, does the same issue happen or not?
  3. If you use "-live 1" or output to stdout "-f matroska -", does the same issue still happen?
  4. Does Valgrind show anything useful?
  5. The Matroska muxer is very chatty with loglevel debug and higher; why did you not provide the output of this instead of only the ffmpeg -i <input> output (just use -report)?
  6. Have you tried using different (i.e. older) versions of FFmpeg?

in reply to:  2 comment:3 by eyrieowl, 2 years ago

Replying to mkver:

  1. Does it become slower and slower until it freezes or does it just freeze at an instant?

It freezes in an instant. The first time I was just going about using the machine and then suddenly nothing worked. Subsequently, I kept the terminal window open on my 2nd monitor and everything seemed to be going along just fine until the system just abruptly freezes.

  1. If you encode to mp4 first and then remux this mp4 (no reencoding) to Matroska, does the same issue happen or not?

I don't have a good way to get it to mp4 first. I'm trying to shrink down and stick the blu-ray I just got in my plex so I can stream from my TVs, and the software I have rips it to mkv, there wasn't any option to get it to mp4, I'd have to use ffmpeg to get there.

  1. If you use "-live 1" or output to stdout "-f matroska -", does the same issue still happen?

I don't know, I'll try those and get back to you. Have to do it after the work day is over b/c I can't have my machine freezing up while I work.

  1. Does Valgrind show anything useful?

No idea, I've never used Valgrind. I'll look into trying that out as well. Doesn't look like the debug version is distributed with the flatpak version I have installed, so, will have to see how to get that.

  1. The Matroska muxer is very chatty with loglevel debug and higher; why did you not provide the output of this instead of only the ffmpeg -i <input> output (just use -report)?

Mostly because of the way the http://ffmpeg.org/bugreports.html page is written, visually I glossed over that after the bullet-list that I tried to make sure to do each step of. I can work to get that.

  1. Have you tried using different (i.e. older) versions of FFmpeg?

No, I haven't. I have tried, as noted, with both 4.4.1 in the host and 5 in the guest VM.

comment:4 by Carl Eugen Hoyos, 2 years ago

Resolution: needs_more_info
Status: newclosed
Version: 4.4.1unspecified

I am happy to test this if you can point us to the input file.

Note: See TracTickets for help on using tickets.