OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.36k stars 544 forks source link

Crash due to "Out of memory" while exporting video #3590

Closed imker25 closed 3 years ago

imker25 commented 4 years ago

Describe the bug: When I try to export the video I edited with openshot-qt on my Ubuntu 20.04 machine the Linux kernel will kill the openshot-qt process reproducible at about the point of progress since it consumes to much memory.

Steps to reproduce the behavior: For me this is easy, I just need to try to export my video. After about 15 minutes the crash happen. But I'm not sure if or how I should upload all my project data. So I decided to give you as much log information as possible.

See below.

Expected behavior: The video should be exported complete and without an error or openshot crashing.

System Details: Openshot 2.5.1 from ppa.launchpad.net/openshot.developers/ppa:

apt-cache policy openshot-qt
openshot-qt:
  Installed: 2.5.1+dfsg2+1218+202003032149~ubuntu20.04.1
  Candidate: 2.5.1+dfsg2+1218+202003032149~ubuntu20.04.1

Log Files: The logfiles are attached as requested. The systemd log messages from the time around the crash happen is named journald.log and packed into the zip as well. openshot-qt.zip

Exception / Stacktrace: Here the most interesting part of the systemd log:

Jun 30 22:09:53 barney kernel: [  13334]  1000 13334  5523505  3707804 31928320    45311             0 openshot-qt
Jun 30 22:09:53 barney kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service,task=openshot-qt,pid=13334,uid=1>
Jun 30 22:09:53 barney kernel: Out of memory: Killed process 13334 (openshot-qt) total-vm:22094020kB, anon-rss:14819340kB, file-rss:0kB, shmem-rss:11876kB, UID:1000 pgtables:31180kB oom_score_adj:0
Jun 30 22:09:53 barney kernel: oom_reaper: reaped process 13334 (openshot-qt), now anon-rss:16kB, file-rss:0kB, shmem-rss:11988kB
Jun 30 22:09:53 barney systemd[2309]: gnome-launched-org.openshot.OpenShot.desktop-13334.scope: Succeeded.
imker25 commented 4 years ago

Hi,

I was able to reproduce the crash with a less then 3 MB project that contains only public available data. So I attached the OpenShotCrash.zip for you to reproduce the issue.

OpenShotCrash.zip

The main reason this crash happens is because of the *.mp3 file it contains as background music. The song is under creative commons at https://audiohub.de/creativecommons-file/the-fall-of-triumph so I guess it's no problem to share it with you.

And since I found out what caused the issue, I was able to find a workaround for my real project. I simply converted the .mp3 to a .wav with ffmpeg and then used the *.wav in my openshot project. Since then rendering works flawless.

So you might investigate the named .mp3 in order to figure out why you can not handle it. It may has to do with this messages floating my system log whenever I use this .mp3 in openshot:

Jul 01 21:42:37 barney org.openshot.OpenShot.desktop[64766]: [mp3float @ 0x7fe3f4e025c0] Could not update timestamps for discarded samples.
Jul 01 21:42:38 barney org.openshot.OpenShot.desktop[64766]: [mp3float @ 0x7fe3f4e9c040] Could not update timestamps for discarded samples.
Jul 01 21:42:39 barney org.openshot.OpenShot.desktop[64766]: [mp3float @ 0x7fe3f4e02880] Could not update timestamps for discarded samples.
Jul 01 21:42:39 barney org.openshot.OpenShot.desktop[64766]: [mp3float @ 0x7fe3f40546c0] Could not update timestamps for discarded samples.

Best regrads

conrad10781 commented 4 years ago

I too have been able to recreate the issue for a while now using Arch Linux. My videos all come from GoPro's. My system system is:

OS: Arch Linux CPU: AMD Ryzen 9 3900X 12-Core @ 24x 3.8GHz GPU: AMD/ATI Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] RAM: 9481MiB / 32127MiB

Even at 32GB of RAM I'll run into this problem when dealing with many videos that are just a few minutes long. Additionally, one thing I've noted is that the progress bar moves incredibly slow in the event I'm able to even finish the encode.

For the videos I'm working with, it seems to be related to the actual videos. The workaround I've been using is to just re-save the MP4 files using FFMPEG on the CLI prior to opening OpenShot. IE

ffmpeg -i GOPR0276.MP4 -c copy GOPR0276-RESAVE.MP4

Then use the RESAVE files in the project. This process takes just a few seconds, but the trade-off with this approach of course is having twice as much file storage available for a short period of time.

On top of the encoding actually completing as expected, the progress bar moves drastically quicker. Specifically, I'm able to export a ~15 minute video using the YouTube-HD 1080P preset in ~20 minutes after doing the copy, however without the copy the process using the same files takes ~60 minutes.

I unfortunately can't provide the videos I used, but if I get a chance, I will create some sample videos in hopes to duplicate it and provide them here.

el-calavera commented 3 years ago

This happens to me as well. Trivial video projects fill up the memory completely on export. This is on Ubuntu 20.10 On a Phenom II processor.

stale[bot] commented 3 years ago

Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention.

This issue will be closed, as it meets the following criteria:

We'd like to ask you to help us out and determine whether this issue should be reopened.

Thanks again for your help!