Bug 356299 - Trying to import broken video causes crash
Summary: Trying to import broken video causes crash
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Rendering & Export (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-04 23:56 UTC by qubodup
Modified: 2016-04-07 06:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qubodup 2015-12-04 23:56:03 UTC
catalyst-hook 15.9-6
catalyst-libgl 15.9-2
catalyst-utils 15.9-2
mlt 0.9.8-3
qt5-base 5.5.1-3
kdenlive git describe --tags --always
v15.11.80-53-g0918054

Steps to reproduce:
1. Trying to import (drag and drop) https://app.box.com/s/j7e9ljwpsu3cbm4v3tsvh3byaxfd5tre (2MB mp4) ...

Actual result:
1. ... causes a crash:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f01f4009560] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 6899 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f01f40ecae0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 6899 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Assertion desc failed at libswscale/swscale_internal.h:676
/home/qubodup/.local/bin/klgit: line 4: 11197 Aborted 

The  video is a result of a working mp4 edited with a script that contains

ffmpeg -i "$1" -ss "$2" -t "$3" -acodec copy -vcodec copy -- "s.$1"

with parameters like 0 99.

The file being broken is certainly not Kdenlive's fault. Kdenlive shouldn't crash though.

Expected result:
1. Video does not get imported with a short explanation why not.
Comment 1 Jean-Baptiste Mardelle 2015-12-05 08:28:31 UTC
Works correctly for me, a warning about invalid video pops up in Kdenlive and clip is removed.

This is probably caused by your FFmpeg or libAV version. I am using a recent FFmpeg git and it does not crash.

Your error message indicates a crash in FFmpeg / LibAV, so the problem has probably been fixed now in these libraries.
Comment 2 qubodup 2015-12-05 11:25:45 UTC
FYI:

I just updated my system/kdenlive:
ffmpeg 1:2.8.3-1
ffmpeg-compat 1:0.10.16-4
v15.11.80-53-g0918054 (kdenlive git describe --tags --always)

The error persists.

This ticket was not about fixing ffmpeg but rather about Kdenlive being able to not crash if ffmpeg crashes. Of course I have no idea what kind of work this involves.
Comment 3 Jean-Baptiste Mardelle 2015-12-05 13:13:07 UTC
Oh!! I just realized you are using the master branch! All my recent changes were made in the 15.12 branch and have not been backported, so basically a lot of things have changed that are not in master!! I am merging right now, you can just update master to get the latest changes.

Let me know if you still find problems, and thanks for your reports.
Comment 4 Jean-Baptiste Mardelle 2015-12-05 13:21:41 UTC
Oh, I posted my comment on wrong bug report, was meant for bug 356300 sorry.
About the crash, I will make some tests and let you know. But since FFmpeg is a core component, it won't be easy to not crash on FFmpeg failure. That would require testing every clip for a crash before trying to add it to Kdenlive and seems too much overhead in my opinion.

I think it's better to fix it upstream in FFmpeg. I just tried downgrading to FFmpeg 2.8.3 but it still doesn't crash for me.. Can you tell me what happens when you try to play the clip with ffplay and with melt ?
Comment 5 qubodup 2015-12-05 15:22:29 UTC
To me, as a non-developer and just one user it sounds like checking a file before adding it makes sense if it can prevent a crash caused by a library that kdenlive has no control over due to the way packages are managed in Linux usually. Then again I don't know any better as I don't know how to code it and I don't know how expensive time-wise that would be.

ffmpeg seems fine with it now but mlt appears to fail: http://curlpaste.com/id/bdx68n

Maybe it's an mlt issue after all.
Comment 6 qubodup 2016-04-07 06:59:27 UTC
The issue doesn't happen any more with this file.

Whether or not kdenlive should not crash if ffmpeg or mlt fail, is a discussion topic for mailing list or another ticket.