darkfeline / cantata

Automatically exported from code.google.com/p/cantata
GNU General Public License v3.0
0 stars 0 forks source link

Replaygain scan (FLAC/m4a?): Failed #609

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of Cantata?
1.5.1

Which build? KDE, Qt4, Qt5, Windows, Ubuntu, Mac?
Qt5 on Arch Linux

What steps will reproduce the problem?
1. Open the Replaygain Window for some FLAC files
2. Click the Scan button
3. In all 4 columns "Failed" appears, no further information

What is the expected output? What do you see instead?
The Flac files should be scanned, instead "Failed" appears.

Please provide any additional information below.

I don't know if any packages are missing, but flac, metaflac is installed on 
both server and client machine. 
MPD and cantata are not run on the same machine, but the server filesystem is 
mounted on the client machine and the correct path to the music files is 
specified within cantata. Grabbing the album art works from the file system 
works, and scanning .ogg and .mp3 files works fine. 

Original issue reported on code.google.com by herrvong...@gmail.com on 30 Dec 2014 at 9:41

GoogleCodeExporter commented 9 years ago
Cantata itself calculates the replaygain - buy using some core from libebur128. 
First of all it decodes the files via libavcodec (from ffmpeg/libav). The way 
it works is that Cantata will use libav to convert the FLAC/OGG/MP3 into raw 
PCM audio - and feed this into libebur128. If it is failing, then it is 
probably this decoding of audio that is failing - but this is handled by the 
other libraries...

I've just tried converting 3 MP3s to FLAC (via avconv), and then performing the 
replaygain calc - and it is working for me (except the Peaks are all 1.0?)

Seeing as 'Failed' is appearing - perhaps your libavcodec (or is it 
libavformat?) is not linked against the required FLAC libraries? A long shot I 
know, but I'm not sure what else this could be.

p.s. Sorry for the late reply - I've been away from my PC for a while...

Original comment by craig.p....@gmail.com on 16 Jan 2015 at 8:41

GoogleCodeExporter commented 9 years ago
Hi and sorry for the late reply.

How can I find out whether the libav libs are linked against the FLAC libs? 

By the way, same problem with m4a files from itunes.

Original comment by herrvong...@gmail.com on 13 Feb 2015 at 12:09

GoogleCodeExporter commented 9 years ago
By the way, I enabled logging everything to terminal (CANTATA_DEBUG=-489335), 
and there is lots of output, but hitting the Scan button (which results in 
"Failed") does not output anything.

Original comment by herrvong...@gmail.com on 13 Feb 2015 at 12:19

GoogleCodeExporter commented 9 years ago
Then this definitely looks like an issue on your system. m4a scanning 
definitely works on my system.

What does ldd /usr/lib/x86_64-linux-gnu/libavcodec.so return? (the path to 
libavcodec.so might not be correct for your system)

Original comment by craig.p....@gmail.com on 13 Feb 2015 at 6:16

GoogleCodeExporter commented 9 years ago
That's the output (addresses removed).

$ldd /usr/lib/libavcodec.so
    linux-vdso.so.1
    libswresample.so.1 => /usr/lib/libswresample.so.1 ()
    libavutil.so.54 => /usr/lib/libavutil.so.54 ()
    libva.so.1 => /usr/lib/libva.so.1 ()
    libpthread.so.0 => /usr/lib/libpthread.so.0 ()
    libxvidcore.so.4 => /usr/lib/libxvidcore.so.4 ()
    libx265.so.43 => /usr/lib/libx265.so.43 ()
    libx264.so.142 => /usr/lib/libx264.so.142 ()
    libvpx.so.1 => /usr/lib/libvpx.so.1 ()
    libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 ()
    libvorbis.so.0 => /usr/lib/libvorbis.so.0 ()
    libtheoraenc.so.1 => /usr/lib/libtheoraenc.so.1 ()
    libtheoradec.so.1 => /usr/lib/libtheoradec.so.1 ()
    libspeex.so.1 => /usr/lib/libspeex.so.1 ()
    libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0 ()
    libz.so.1 => /usr/lib/libz.so.1 ()
    libopus.so.0 => /usr/lib/libopus.so.0 ()
    libopenjpeg.so.1 => /usr/lib/libopenjpeg.so.1 ()
    libopencore-amrwb.so.0 => /usr/lib/libopencore-amrwb.so.0 ()
    libopencore-amrnb.so.0 => /usr/lib/libopencore-amrnb.so.0 ()
    libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 ()
    libgsm.so.1 => /usr/lib/libgsm.so.1 ()
    libm.so.6 => /usr/lib/libm.so.6 ()
    liblzma.so.5 => /usr/lib/liblzma.so.5 ()
    libc.so.6 => /usr/lib/libc.so.6 ()
    libdl.so.2 => /usr/lib/libdl.so.2 ()
    /usr/lib64/ld-linux-x86-64.so.2 ()
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 ()
    libogg.so.0 => /usr/lib/libogg.so.0 ()
    liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 ()
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 ()
    librt.so.1 => /usr/lib/librt.so.1 ()

$ffmpeg -version
ffmpeg version 2.5.4 Copyright (c) 2000-2015 the FFmpeg developers
built on Feb 13 2015 17:05:44 with gcc 4.9.2 (GCC) 20150204 (prerelease)
configuration: --prefix=/usr --disable-debug --disable-static 
--disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig 
--enable-gnutls --enable-gpl --enable-libass --enable-libbluray 
--enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmodplug 
--enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb 
--enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp 
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 
--enable-libxvid --enable-runtime-cpudetect --enable-shared --enable-swresample 
--enable-vdpau --enable-version3 --enable-x11grab
libavutil      54. 15.100 / 54. 15.100
libavcodec     56. 13.100 / 56. 13.100
libavformat    56. 15.102 / 56. 15.102
libavdevice    56.  3.100 / 56.  3.100
libavfilter     5.  2.103 /  5.  2.103
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  3.100 / 53.  3.100

Original comment by herrvong...@gmail.com on 18 Feb 2015 at 10:48

GoogleCodeExporter commented 9 years ago
Having previously said m4a is working - I have just tried on a new Ubuntu 14.10 
build, and it is not working for me either. mp3 is probably working because 
libmp3 is being used for those...

Original comment by craig.p....@gmail.com on 20 Feb 2015 at 10:19

GoogleCodeExporter commented 9 years ago
The m4a issue is fixed in trunk (for 1.6.0) and branches/1.5 (for 1.5.2) for me 
at least. Any chance you could checkout one of these and confirm?

Original comment by craig.p....@gmail.com on 24 Feb 2015 at 2:42

GoogleCodeExporter commented 9 years ago
I checked out and compiled trunk. I can scan FLAC files now (great news :)), 
but I still cannot scan .ogg and .m4a files. 

Original comment by herrvong...@gmail.com on 24 Feb 2015 at 11:59

GoogleCodeExporter commented 9 years ago
Can you try again, I've made some more changes.

Original comment by craig.p....@gmail.com on 25 Feb 2015 at 6:02

GoogleCodeExporter commented 9 years ago
Great! ogg vorbis is working now. Scanning m4a still fails like it did before. 

Original comment by herrvong...@gmail.com on 26 Feb 2015 at 8:53

GoogleCodeExporter commented 9 years ago
Any particular m4a? Or all of them? m4a is working for me. If you have a 
copyright-free m4a that has this issue, please upload somewhere and provide a 
link.

Original comment by craig.p....@gmail.com on 26 Feb 2015 at 7:53

GoogleCodeExporter commented 9 years ago
All of my m4a files don't work, although I only have very few such files. 
They're all from itunes.

Original comment by herrvong...@gmail.com on 28 Feb 2015 at 1:23

GoogleCodeExporter commented 9 years ago
Please re-compile with the attached file (place into replaygain folder).

The run cantata-replaygain from the commandline. This should be located within 
the replaygain folder of your build folder. Run as (e.g):

build-folder> ./replaygain/cantata-replaygain <path to one m4a file>

then attach the output here.

My m4a's are from iTunes as well, so this is most odd.

Original comment by craig.p....@gmail.com on 28 Feb 2015 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
Here's the output:

OPEN "/mnt/stuff/rgain-test.m4a"
got audio stream
dec a  0 0
dec a  1 0
dec a  2 0
dec a  3 0
decode audio: 29
FORMAT 8
num read 0
PROGRESS: 100
TRACK: 0 FAILED
ALBUM: FAILED

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 11:38

GoogleCodeExporter commented 9 years ago
Can you try again with the attached? Thanks.

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 12:05

Attachments:

GoogleCodeExporter commented 9 years ago
After ~20 minutes, cantata-replaygain is still running on a ~5MB m4a input file 
and produced about 3GB of output so far. Whole ouput looks like:

..
dec a  136599313 0 29
..

I keep it running and report back when it's finished processing the file.

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 12:37

GoogleCodeExporter commented 9 years ago
Hmmm... Should not take that long! I'd abort the run, that is not right - its 
just stuck in a loop!

Cantata's code is based upon the following:

https://github.com/jiixyj/loudness-scanner

Can you checkout that project, compile, and run the loudness-scanner app. If 
so, does it work for you?

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 12:45

GoogleCodeExporter commented 9 years ago
In /usr/include/libavformat/version.h what are the values of:

#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR  1
#define LIBAVFORMAT_VERSION_MICRO  0

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 12:48

GoogleCodeExporter commented 9 years ago
Can you post a link to /mnt/stuff/rgain-test.m4a - or is this a copyrighted 
music file? If so, don't bother - don't want you getting in trouble just for 
this!

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 12:50

GoogleCodeExporter commented 9 years ago
Also, does Arch use ffmpeg or libav? libav was forked from ffmpeg - Ubuntu uses 
libav.

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 12:51

GoogleCodeExporter commented 9 years ago
Building loudness-scanner fails on my system:

...
[ 47%] Linking C shared module ../../../libinput_gstreamer.so
Built target filetree
[ 47%] Built target input_ffmpeg
[ 47%] Built target input_gstreamer
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

The values in version.h:

#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR  15
#define LIBAVFORMAT_VERSION_MICRO 102

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 12:55

GoogleCodeExporter commented 9 years ago
I don't really know what the answer to your ffmpeg/libav question is. From the 
arch wiki:

FFmpeg is a complete, cross-platform solution to record, convert and stream 
audio and video. It includes libavcodec - the leading audio/video codec library.

https://wiki.archlinux.org/index.php/FFmpeg

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 12:59

GoogleCodeExporter commented 9 years ago
Edit: Arch uses ffmpeg by default.

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 1:04

GoogleCodeExporter commented 9 years ago
Please try this version - I've updated it to match the loundness-scanner code.

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 1:41

Attachments:

GoogleCodeExporter commented 9 years ago
That did the trick, works fine for mp3, flac, ogg vorbis and mp4 (.m4a) now :)

Thank you!

Original comment by herrvong...@gmail.com on 1 Mar 2015 at 3:49

GoogleCodeExporter commented 9 years ago
Fwew!!!! Glad its finally fixed. Thanks for confirming. I've committed the code 
now - and will release 1.5.2 soon...

Original comment by craig.p....@gmail.com on 1 Mar 2015 at 3:56