Kdenlive   bug tracker Home page

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001831KdenliveRenderingpublic2010-09-27 00:042011-11-01 18:56
Reporterghomem 
Assigned Toddennedy 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
Platform64 bitOSMandriva LinuxOS Version2009
Product Version0.7.7.1 
Target VersionFixed in Version0.8.2 
Summary0001831: speeding up video with the speed effect damages the picture quality
DescriptionSpeeding up video with the speed effect damages the picture quality. This can easily be seen using screen captures, where the quality loss is easy to spot on the Window Titles, Menu Entries and in general everywhere there's text.
Steps To Reproduce- perform a screen capture with kdenlive
- play the .ogv file on your favourite media player and check that the quality is OK
- import the file to kdenlive
- render the file and check that the quality is OK
- apply the speed effect to that clip (ex: 135%)
- render the file and check that the quality is MUCH lower than the original
TagsNo tags attached.
Build/Install Method(select)
Attached Filestxt file icon recordmydesktop-to-ffmpeg.diff.txt [^] (9,276 bytes) 2010-11-22 04:23 [Show Content]

- Relationships
related to 0000618closedddennedy When rendering one clip does not become visible until 5 seonds after clip starts 
related to 0001821closedddennedy RecordMyDesktop and Kdenlive OGV Problem 

-  Notes
(0006040)
ddennedy (developer)
2010-11-12 06:06

The speed effect requires frame accurate seeking, and like the umpteen other bug reports here about Ogg Theora, FFmpeg does not provide clean and accurate seeking for Ogg Theora. You should transcode your screen capture to MPEG-2, MPEG-4, or Lossless Matroska.
(0006042)
ghomem (reporter)
2010-11-12 11:19

In that case shouldn't kdenlive default to encoding screen grabs in a format that can be dealt with better the Ogg Theora?
(0006043)
ddennedy (developer)
2010-11-12 19:20

Yes. Currently, it is using recordmydesktop, which can only output Ogg Theora (unless changed recently). Since we already depend on ffmpeg, which should see if we can use it instead, but we might have to give up something. Alternatively, since Ogg Theora works so well in gstreamer, we could add a gstreamer input plugin to MLT, but that could be a fair amount of work.
If you would like to help, then it would be great if you make a study of ffmpeg's x recording capability, perhaps encoding to near lossless MPEG-4 (not H.264, because mpeg4 is very fast in FFmpeg) and describe here what capabilities we would lose.
(0006044)
ghomem (reporter)
2010-11-12 22:58

I see what you mean. The ffmpeg way (which is already a dependency) seems better. I'll look at it.
(0006045)
ghomem (reporter)
2010-11-13 00:12
edited on: 2010-11-13 00:15

I tested this with a resolution of 1440x900 according to xdpyinfo.

Results with mpeg4:

ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -sameq -vcodec mpeg4 /tmp/out.mp4

works and encodes mpeg4. The result plays fine on mplayer and kaffeine. However the video is cut on the bottom by what I suspect is 12px.

Results with mpeg2:

ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -sameq -vcodec mpeg2video /tmp/out.mp2

works and encodes mpeg2. The result plays fine on mplayer and kaffeine.


Notes:
- the output file must have the right extension (.mp4, .mp2) or ffmpeg will use a wrong container fo that codec

- kaffeine reports "libmpeg2 (1440x912) 1440x900" on the mpeg2 result and "ffmpeg (1440x900) 1440x900" on the mpeg4 file (see the track info option)

- the mouse cursor may have a black border unless ffmpeg is very new:

https://roundup.ffmpeg.org/issue2056 [^]

(0006064)
ddennedy (developer)
2010-11-15 03:23

I hacked this into Kdenlive for a test, and it does work. I made it output I-frame only mpeg4 with mp2 audio.
Things we would have to give up:
- follow mouse mode
- region frame
- jack port auto-connection

I need to make a performance comparison against recordmydesktop.
(0006065)
ddennedy (developer)
2010-11-15 03:55

Wow, performance is good!
recordmydesktop uses about 1% and it is not doing on-the-fly encoding.
recordmydesktop with on-the-fly encoding uses about 12%.
ffmpeg doing on-the-fly encoding uses only 1.5%!
It certainly is nice to have the on-the-fly encoding, which is a plus on the ffmpeg approach.
I think the jack auto-connection is fine to give up - jack users are advanced and can make the connection easily.
(0006066)
ddennedy (developer)
2010-11-15 05:40

I am feeling that is better to offer something more compatible with kdenlive and an alternative to recordmydesktop in lieu of these missing features. After all, people can still use recordmydesktop with one of its other gui frontends if they really need these other features.
(0006102)
Granjow (developer)
2010-11-20 09:04

I don't know /what/ kind of CPU you have, but mine (Core2Duo 2 GHz, 3 years old) goes to 100 % on one core. If I kept it on one core, yes, the other might stay at 1.5 % :P

But:
* recordmydesktop goes to 100% as well with on-the-fly.
* ogv sucks. The recorded ogv file plays to one half only. The .ogv needs to be fixed in kdenlive first. And for editing, I think I'd even prefer H.265 over it.
* follow cursor does not really work anyway. Last time I used it (one or two months ago) it always included part of the surrounding box (which it drawed itself but did not update fast enough).

To be honest, every time I try to do a screencast with recordmydesktop I decide I won't do it anymore.
(0006104)
ghomem (reporter)
2010-11-20 11:22

@Granjow

Haven't had any problem with capturing the screen in .ogv and using it on a video inside kdenlive. The cursor appears to be ok (see for example near 0:2m). Problems started only when changing the clip speed. There may be others I'm not aware of.
(0006110)
ddennedy (developer)
2010-11-22 04:37

I uploaded a patch to use ffmpeg instead of recordmydesktop and shows how I encoding. It is not commit-ready.

Granjow, I tested on an i7, but recordmydesktop does not encode on-the-fly by default or the way kdenlive calls it. Maybe performance is also affected by the X server? In ffmpeg, we can also experiment with capturing to HuffYUV Matroska to see if it performs better. I will do some more comparisons on other computers.
We can not fix ogv in kdenlive because the code for demuxing and decoding does not live there. :P I have been holding out hope it will be improved in FFmpeg. I am not planning to create a ogv-specific producer in MLT as the value of Theora has reduced tremendously since the introduction of WebM. If someone feels differently they can address it their self or hire or convince someone. I think there is more value in changing tools that only output to Ogg Theora or starting choosing alternatives.

ghomem, lots of people have trouble with Ogg Theora in Kdenlive. A casual stroll through the bug tracker shows it. I am saying the problems with speed is the same because it is so reliant on seeking.
(0006143)
ddennedy (developer)
2010-12-07 08:43

Fixed in FFmpeg r25846 on Nov 29.

- Issue History
Date Modified Username Field Change
2010-09-27 00:04 ghomem New Issue
2010-11-12 06:06 ddennedy Note Added: 0006040
2010-11-12 06:07 ddennedy Relationship added related to 0000618
2010-11-12 11:19 ghomem Note Added: 0006042
2010-11-12 19:20 ddennedy Note Added: 0006043
2010-11-12 22:58 ghomem Note Added: 0006044
2010-11-13 00:12 ghomem Note Added: 0006045
2010-11-13 00:13 ghomem Note Edited: 0006045 View Revisions
2010-11-13 00:15 ghomem Note Edited: 0006045 View Revisions
2010-11-15 03:23 ddennedy Note Added: 0006064
2010-11-15 03:55 ddennedy Note Added: 0006065
2010-11-15 05:40 ddennedy Note Added: 0006066
2010-11-20 08:27 ddennedy Relationship added related to 0001821
2010-11-20 09:04 Granjow Note Added: 0006102
2010-11-20 11:22 ghomem Note Added: 0006104
2010-11-22 04:22 ddennedy Assigned To => ddennedy
2010-11-22 04:22 ddennedy Status new => assigned
2010-11-22 04:23 ddennedy File Added: recordmydesktop-to-ffmpeg.diff.txt
2010-11-22 04:37 ddennedy Note Added: 0006110
2010-12-07 08:43 ddennedy Note Added: 0006143
2010-12-07 08:43 ddennedy Status assigned => resolved
2010-12-07 08:43 ddennedy Resolution open => fixed
2011-07-05 12:15 j-b-m Fixed in Version => 0.8.2
2011-11-01 18:56 j-b-m Status resolved => closed


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker