openshot-qt icon indicating copy to clipboard operation
openshot-qt copied to clipboard

OpenShot (Win64) repeatably crashes mid-render (16X Time Remapping)

Open hikeonpast opened this issue 2 years ago • 11 comments

Describe the bug: During the rendering process, the application exits with an unhandled exception while around 15% complete (possibly at a transition between source files). Rendering on a slow machine, so I've never been at my PC when the exception happens.

Steps to reproduce the behavior: Clean install of daily build Load recently created project Start export/render Render appears to be proceeding normally (works normally for at least an hour) Application exits prior to completion of the export/render.

Expected behavior: I would expect the render to finish without errors.

System Details:

  • OpenShot Version: 3.0.0 daily build Win64 (OpenShot-v3.0.0-daily-10912-510a7690-b5bbab66-x86_64)
  • Operating System / Distro: Windows 10 pro version 22H2

Log Files: Verbose logfile is too large to post without using aggressive RAR compression (which isn't a supported filetype). Excerpt from log file pasted below.

Stack trace (excerpt from log file): FFmpegReader::GetFrame (returned cached frame=86451.0000) FrameMapper::ResampleMappedAudio (frame->number=108065.0000, original_frame_number=86451.0000, channels_in_frame=1.0000, samples_in_frame=1600.0000, sample_rate_in_frame=48000.0000) FrameMapper::ResampleMappedAudio (got sample data from frame) (frame->number=108065.0000, total_frame_samples=1600.0000, target channels=2.0000, channels_in_frame=1.0000, target sample_rate=48000.0000, samples_in_frame=1600.0000) FrameMapper::ResampleMappedAudio (adjust # of samples) (total_frame_samples=1600.0000, info.sample_rate=48000.0000, sample_rate_in_frame=48000.0000, info.channels=2.0000, channels_in_frame=1.0000, original_frame_number=86451.0000) FrameMapper::ResampleMappedAudio (preparing for resample) (in_sample_fmt=1.0000, out_sample_fmt=1.0000, in_sample_rate=48000.0000, out_sample_rate=48000.0000, in_channels=1.0000, out_channels=2.0000) FrameMapper::ResampleMappedAudio (Audio successfully resampled) (nb_samples=1600.0000, total_frame_samples=1600.0000, info.sample_rate=48000.0000, channels_in_frame=1.0000, info.channels=2.0000, info.channel_layout=3.0000) FrameMapper::ResampleMappedAudio (Add audio to channel) (number of samples=1600.0000, channel_filter=0.0000) FrameMapper::ResampleMappedAudio (Add audio to channel) (number of samples=1600.0000, channel_filter=1.0000) Clip::GetOrCreateFrame (from reader) (number=108065.0000) ---- Unhandled Exception: Stack Trace ---- _C_specific_handler 7fff54477f60
_chkstk 7fff55b72300
RtlRaiseException 7fff55b21070
KiUserExceptionDispatcher 7fff55b70f20
ZN4juce21FloatVectorOperations3addEPfPKfi 7fff221ddad0
ZN8openshot4Clip21get_time_mapped_frameESt10shared_ptrINS_5FrameEEx 7fff2266b2f0
ZN8openshot4Clip8GetFrameESt10shared_ptrINS_5FrameEExPNS_18TimelineInfoStructE 7fff2267a0b0
ZN8openshot8Timeline16GetOrCreateFrameESt10shared_ptrINS_5FrameEEPNS_4ClipExPNS_18TimelineInfoStructE 7fff226d9020
ZN8openshot8Timeline9add_layerESt10shared_ptrINS_5FrameEEPNS_4ClipExbf 7fff226d9a70
ZN8openshot8Timeline8GetFrameEx 7fff226e0690
PyInit__openshot 7fff23013df0
PyLong_FromUnsignedLong 7fff236cf890
PyEval_EvalFrameDefault 7fff236b0a00
PyEval_EvalCodeWithName 7fff236acbd0
PyFunction_Vectorcall 7fff236c0770
PyEval_EvalFrameDefault 7fff236b0a00
PyEval_EvalCodeWithName 7fff236acbd0
PyFunction_Vectorcall 7fff236c0770
PyMethod_New 7fff236cc0c0
PyVectorcall_Call 7fff236cc590
PyInit_QtCore 7fff194aa730
PyInit_QtCore 7fff194aa730
PyInit_QtCore 7fff194aa730
PyInit_QtCore 7fff194aa730
PyInit_QtCore 7fff194aa730
ZN9QMimeType18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv 7fff1e1e6800
ZNK16QDialogButtonBox14standardButtonEP15QAbstractButton 7fff1dae0ae0
ZN9QMimeType18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv 7fff1e1e6800
ZN15QAbstractButton7toggledEb 7fff1da43660
ZN15QAbstractButton18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv 7fff1da45340
ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent 7fff1da45b30
PyInit_QtWidgets 7fff184deca0
ZN7QWidget5eventEP6QEvent 7fff1d997200
PyInit_QtWidgets 7fff184deca0
ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 7fff1d957f50
ZN12QApplication6notifyEP7QObjectP6QEvent 7fff1d95ee00
PyInit_QtWidgets 7fff184deca0
ZN16QCoreApplication20sendSpontaneousEventEP7QObjectP6QEvent 7fff1e105200
ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb 7fff1d95e140
ZN14QDesktopWidget11qt_metacallEN11QMetaObject4CallEiPPv 7fff1d9acf90
ZN14QDesktopWidget11qt_metacallEN11QMetaObject4CallEiPPv 7fff1d9acf90
ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent 7fff1d957f50
PyInit_QtWidgets 7fff184deca0
ZN16QCoreApplication20sendSpontaneousEventEP7QObjectP6QEvent 7fff1e105200
ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE 7fff2174f9c0
ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 7fff217252e0
ZN21QEventDispatcherWin3213processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE 7fff1e160990
qt_plugin_instance 7fff1902eef0
ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE 7fff1e103350
ZN7QDialog4execEv 7fff1db49e80
PyInit_QtWidgets 7fff184deca0
PyLong_FromUnsignedLong 7fff236cf890
PyObject_MakeTpCall 7fff236bb9e0
PyEval_EvalFrameDefault 7fff236b0a00
PyEval_EvalCodeWithName 7fff236acbd0
PyFunction_Vectorcall 7fff236c0770
PyMethod_New 7fff236cc0c0
PyVectorcall_Call 7fff236cc590
PyInit_QtCore 7fff194aa730
PyInit_QtCore 7fff194aa730
---- End of Stack Trace ----

hikeonpast avatar Jan 11 '23 20:01 hikeonpast

Hello @hikeonpast

  1. How larege/complex is your project? Just trying to get an idea. File types, files sizes, how many minutes of clips on the timeline?
  2. How much RAM is in your computer?
  3. How much available disk space do you have?
  4. Here is the instructions for a clean installation: https://github.com/OpenShot/openshot-qt/wiki/Clean-Installation-of-OpenShot. Is this what you did?
  5. Were you running an older version? If yes, which version and did you successfully export this same project.

Thank you!

Colorjet3 avatar Jan 12 '23 01:01 Colorjet3

Hi @Colorjet3

  1. The project consists of 7 one-hour files, 4k @ 20 FPS. Goal is to assemble into a single file and speed up 16x.
  2. 16GB. Didn't behave like a memory leak FWIW.
  3. The drive that the source/desination files are on has 4.5TB free. The SSD that OpenShot is installed to has 106GB free.
  4. This was a clean install on this machine - have never installed OpenShot previously.
  5. Nope.

Let me know if I can answer any other questions.

Edit: Corrected the units on one of my drives.

hikeonpast avatar Jan 14 '23 19:01 hikeonpast

Other info (if helpful) A daily build from a few days prior also crashed in a similar way on my macbook. This was not a bona-fide clean install however. I installed a daily build over the 3.0.0. release. Stack trace follows:

---- Unhandled Exception: Stack Trace ---- 4 libopenshot-audio.9.dylib 0x0000000103175370 _ZN4juce21FloatVectorOperations3addEPfPKfi + 48 5 libopenshot.23.dylib 0x0000000102fc5e9b _ZN8openshot4Clip21get_time_mapped_frameENSt3__110shared_ptrINS_5FrameEEEx + 1115 6 libopenshot.23.dylib 0x0000000102fc5279 _ZN8openshot4Clip8GetFrameENSt3__110shared_ptrINS_5FrameEEExPNS_18TimelineInfoStructE + 185 7 libopenshot.23.dylib 0x00000001030272a2 _ZN8openshot8Timeline16GetOrCreateFrameENSt3__110shared_ptrINS_5FrameEEEPNS_4ClipExPNS_18TimelineInfoStructE + 546 8 libopenshot.23.dylib 0x0000000103027830 _ZN8openshot8Timeline9add_layerENSt3__110shared_ptrINS_5FrameEEEPNS_4ClipExbf + 128 9 libopenshot.23.dylib 0x000000010302b561 _ZN8openshot8Timeline8GetFrameEx + 6945 10 _openshot.so 0x0000000102db57f9 ZL23_wrap_Timeline_GetFrameP7_objectS0 + 345 11 Python 0x000000010259146d PyCFunction_Call + 321 12 Python 0x00000001026245aa _PyEval_EvalFrameDefault + 26573 13 Python 0x00000001026274ff _PyEval_EvalCodeWithName + 1863 14 Python 0x0000000102591122 _PyFunction_FastCallKeywords + 222 15 Python 0x0000000102626c66 call_function + 737 16 Python 0x00000001026241b8 _PyEval_EvalFrameDefault + 25563 17 Python 0x00000001026274ff _PyEval_EvalCodeWithName + 1863 18 Python 0x0000000102590d90 _PyFunction_FastCallDict + 444 19 Python 0x0000000102591e93 _PyObject_Call_Prepend + 131 20 Python 0x0000000102591267 PyObject_Call + 136 21 QtCore.so 0x000000010c428ac7 ZNK8PyQtSlot4callEP7_objectS1 + 39 22 QtCore.so 0x000000010c4289d6 _ZNK8PyQtSlot6invokeEPPvP7_objectS0_b + 374 23 QtCore.so 0x000000010c4295c5 _ZN13PyQtSlotProxy7unislotEPPv + 85 24 QtCore.so 0x000000010c42953a _ZN13PyQtSlotProxy11qt_metacallEN11QMetaObject4CallEiPPv + 58 25 QtCore 0x00000001072e12be _Z10doActivateILb0EEvP7QObjectiPPv + 1118 26 QtWidgets 0x00000001058230ac _ZN23QDialogButtonBoxPrivate22_q_handleButtonClickedEv + 780 27 QtCore 0x00000001072e1425 _Z10doActivateILb0EEvP7QObjectiPPv + 1477 28 QtWidgets 0x0000000105777a1f _ZN22QAbstractButtonPrivate11emitClickedEv + 111 29 QtWidgets 0x0000000105777899 _ZN22QAbstractButtonPrivate5clickEv + 233 30 QtWidgets 0x0000000105778a4f _ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 271 31 QtWidgets.so 0x000000010fb3db8a _ZN14sipQPushButton17mouseReleaseEventEP11QMouseEvent + 106 32 QtWidgets 0x00000001056c87bd _ZN7QWidget5eventEP6QEvent + 445 33 QtWidgets.so 0x000000010fb3e12a _ZN14sipQPushButton5eventEP6QEvent + 106 34 QtWidgets 0x000000010568dfea _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 266 35 QtWidgets 0x0000000105690ec2 _ZN12QApplication6notifyEP7QObjectP6QEvent + 7330 36 QtWidgets.so 0x000000010f9f8222 _ZN15sipQApplication6notifyEP7QObjectP6QEvent + 114 37 QtCore 0x00000001072add64 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 212 38 QtWidgets 0x000000010568e910 _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb + 896 39 QtWidgets 0x00000001056e799f _ZN13QWidgetWindow16handleMouseEventEP11QMouseEvent + 3247 40 QtWidgets 0x00000001056e60a5 _ZN13QWidgetWindow5eventEP6QEvent + 229 41 QtWidgets 0x000000010568dfea _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 266 42 QtWidgets 0x000000010568f476 _ZN12QApplication6notifyEP7QObjectP6QEvent + 598 43 QtWidgets.so 0x000000010f9f8222 _ZN15sipQApplication6notifyEP7QObjectP6QEvent + 114 44 QtCore 0x00000001072add64 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 212 45 QtGui 0x0000000106393ca5 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 3397 46 QtGui 0x0000000106394031 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 4305 47 QtGui 0x0000000106378e5b _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 219 48 libqcocoa.dylib 0x000000011142ee00 _ZN28QCocoaEventDispatcherPrivate19processPostedEventsEv + 320 49 libqcocoa.dylib 0x000000011142f568 _ZN28QCocoaEventDispatcherPrivate26postedEventsSourceCallbackEPv + 40 50 CoreFoundation 0x00007ff809636bc8 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 51 CoreFoundation 0x00007ff809636b77 __CFRunLoopDoSource0 + 157 52 CoreFoundation 0x00007ff809636951 __CFRunLoopDoSources0 + 212 53 CoreFoundation 0x00007ff8096355cb __CFRunLoopRun + 929 54 CoreFoundation 0x00007ff809634bb0 CFRunLoopRunSpecific + 560 55 HIToolbox 0x00007ff812f16bd6 RunCurrentEventLoopInMode + 292 56 HIToolbox 0x00007ff812f16806 ReceiveNextEventCommon + 199 57 HIToolbox 0x00007ff812f16723 _BlockUntilNextEventMatchingListInModeWithFilter + 70 58 AppKit 0x00007ff80c757b37 _DPSNextEvent + 909 59 AppKit 0x00007ff80c7569b8 -[NSApplication NSEvent 1219 _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 60 AppKit 0x00007ff80c9f6eba -[NSApplication _doModalLoop:peek:] + 301 61 AppKit 0x00007ff80cb78a0e __33-[NSApplication runModalSession:]_block_invoke_2 + 69 62 AppKit 0x00007ff80cb789b6 __33-[NSApplication runModalSession:]_block_invoke + 78 63 AppKit 0x00007ff80c9f52ab _NSTryRunModal + 100 ---- End of Stack Trace ----

hikeonpast avatar Jan 14 '23 20:01 hikeonpast

Thank you for all that information @hikeonpast. I am going to ask one of dev team members to look at this.

Colorjet3 avatar Jan 15 '23 01:01 Colorjet3

Since it appears to be crashing during the ResampleMappedAudio process, you might try and adjust the project / export settings, so no audio resampling is required... as a quick experiment. To do this, verify the following values are all the same:

  • Source Video's Audio Sample Rate (i.e. 44100, 48000, etc...)
  • Export Dialog -> Advanced Tab -> Audio Settings -> Sample Rate (enter the same value used on your source videos)

If you enter the same values, the audio will not need to be resampled, and thus, things might not crash - at least this is what the experiment might demonstrate.

OR if you are feeling more adventurous, you can install the GDB debugger in Windows, and actually "catch" the crash, which will give us much more info on the crash: https://github.com/OpenShot/openshot-qt/wiki/Windows-Debugging-with-GDB

jonoomph avatar Jan 16 '23 02:01 jonoomph

I haven't had a chance to dive into the code, but is it expected that ResampleMappedAudio is called during rendering of a video that is configured as Video Only under the Advanced export settings?

I'll work on setting up GDB when I have a bit more time.

hikeonpast avatar Jan 17 '23 06:01 hikeonpast

Yes, each file is wrapped in a FrameMapper class, which is designed to normalize all the source files into the same FPS and Audio Sample Rate, to make the final timeline easy to composite/merge together. Thus, if your project FPS and Sample Rate matches the source files, we can skip this step... and perhaps skip the crash as well... Of course, just running OpenShot in the GDB debugger will tell us all we need to know about why things are crashing.

jonoomph avatar Jan 22 '23 21:01 jonoomph

I just noticed that in your stack trace, ZN8openshot4Clip21get_time_mapped_frameESt10shared_ptrINS_5FrameEEx, which is known to have some "crashes" when applying time mapping (i.e. slow down / speed up video). Since you mentioned the 16x speed, and this method was involved in the crash... I now think it's highly likely the issue you are experiencing.

I will add this to our Trello board, and see what I can find out. I'll keep you posted.

jonoomph avatar Jan 22 '23 22:01 jonoomph

I just noticed that in your stack trace, ZN8openshot4Clip21get_time_mapped_frameESt10shared_ptrINS_5FrameEEx, which is known to have some "crashes" when applying time mapping (i.e. slow down / speed up video). Since you mentioned the 16x speed, and this method was involved in the crash... I now think it's highly likely the issue you are experiencing.

I will add this to our Trello board, and see what I can find out. I'll keep you posted.

Wait... ZN8openshot4Clip21get_time_mapped_frameESt10shared_ptrINS_5FrameEEx? That's probably why OpenShot was constantly crashing whenever I applied the 'Time' function to a video/audio track, which would instantly crash the app with MSVCRT.DLL causing 0xc0000005 (EXCEPTION_ACCESS_VIOLATION). But in my case, everything was stated in #1197, and this was happening in versions before 3.0.0. The only fix was to reset all OpenShot preferences by deleting openshot.settings in the user's .openshot_qt folder, which would cause the app to create a new one with default settings when launched.

DanPinGF avatar Mar 03 '23 23:03 DanPinGF

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:

  • No activity in the past 180 days
  • No one is assigned to this issue

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

  • If this issue is reporting a bug, please can you attempt to reproduce on the latest daily build to help us to understand whether the bug still needs our attention.
  • If this issue is proposing a new feature, please can you verify whether the feature proposal is still relevant.

Thanks again for your help!

stale[bot] avatar Sep 17 '23 01:09 stale[bot]