Bug 395701 - Keyframes are not recalculated for all clips when rendering the final video which produces frozen images at the beginning of transitions (input clip format is h264)
Summary: Keyframes are not recalculated for all clips when rendering the final video w...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdenlive
Classification: Applications
Component: Rendering & Export (show other bugs)
Version: 18.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2018-06-21 19:04 UTC by Barade
Modified: 2022-09-27 04:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
fritzibaby: low_hanging+


Attachments
clip properties (31.71 KB, image/png)
2018-10-15 19:39 UTC, Barade
Details
real clip properties (32.09 KB, image/png)
2018-10-15 19:42 UTC, Barade
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Barade 2018-06-21 19:04:44 UTC
When I play the video in Kdenlive with Proxy Clips it does show all frames of every clip but when the video is rendered with MP4 - the dominating format (H264/AAC), it does not show all frames of the beginning of a clip. The scene does already start with a later frame of the clip.
I don't know how the rendering process works but maybe the key frames are not regenerated for the clips?
Comment 1 Barade 2018-06-23 19:17:06 UTC
When I select the clip and the action "Analyse keyframes" it says "no valid clip". I am trying to transcode the clips now and another format. Shouldn't all the keyframes be recalculated when the video is rendered and so no frames should be cut off?
Comment 2 Barade 2018-06-24 09:56:06 UTC
When I render the video with the proxy clips, the frames are not cut off, so there seems to be a problem on how accurate the proxy clips are?
Comment 3 Barade 2018-06-24 11:29:56 UTC
I think that the problem is not the incorrect representation of the proxy clips but that the keyframes are not recalculated for the all clips/clip transitions. Therefore, I get frozen images at the beginning of some clips in the final rendered video. The frozen images are images from the clip which are shown later in the clip and the clips start with these images and after some time the clip reaches the time where the image would be actually shown and continues as it should.
I have uploaded an example video on youtube but privately which I can share with your e-mail addresses if you would like to see the issue.

This is the codec of all of my input clip files:
H264 - MPEG-4 AVC (part 10) (h264)

Please fix this bug since I cannot render my final video now as it should actually look (except I render the proxy clips in a higher quality or try to replace the input clips by newly transcoded clips which is also not possible with kdenlive at the moment).

I would be willing to donate some money to the project for the fix.
Comment 4 emohr 2018-10-14 12:35:17 UTC
Please try with the actual Kdenlive AppImage version 18.08.2
Run the Appimage from the terminal (press CTRL + ALT + T). Move to the AppImage folder and run the .AppImage: ./Kdenlive*.AppImage
Comment 5 Barade 2018-10-15 17:19:36 UTC
I have tried the latest AppImage version, opened my project and rendered it again and the bug is still there.
I have analyzed the video frame by frame with avidemux and in the beginning of some scenes there a are still frames:
I-FRM (00)
B-FRM(00)
B-FRM(00)
B-FRM(00)
P-FRM(00)
B-FRM(00)
B-FRM(00)
B-FRM(00)
P-FRM(00)
and now the actual movements in the scene start which can be clearly seen since there is wind in the scene and the clothes suddenly start moving.

Watch the following video when it cuts to the monk's reaction after the time marker:
https://youtu.be/g-WbV4fisPQ?list=PLhWYsSZhXgXJiS3YxLCqS8Uz-FvW1mrjq&t=239

The still frames do not exist in the Proxy-Clips/preview in Kdenlive.
These still frames do not always appear after cuts, so it might depend on the frames from the source clip?
This bug is really annoying since it destroys many clean cuts.

Btw. I couldn't make the preview window bigger in the latest Kdenlive version, it always snapped back to its original size.
Comment 6 emohr 2018-10-15 17:43:36 UTC
Thanks for the update. What type of the source footage you use?

I assume it’s a problem how Kdenlive interpret the I-, P-, B-Frame. https://en.wikipedia.org/wiki/Video_compression_picture_types

I marked the bug for further analysis.
Comment 7 Barade 2018-10-15 18:11:04 UTC
Codec: H264 - MPEG-4 AVC (part 10)(h264)

or are you talking about the frame types of the input files?
It is hard to find out. I have selected the clip in the project tree and it says that the range from 00:18:13 until 00:21:11 is used.
In avidemux I can only move to 00:18.120 which is B-TFF (00) and 00:18.160 which is P-TFF (00).
Can I see the exact frame type somewhere else in kdenlive?
Comment 8 emohr 2018-10-15 19:30:21 UTC
I meant the input file (the file which comes out of your camera). In the top menu go to “view” -> and enable “Properties”. Click on a source clip in the bin and you see the details in the property view. From a typical clip post here a screenshot of this view.
Comment 9 Barade 2018-10-15 19:39:47 UTC
Created attachment 115663 [details]
clip properties
Comment 10 Barade 2018-10-15 19:40:16 UTC
I have added an attachment file.
Comment 11 Barade 2018-10-15 19:42:05 UTC
Created attachment 115664 [details]
real clip properties

This is the correct file now, the other one was the transcoded one.
Comment 12 emohr 2018-10-15 19:55:46 UTC
The problem can come from the interlaced material. Does your camera can make progressive recording? If yes, switch to progressive with the highest possible framerate (50?).

To solve your issue try the following: rendering -> more option -> on the right site “scanning” -> change to “forced interlaced” and render again.
Comment 13 Barade 2018-10-16 10:59:42 UTC
I have set the option and the frozen images seem to be gone, thx.
Comment 14 Barade 2018-10-21 11:59:47 UTC
Apparently, I have selected the wrong profile "HD 1080p 25 fps" instead of "HD 1080i 25 fps".
How does the rendering process work with kdenlive? Shouldn't it warn the user when he uses clips which do not fit the profile?
Would it have been rendered interlaced automatically with the right profile "HD 1080i 25 fps" if I had selected it before without setting the force option?
I am just curious if this is even a bug since it was apparently my own fault but I think kdenlive could detect the render profile automatically from some input clips?
Comment 15 emohr 2018-10-21 16:04:00 UTC
I don’t know the FFMPEG render process in detail. But I assume FFMPEG takes the render value from the timeline.

For that reason I would always set “Check if first clip matches project profile” in the miscellaneous Kdenlive settings. 

You can try change the project profile to interlaced, but in your case I would start again as changing the project profile afterwards can lead to problems (just my experience).

I would like to take this as an input to the Dev team to set “Check if first clip matches project profile” as default setting to avoid this. And close this Bug.
Comment 16 Barade 2018-10-24 08:18:06 UTC
I would not only check the first clip by default but all clips and warn about all not matching clips.
This should be done by default.
You could open a feature request for this.
Comment 17 Barade 2018-10-24 08:18:40 UTC
Besides, the profile could be detected automatically by the input clips.
Comment 18 Barade 2018-10-28 10:32:54 UTC
I have created two issues:
- https://bugs.kde.org/show_bug.cgi?id=400402
- https://bugs.kde.org/show_bug.cgi?id=400403
Comment 19 farid 2022-08-28 13:52:59 UTC
Is this still happening in latest version (22.08)?
Comment 20 Bug Janitor Service 2022-09-12 04:36:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 21 Bug Janitor Service 2022-09-27 04:48:22 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!