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.35k stars 544 forks source link

Crash importing MP4 file (Ubuntu 22.04, using 3.2.1-dev) #5614

Open asgrim opened 1 month ago

asgrim commented 1 month ago

Describe the bug: If I try to import some MP4 files (consistently the ones recorded from my Insta360 Go 2, if that helps), e.g. by drag/drop into OpenShot Project Files or I use context menu "Import Files" and select the file, I get a segfault.

I have had this issue for some time, but thought I'd try with the latest daily. Same issue exists in 3.2.1 stable. I have also tried updating ffmpeg, since the ffmpeg with Ubuntu 22.04 is version 4.4.2-0ubuntu0.22.04.1+esm5 which I think is quite old. I used an ffmpeg7 PPA to upgrade to 7.0.2-1build1~jammy but the issue still persists.

Steps to reproduce the behavior:

  1. Launch OpenShot (using 3.2.1-dev daily from PPA), from terminal openshot-qt
  2. Drag the sample file into OpenShot
  3. OpenShot disappears, segfault is displayed in terminal

Expected behavior: The file should be imported.

System Details:

Log Files:

Exception / Stacktrace:

Output shown when running from CLI:

asgrim commented 1 month ago

If it helps, I captured a short recording which reproduces the issue: https://github.com/user-attachments/assets/44ccdbb1-a5ee-4ed8-99c7-7fc811e52fb8

Colorjet3 commented 1 month ago

Hello @asgrim What happens if you run your source .mp4 file through a converter like VLC, HandBrake, or ShutterEncoder and convert it to .mp4 again with a different name. Now import this newly created .mp4 file into OpenShot.

asgrim commented 1 month ago

Hello @asgrim What happens if you run your source .mp4 file through a converter like VLC, HandBrake, or ShutterEncoder and convert it to .mp4 again with a different name. Now import this newly created .mp4 file into OpenShot.

Indeed, as a workaround in the past I have used ffmpeg (I think something like ffmpeg -i input.mp4 output.mp4, can't remember off my head) and that sidesteps the problem, but sometimes I have a huge number of videos, sometimes many GBs to do, and this can be very time consuming.

Colorjet3 commented 1 month ago

Well, VLC, HandBrake, and ShutterEncoder have a batch process option to speed up the conversion process. I often use ShutterEncoder and it works really well.

Colorjet3 commented 1 month ago

Hello @asgrim Is it possible that you can share your entire project so that the lead developer can play/test with it in his environment so he can debug this issue? If yes, please copy all your source files (videos, audio, and image files) in the same directory as the .osp file and then zip them up and share here.

Thank you in advance.

asgrim commented 1 month ago

Hello @asgrim Is it possible that you can share your entire project so that the lead developer can play/test with it in his environment so he can debug this issue? If yes, please copy all your source files (videos, audio, and image files) in the same directory as the .osp file and then zip them up and share here.

Thank you in advance.

It is reproducible in literally an empty project. A video that causes the issue is attached in my first comment above.

asgrim commented 1 month ago

If it helps, I captured a short recording which reproduces the issue: https://github.com/user-attachments/assets/44ccdbb1-a5ee-4ed8-99c7-7fc811e52fb8

Here ☝️

Colorjet3 commented 1 month ago

If it helps, I captured a short recording which reproduces the issue: https://github.com/user-attachments/assets/44ccdbb1-a5ee-4ed8-99c7-7fc811e52fb8

Here ☝️

When I click on the link it just plays a black video for 3 seconds.

asgrim commented 1 month ago

If it helps, I captured a short recording which reproduces the issue: https://github.com/user-attachments/assets/44ccdbb1-a5ee-4ed8-99c7-7fc811e52fb8

Here ☝️

When I click on the link it just plays a black video for 3 seconds.

Yes that is correct...the content of the video doesn't make much difference. Any video from that device causes OpenShot to crash when I try to import it :(

influential-eliot commented 1 month ago

I have the same issue.

I just want to quickly edit a screencast, so will try shotcut instead, but hope this gets sorted. :)

Colorjet3 commented 2 weeks ago

Lots of bug fixes and enahancements in the latest dev daily build.

  1. Go to openshot.org/download/#daily and get the latest AppImage.
  2. Make it executable and run it.
asgrim commented 2 weeks ago

Thanks for the ping; I don't use AppImage, but I tried the latest DEB (3.2.1+dfsg2+1704+202410122047~ubuntu22.04.1), but the issue remains. Steps to reproduce:

1) Download the above example MP4 file 2) Run OpenShot 3) Click & drag the MP4 into OpenShot project files list

What is expected: file should be imported to the project files list

What actually happens: OpenShot exits with segfault.

libopenshot.log shows:

------------------------------------------
libopenshot logging: Mon Oct 21 07:25:51 2024
------------------------------------------
---- Unhandled Exception: Stack Trace ----
  /usr/lib/python3/dist-packages/_openshot.cpython-310-x86_64-linux-gnu.so swig::SwigPyForwardIteratorOpen_T<std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, swig::from_oper<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::value() const 0x16  [0x7cc8b3fb10e6]
  /usr/lib/python3/dist-packages/_openshot.cpython-310-x86_64-linux-gnu.so                                          0xbe96d  [0x7cc8b3ebe96d]
  /usr/bin/python3                                                        0x15c574  [0x5fc8a9e75574]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x285e  [0x5fc8a9e60a6e]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x8ab  [0x5fc8a9e5eabb]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x6bc  [0x5fc8a9e5e8cc]
  /usr/bin/python3                                                        0x16b281  [0x5fc8a9e84281]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x6bc  [0x5fc8a9e5e8cc]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x8ab  [0x5fc8a9e5eabb]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x8ab  [0x5fc8a9e5eabb]
  /usr/bin/python3               _PyObject_FastCallDictTstate             0xc4  [0x5fc8a9e6b474]
  /usr/bin/python3                                                        0x1674b4  [0x5fc8a9e804b4]
  /usr/bin/python3               _PyObject_MakeTpCall                     0x1fc  [0x5fc8a9e6c27c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x6b17  [0x5fc8a9e64d27]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x8ab  [0x5fc8a9e5eabb]
  /usr/bin/python3                                                        0x16b3ce  [0x5fc8a9e843ce]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x285e  [0x5fc8a9e60a6e]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x285e  [0x5fc8a9e60a6e]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x613a  [0x5fc8a9e6434a]
  /usr/bin/python3               _PyFunction_Vectorcall                   0x7c  [0x5fc8a9e7642c]
  /usr/bin/python3               _PyEval_EvalFrameDefault                 0x8ab  [0x5fc8a9e5eabb]
  /usr/bin/python3                                                        0x16b4e1  [0x5fc8a9e844e1]
  /usr/bin/python3                                                        0x2943aa  [0x5fc8a9fad3aa]
  /usr/bin/python3                                                        0x288fe8  [0x5fc8a9fa1fe8]
  /lib/x86_64-linux-gnu/libc.so.6                                          0x94ac3  [0x7cc8b5094ac3]
  /lib/x86_64-linux-gnu/libc.so.6                                          0x126850  [0x7cc8b5126850]
---- End of Stack Trace ----
Colorjet3 commented 2 weeks ago

Hello @asgrim

Please try the AppImage just to see if it resolves your issue? You can get rid of it then when you are done testing. This will help the lead developer to troubleshoot as well.

asgrim commented 2 weeks ago

@Colorjet3 the issue does not persist in the AppImage. I suppose that points to a dependency issue somewhere :)