Bug 361090

Summary: Audio thumbnail incorrect
Product: [Applications] kdenlive Reporter: qubodup
Component: User Interface & MiscellaneousAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED FIXED    
Severity: normal CC: dev, snd.noise, wegwerf-1-2-3
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description qubodup 2016-03-28 12:35:40 UTC
kdenlive-git 16.07.70.r7157.f7a26b8-1

Do:
1. Download https://www.whitehouse.gov/videos/2016/March/031016_ArrivalCeremony_HD.mp4
2. Open Kdenlive (make sure audio thumbnails are turned on)
3. Import the video
4. Accept the suggested profile
5. Skip to 2/3 of the video

Expect:
1. Correct representations of the audio

Get:
1. Incorrect representation of the audio, clearly noticeable by the complete silence in the thumbnail starting at around 50% of the video time, while one can clearly hear audio

The same happens if you extract the audio to a wav file first.

Video:
https://youtu.be/HJ0i31NRvhs
Comment 1 Jean-Baptiste Mardelle 2016-03-29 09:03:42 UTC
Git commit af8918341d840efbabc98a7117466532671236ed by Jean-Baptiste Mardelle.
Committed on 29/03/2016 at 09:03.
Pushed by mardelle into branch 'Applications/16.04'.

Re-create audio thumbs when changing project's fps

M  +1    -0    src/bin/bin.cpp
M  +21   -2    src/bin/projectclip.cpp
M  +2    -0    src/bin/projectclip.h

http://commits.kde.org/kdenlive/af8918341d840efbabc98a7117466532671236ed
Comment 2 qubodup 2016-03-29 20:56:36 UTC
Thanks for taking care of this, however in kdenlive-git 16.07.70.r7164.ae38cea-1 it now seems that there's simply no thumbnail available any more.

Test 1:
1. Start kdenlive with a default 25fps profile
2. Import at 29.97fps video
3. Cancel the offer to change profile
4. Add video to timeline
5. Audio thumbnail is correct
6. Remove the video from timeline
7. Switch to a 29.97fps profile
8. Add video to timeline
9. Audio thumbnail is empty

Test 2:
1. Start kdenlive with a default 25fps profile
2. Import at 29.97fps video
3. Accept the offer to change profile
4. Add video to timeline
5. Audio thumbnail is empty
Comment 3 Jean-Baptiste Mardelle 2016-03-29 21:10:00 UTC
Git commit b653f7be0597ef5357b7370fdc3531e61f7ea67e by Jean-Baptiste Mardelle.
Committed on 29/03/2016 at 21:09.
Pushed by mardelle into branch 'Applications/16.04'.

Fix audio thumbnails when switching profile

M  +1    -0    src/bin/projectclip.cpp

http://commits.kde.org/kdenlive/b653f7be0597ef5357b7370fdc3531e61f7ea67e
Comment 4 Jean-Baptiste Mardelle 2016-03-29 21:52:10 UTC
Git commit bdcfee6ef372db7cd90d56761036831a130447db by Jean-Baptiste Mardelle.
Committed on 29/03/2016 at 21:51.
Pushed by mardelle into branch 'master'.

Fix audio thumbnails when switching profile

M  +1    -0    src/bin/projectclip.cpp

http://commits.kde.org/kdenlive/bdcfee6ef372db7cd90d56761036831a130447db
Comment 5 Chris Gebhardt 2016-04-02 19:06:15 UTC
Assuming recent (29/03/2016) prior commits are actually included in the kdenlive-master PPA build listed below, I'm still seeing no audio thumbnails in my existing projects or in a fresh project with a single clip. Switching profiles initiates recreation of thumbnails, but then they don't actually appear in the timeline.

kdenlive - 4:16.07.70+git201603301437~ubuntu15.10.1
Comment 6 Jean-Baptiste Mardelle 2016-04-02 21:05:34 UTC
I just tested in a virtual machine with a clean Ubuntu 15.10 and exactly the same kdenlive version from PPA and audio thumbnails appear correctly. Do you have the ffmpeg package installed ? Can you try with an audio file to see if thumbnails are still missing ?
Comment 7 qubodup 2016-04-02 21:59:52 UTC
Regarding the above two comments, I think there might be an issue with pre-existing thumbnails when a video file is used in a new project (possibly with another fps). I deleted all thumbnails to create a clean slate - that seemed to have helped - but haven't thoroughly tested how to trigger the bug yet.
Comment 8 Jean-Baptiste Mardelle 2016-04-03 07:12:49 UTC
Git commit c90140c03555a7cd110818cce2d3768c73a931a9 by Jean-Baptiste Mardelle.
Committed on 03/04/2016 at 07:12.
Pushed by mardelle into branch 'Applications/16.04'.

Fix audio thumbnails corrupted if using a clip in projects with different fps
Fix no icon for audio clips in project bin

M  +34   -18   src/bin/projectclip.cpp
M  +4    -0    src/bin/projectclip.h
M  +4    -0    src/mltcontroller/bincontroller.cpp
M  +0    -6    src/mltcontroller/producerqueue.cpp

http://commits.kde.org/kdenlive/c90140c03555a7cd110818cce2d3768c73a931a9
Comment 9 Chris Gebhardt 2016-04-04 18:08:04 UTC
I got my local build working and pulled your latest changes on  'Applications/16.04'. Behavior is still inconsistent. On a fresh project, some clips will get thumbnails. On existing projects, I can sometimes get thumbnails to generate when switching project profiles.

It does seems as though "Use FFMPEG for audio thumbnails" is a problem, even though FFMPEG is installed. (2.7.6-0ubuntu0.15.10.1) When this option is selected, I will sometimes get audio fingerprints, although the waveform amplitude is extremely low, and often it only works on audio files. With the FFMPEG option deselected, I can get proper waveforms on all clips, but sometimes only after switching profiles to force regeneration.

Also, are thumbnails cached anywhere besides  $HOME/.cache/kdenlive-thumbs.kcache?  Deleting this seems to have no effect in any case.

Sidenote:  After changing the project profile, I'm also very consistently getting crashes during many operations, including attempting to save the project or adding a new clip to the timeline.
Comment 10 Jean-Baptiste Mardelle 2016-04-04 19:36:57 UTC
There are currently 2 ways to generate thumbnails in Kdenlive:

1- if "Use FFMpeg for audiothumbs" is selected, we use an ffmpeg command to extract audio thumbnails data
2 - If "Use FFMpeg..." is not selected, we go through MLT to create the thumbnails.

Method 1 was recently added, it has the advantage of being much faster.

@Chris:
* Can you tell me which MLT and FFMpeg versions you have ?
* When FFmepg audio thumbs is enabled, you say some clips don't get thumbnails. Is it random, or do some clip types never have thumbnails ? If it seems related to clip type, can you paste here the output of this command:
ffmpeg -i myclip.mp4 (where myclip.mp4 is a clip that shows no audio thumbs) ?

The audio thumbnails are stored in the project folder, in a "thumbs" folder, and end with "_audio.png".
The default project folder is "$HOME/kdenlive", so thumbs go in "$HOME/kdenlive/thumbs/"

You can delete a project's thumbs by going to "Project > Project Settings > Project Files > Clear Cache". Note that this will delete audio and video thumbnails. Then you need to close Kdenlive and re-open,  or choose "Revert" from the file menu.

Changing project profile is not a recommanded option...
Comment 11 qubodup 2016-04-05 05:41:40 UTC
Thank you very much, I for one can't find any more bugs with the audio thumbnail generation.

Regarding project change: As far as I understand, changing the project to one that has a different frame rate will most likely corrupt your project if you have clips in the timeline. I only hope it does not when you didn't make changes to the timeline yet but added clips already.
Comment 12 Chris Gebhardt 2016-04-06 05:03:08 UTC
My versions are:
ffmpeg version 2.7.6-0ubuntu0.15.10.1   (standard Wily package)
melt  6.0.0+git201603291753~ubuntu15.10.1   (from kdenlive PPA)

With clearing the thumbnail cache properly while testing, I can say that none of the thumbnails are generated properly when using FFmpeg. However, this appears to be the only remaining problem I have and it may likely be a local issue.
Comment 13 farid 2016-06-22 04:19:11 UTC
Can this issue be marked as solved?