Bug 362925 - kdenlive-git fails to create audio thumbnails
Summary: kdenlive-git fails to create audio thumbnails
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-11 07:05 UTC by Anton Gubarkov
Modified: 2016-06-07 21:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Gubarkov 2016-05-11 07:05:02 UTC
out of 3 clips I work with, only one  produces an audio thumbnail. The other 2 give the following error:
***********
FOUND GUIDES:  1 
**********

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:1,0), Устройство или ресурс занято.

"Creating audio thumbnails (1/1)"
"Creating audio thumbnails (2/2)"

RtApiAlsa::callbackEvent: audio write error, underrun.

"Error reading audio thumbnail"
QProcess: Destroyed while process ("/usr/bin/ffmpeg") is still running.
WARNING: Phonon::createPath: Cannot connect  Phonon::MediaObject ( no objectName ) to  Phonon::AudioOutput ( no objectName ).
"Creating audio thumbnails (3/2)"
"Error reading audio thumbnail"
QProcess: Destroyed while process ("/usr/bin/ffmpeg") is still running.
WARNING: Phonon::createPath: Cannot connect  Phonon::MediaObject ( no objectName ) to  Phonon::AudioOutput ( no objectName ).

The clips are big - 12 and 19 GB. What's the best way to debug it?



Reproducible: Always
Comment 1 Jean-Baptiste Mardelle 2016-05-11 20:27:30 UTC
Hmm, I see there is a 30 seconds timeout for the audio thumbnail creation, and after that the process is killed. Any chance that you hit this delay ?
Comment 2 Jean-Baptiste Mardelle 2016-05-11 20:55:44 UTC
Git commit 00182273dc5d652bb2f5cbb51e99b3ba76a01153 by Jean-Baptiste Mardelle.
Committed on 11/05/2016 at 20:55.
Pushed by mardelle into branch 'master'.

If FFmpeg audio thumbnails fail, switch to MLT audio thumbnail (slower but safer)

M  +58   -56   src/bin/projectclip.cpp

http://commits.kde.org/kdenlive/00182273dc5d652bb2f5cbb51e99b3ba76a01153
Comment 3 Jean-Baptiste Mardelle 2016-05-11 20:59:56 UTC
I just pushed a change so that if FFmpeg fails to create the audio thumbnail, we switch to MLT to create the thumbnails. This should ensure that you always get thumbnails, however this is much slower to create audio thumbs this way, so I still would love to solve the original issue. Let me know if you think the thumbnail creation for these files took longer than 30 seconds.
Comment 4 Anton Gubarkov 2016-05-12 08:44:20 UTC
Can you share the ffmpeg command template so I could time my audio thumb creation outside kdenlive? I usually shoot performance of approx 60-100 minutes which results in a file 12-19 GB (FHD@50p).
Comment 5 Anton Gubarkov 2016-05-12 10:16:10 UTC
I pulled the ffmpeg command myself. Here is the timing:

anton@r9-008cln ~ $ time /usr/bin/ffmpeg -i "/home/anton/Видео/2016-05-02 Terkin/externals/overhead.MTS" -filter_complex:a [0:a]aresample=async=100,channelsplit=channel_layout=stereo[0:0][0:1] -map [0:1] -c:a pcm_s16le -y -f data /tmp/kdenlive.TJ5505 -map [0:0] -c:a pcm_s16le -y -f data /tmp/kdenlive.XM5505
ffmpeg version 2.8.7 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -pipe -march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -fstack-protector-strong' --disable-static --enable-avfilter --enable-avresample --disable-stripping --enable-version3 --enable-nonfree --disable-indev=oss --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-gpl --enable-hardcoded-tables --enable-iconv --disable-lzma --enable-network --disable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl --enable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --enable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --enable-libopenjpeg --enable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --enable-libspeex --enable-libvorbis --enable-libvpx --disable-libzvbi --disable-libbs2b --disable-libflite --enable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --enable-libfreetype --disable-libsoxr --enable-pthreads --enable-libvo-aacenc --disable-libvo-amrwbenc --enable-libmp3lame --enable-nvenc --disable-libaacplus --enable-libfaac --disable-libsnappy --enable-libtheora --disable-libtwolame --enable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=haswell
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from '/home/anton/Видео/2016-05-02 Terkin/externals/overhead.MTS':
  Duration: 01:34:24.00, start: 1.400000, bitrate: 27142 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x101](und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 128 kb/s
Output #0, data, to '/tmp/kdenlive.TJ5505':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, 1 channels (FR), s16, 768 kb/s
    Metadata:
      encoder         : Lavc56.60.100 pcm_s16le
Output #1, data, to '/tmp/kdenlive.XM5505':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 1 channels (FL), s16, 768 kb/s
    Metadata:
      encoder         : Lavc56.60.100 pcm_s16le
Stream mapping:
  Stream #0:1 (aac) -> aresample
  channelsplit:FR -> Stream #0:0 (pcm_s16le)
  channelsplit:FL -> Stream #1:0 (pcm_s16le)
Press [q] to stop, [?] for help
size=  531000kB time=01:34:24.00 bitrate= 768.0kbits/s
video:0kB audio:1062000kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

real	4m0.238s
user	0m13.437s
sys	0m7.346s


So it takes ffmpeg 4 minutes to process my 19 GB video file. Can you make this timeout configurable rather than static 30s ?
Comment 6 Jean-Baptiste Mardelle 2016-05-12 20:06:20 UTC
Git commit 249c70fa9da42c228a53653afe5ddae323b91c41 by Jean-Baptiste Mardelle.
Committed on 12/05/2016 at 20:06.
Pushed by mardelle into branch 'master'.

No more timeout on audio thumbs creation, display ffmpeg's progress info

M  +23   -7    src/bin/projectclip.cpp
M  +4    -0    src/bin/projectclip.h

http://commits.kde.org/kdenlive/249c70fa9da42c228a53653afe5ddae323b91c41
Comment 7 Anton Gubarkov 2016-05-13 05:38:06 UTC
Fixed. Thanks a lot!
Comment 8 Vincent PINON 2016-06-07 21:30:03 UTC
Git commit 1968877dd6fc36b9ea0e6025ee29bf84a5ce3a47 by Vincent Pinon, on behalf of Jean-Baptiste Mardelle.
Committed on 07/06/2016 at 20:15.
Pushed by vpinon into branch 'Applications/16.04'.

No more timeout on audio thumbs creation, display ffmpeg's progress info

M  +23   -7    src/bin/projectclip.cpp
M  +4    -0    src/bin/projectclip.h

http://commits.kde.org/kdenlive/1968877dd6fc36b9ea0e6025ee29bf84a5ce3a47