Bug 361976 - git master (re-opened) - Playback of certain video files produces large distortion artifacts (video example & sample footage included)
Summary: git master (re-opened) - Playback of certain video files produces large disto...
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: git-master
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL: https://youtu.be/m_lQc2NFIO0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 21:12 UTC by Unknown
Modified: 2021-03-04 20:01 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
fritzibaby: timeline_corruption+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2016-04-19 21:12:27 UTC
See video in URL field for example of final result.

I have a clip from am MP4 video file that was exported from Blender: 1920x1080, H.264 codec. When I render it out using Kdenlive's mp4 settings (specific settings: properties=x264-medium f=mp4 vcodec=libx264 acodec=aac g=120 crf=%quality ab=%audiobitrate+'k'), the final video has distortion artifacts sporadically, but frequently.

Here is a link where the raw footage file I used can be downloaded for testing: https://www.dropbox.com/s/bpdtnbvsoa5kikv/Raw%20footage%20-%201920x1080%20-%20h264%20codec.mp4?dl=0

Reproducible: Always

Steps to Reproduce:
1. Import a video with the specifications mentioned in description.
2. Add clip into timeline.
3. Render with the specifications mentioned in description.

Actual Results:  
Final product video has artifacts distorting the image.

Expected Results:  
No artifacts.

Bug discovered while using Kdenlive 16.07.70 git master build from ppa:kdenlive/kdenlive-master ppa, Ubuntu GNOME 16.04 x64, GNOME 3.18.
Comment 1 Unknown 2016-04-19 21:20:36 UTC
I just noticed the sample file is around 800MB -- sorry for the long download times.

Also, I changed this bug report's importance to major because H.x64 .mp4 files is the best quality codec while being the most versatile. To not have this particular export option available is a rather sore inconvenience.
Comment 2 Evert Vorster 2016-04-20 12:09:15 UTC
Hi there, Jesse. 
I work from x264 and HEVC formats the whole time, and have not seen this distortion. 

Can you tell me whether you have multiple render streams enabled?
Configure Kdenlive, 
Environment, 
Processing threads (Should be 1)

I have seen massive distortions only when having more than one processing threads in conjunction with deep filter stacks.
Comment 3 Unknown 2016-04-20 18:11:17 UTC
Hey Evert,

Thanks for the feedback. Yessir, the Processing threads is set to 1, and has been since the fresh installation.

When you get a chance, would you be willing to try to render the sample clip I provided in the description with the settings I'd specified?

I'm also trying a few different export options in Blender to see if that changes anything. More info' to come!
Comment 4 Evert Vorster 2016-04-21 07:28:03 UTC
Hi there. 

The settings you have are the standard ones for mp4. 
However, the quality setting is set via the GUI. Can you tell me what the quality setting was? Remember, the quality setting number is "dB of *loss* of fidelity", so a lower number gives a higher quality output. (Lower loss)

For x264 I don't use any number higher than 18, and for x265 the highest quality loss I use is 20.

My internet connection is too slow to download your source clip, it would take more than a week, and I would severely annoy the people I am sharing this connection with. 
So, I can't really see the issues you are seeing. If you can provide a frame from the original and the same frame from the rendered version to compare I can maybe be of more assistance. 

The only thing I can think of with the information I have is this: Since it's Blender rendered chances are that you will have very sharp edges in the video, and these are prone to the compression artifacts from x264. Try a higher quality setting (lower number)

Kind regards,
Evert
Comment 5 Unknown 2016-04-21 14:51:42 UTC
Thanks so much for all the help, Evert! I'll check some of the things you said and comment back soon.
Comment 6 Unknown 2016-04-27 17:03:56 UTC
I think this bug was a little premature. I'll tinker with things and see if I can't resolve the issue, or confirm the actual bug.

Closing this bug report for now. Appreciate all the help, everyone.
Comment 7 Unknown 2016-07-21 00:01:36 UTC
I needed to re-open this one, because I'm having a heck of a time trying to make video files not have distortion with video files made from Blender.

Literally, the only difference that shows in the clip monitor between video clips from Blender and video clips rendered in Kdenlive from Blender, is the bitrate: blender video files have a bitrate of 31,697 kb/s, while Kdenlive rendered projects FROM Blender video clips are 19,864 kb/s.

Does Kdenlive have an issue with other higher bitrate video files? If not, any idea what the problem could be?
Comment 8 Unknown 2016-07-26 19:45:23 UTC
I'm still doing some testing to see if the clips still have the artifacts/distortions with a lower bit-rate when Blender is rendering. Will post more soon.
Comment 9 Wegwerf 2016-07-27 15:50:44 UTC
Jesse, the bitrate doesn't affect Kdenlive, but instead ffmpeg as it is used to encode the individual rendered frames (audio+video). So if it's a rendering issue, then I would guess it's rather in ffmpeg's ballpark. Unless there is a severe loss of frame(!) quality while frames pass through MLT from the producers (ffmpeg) to the consumer (ffmpeg, again). Did you try to render with more relaxed bitrate settings?
Comment 10 Wegwerf 2016-07-27 15:53:15 UTC
Jesse, another thought just occurred to me: when you check the project monitor in 1:1 and without preview rendering, is the monitor rendering quality okay? As far as I know, while MLT is told to skip frames on playback, there should be no difference in rendering quality when you don't use proxies. (Jean-Baptiste, please correct me if I'm wrong!)
Comment 11 Wegwerf 2016-10-08 15:48:00 UTC
Jesse, any news on this stale report?
Comment 12 Unknown 2016-10-09 17:05:39 UTC
@Wegwerf, thanks for the update request. This is still happening in the latest git master build. Would it help if I provided a sample video clip for testing?
Comment 13 Wegwerf 2016-10-09 17:11:51 UTC
Yes, please do, as your original DB link does not work anymore.
Comment 14 Wegwerf 2016-10-09 17:13:22 UTC
BTW, Jesse can you tray to transcode your source clip directly using ffmpeg, using the parameters that you see in Kdenlive's render profile? This would help in detecting any issues with MLT, albeit I don't think this is a MLT issue.
Comment 15 Unknown 2016-10-27 23:12:09 UTC
Thanks for the feedback, all. Here's a link to download a sample file made in Blender: https://www.dropbox.com/s/w342e2se92u63ot/blender%20sample%20file%20h264%206000mb-s%20bitrate.mp4?dl=0.

Adding an effect and preview-rendering the file above in Kdenlive will produce the artifacts I'm mentioning. This is confirmed in the latest git master build 16.11.70.
Comment 16 Unknown 2016-10-27 23:13:41 UTC
@Wegwerf, I'm unsure how to export directly using ffmpeg in the terminal, sorry. If you can provide the steps, I'll be happy to test and report.
Comment 17 emohr 2021-03-04 20:01:47 UTC
It seems that this report is related to very old unmaintained version. A lot changed since then, especially the timeline got a complete rewrite and it is likely that this has been fixed.

Feel free to reopen this bug or create a new report if this is still happening with the latest version (https://kdenlive.org/en/download/)