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

OpenShot 2 video preview freeze when you add more than 2-3 1440x1080 avchd files (.mts) #106

Closed JoOngle2 closed 7 years ago

JoOngle2 commented 8 years ago

Hardware used: Processor: I7-5820K Ram: _32 GB DDR4 _Motherboard: MSI Gaming 7 X99 HDD: Samsung EVO 850 SSD OS: Linux Mint 17.3 (Rosa) Cinnamon Desktop. 64 Bit edition. _Driver: _Proprietary Nvidia. _Graphics card: _Nvidia GeForce 760GTX 2GB ram.

Errortype: OpenShot 2 video preview/playback freezes randomly when playing back/editing/moving around clips in the editor. It doesn't have any problems with playing ONE file in Real Time though, no jerkiness and no jitter. But if you add more than 1 file, especially with 4 files - it will literally freeze up (not the user interface, the user interface will keep working and you can remove clips) but you can't play them back.

When checking with the command: top in a linux terminal console, an OpenShot process has frozen with 250-300% CPU usage. Killing the process with 9 works fine.

Observations: Does NOT crash in older Openshot (1.xx).

Retrace crash steps:

1) Open OpenShot 2. 2) Get some .mts files, preferably AVCHD (typical Sony Proprietary files from Sony Video Cameras). 3) Load them into your library. 4) Move them to the cutting board/editor. 5) Try cutting & editing a little, play back as you go and mess around, it will freeze.

Other: Thanks for your excellent work Jonathan, your work is awesome - it's also the ONLY video editor that actually works properly with Sony's proprietary files (OpenShot 1.xx) Blender can do it, but it will screw up the sound and so will 99% of the other open source video editors out there.

nazikus commented 8 years ago

I have exactly the same issue, but on Windows 7

jonoomph commented 8 years ago

I have added a ton of new logging and debug code to OpenShot since this bug was reported. Please download our latest daily installer:

  1. www.openshot.org/download - click 'Other Installers' link and grab the newest one
  2. Then enable 'Debug Mode (Verbose)' in the Preferences
  3. Quit OpenShot and delete both log files:
    • /.openshot_qt/openshot_qt.log
    • /.openshot_qt/libopenshot.log
  4. Re-launch OpenShot and trigger the crash as quickly as possible (to keep the log files small)
  5. Attach both log files here

Hopefully we can determine from the .log files what is happening (and crashing). Thanks!

nazikus commented 8 years ago

@jonoomph logs & screencast attached. Don't mind the lags during playback, it's because of simultaneous screencasting & playback inside virtual machine. But the bug is reproduced, preview playback just freezes. OS: Windows 7 (x86) OpenShot: OpenShot-v2.0.7-15-g3b4ceff-47-531-x86_32 Media file: .mov Video codec: AVC (Baseline@L5) (1RefRrames), 25.000fps, 1920*1080 (16:9), 38.9Mbps Audio codec: PCM(Little/Signed) 1536Kbps, 48.0KHz, 16bits, 2 channels

libopenshot.log openshot-qt.log screencast-2016-04-22 01-33-07-058.mp4

jonoomph commented 8 years ago

@nazikus Thanks for the great bug report and screencast! I don't see anything in the logs that would indicate it's "stuck in a loop". You might check your memory and CPU utilization (mainly the memory), and see if you are running out of memory on your system.

Also, I've just fixed a pretty nasty race condition, so I would love it if you could grab the "newest" daily build again, and run through those steps again. If not too much trouble, another screencast would be great also.

Lastly, if you have a sample MOV video that reproduces the freeze, can you send that file to me (or attach the file here if you don't mind sharing it publicly). Thanks!

nazikus commented 8 years ago

@jonoomph glad to help, hope these logs will point out to bugs.

bandicam 2016-04-24 17-34-48-654.mp4 openshot-qt.log libopenshot.log it doesn't seem a memory/cpu issue. But I think its a codec-related issue.

Here are two samples: Bullet.mp4 - random video downloaded from Youtube. MVI_1817.MOV - shot from dslr. Both are h.264/AVC encoded. Then I took latter video and re-encoded it with xvid - MVI_1817.avi. And it worked! Played with it for some time and it didn't freeze.

It seems like it's either container issue or AVC decoding.

OpenShot: OpenShot-v2.0.7-18-g68d44e1-47-533-x86_32

gyunaev commented 7 years ago

I have reproduced this. It is indeed codec-related issue. If you simply copy this stream into MP4 container, OpenShot can't preview it at all. The only/easiest workaround is to recode the video.

Also when recoding that video in avidemux, you'd see a lot of errors like that:

[decompressImage] uncompress failed [DecodeNextPicture] 07:16:20-442 Decoding error for frame 8, not necessarily a problem [startThread] 07:16:20-447 Thread created and started [encode] 07:16:20-449 [x264] Null frame [encode] 07:16:20-450 [x264] Null frame [decompressImage] uncompress failed [DecodeNextPicture] 07:16:20-454 Decoding error for frame 10, not necessarily a problem [encode] 07:16:20-462 [x264] Null frame [decompressImage] uncompress failed

so there's a possibility openshot might not handle decompression errors properly (i.e. ignore them)

DylanC commented 7 years ago

@JoOngle2 - Can you verify this issue exists in a newer version of OpenShot?