Amarok/Manual/Various/Moodbar/da: Difference between revisions

From KDE UserBase Wiki
(Updating to match new version of source page)
No edit summary
Line 17: Line 17:
==== Oversigt over forudsætningerne ====
==== Oversigt over forudsætningerne ====


* Programmet '''Moodbar''' skal kunne findes i din PATH (det skal blive fundet, hvis du kører {{Input|1=which moodbar}}i en konsol) — husk at konfigurere pakken Moodbar med {{Input|1=./configure --prefix=`pkg-config --variable=prefix gstreamer-0.10`}}
* Programmet '''Moodbar''' skal findes i din PATH (det skal blive fundet, hvis du kører {{Input|1=which moodbar}}i en konsol) — husk at konfigurere pakken Moodbar med den korrekte sti. Du kan fx bygge og installere med kommandoerne {{Input|1=./configure --prefix=`pkg-config --variable=prefix gstreamer-0.10`}}


* The GStreamer 1.0 library and [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|plugins]] for the formats you want '''Moodbar''' to be able to analyse. (An earlier GStreamer 0.10 based version is also still available for some distributions)
* The GStreamer 1.0 library and [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|plugins]] for the formats you want '''Moodbar''' to be able to analyse. (An earlier GStreamer 0.10 based version is also still available for some distributions)
Line 25: Line 25:
* En udgave af '''Amarok''' med tilvalget <menuchoice>Vis stemningslinje i fremgangslinjen</menuchoice> i afsnittet <menuchoice>Generelt</menuchoice> i indstillingsdialogen, det vil sige version 1.4.4 eller højere i 1.4-serien eller 2.2.2 eller højere i 2.x-serien.
* En udgave af '''Amarok''' med tilvalget <menuchoice>Vis stemningslinje i fremgangslinjen</menuchoice> i afsnittet <menuchoice>Generelt</menuchoice> i indstillingsdialogen, det vil sige version 1.4.4 eller højere i 1.4-serien eller 2.2.2 eller højere i 2.x-serien.


{{Info/da|Systemer med pakkehåndtering skulle automatisk installere plugins til GStreamer samt FFTW sammen med pakken Moodbar. Denne information er mest beregnet til de, der selv skal kompilere kildekoden og manuelt installere pakkerne.}}
{{Info|Systems with package managers should automatically install the GStreamer plugins and FFTW along with the Moodbar package if available; this information is provided mostly for people who want or need to compile from source or manually install packages, or where the distribution specific instructions are outdated and no updated moodbar package is yet available.}}


==== Brug ====
==== Brug ====
Line 37: Line 37:
===== Download kildekoden =====
===== Download kildekoden =====


:Seneste udgave: [http://pwsp.net/~qbob/moodbar-0.1.2.tar.gz moodbar-0.1.2.tar.gz] &mdash; dette er kildekoden til Moodbar-pakken, som indeholder programmet '''Moodbar''' (som genererer .mood-filerne fra musikfilerne) og et plugin til GStreamer, som laver arbejdet. Pakken Moodbar skal bruge GStreamer 0.10.* samt 0.10.* udgaven af [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|forskellige plugins]]. Sørg for at installere pakken Moodbar i ''det samme prefiks'' som GStreamer &mdash; følg instruktionerne i filen INSTALL.
:Latest release: [https://github.com/Mazhoon/moodbar/archive/v0.1.4.tar.gz moodbar-0.1.4.tar.gz] &mdash; this is the Moodbar source package, which contains the '''Moodbar''' program (which generates .mood files from music files), and a GStreamer plugin that does the work. The Moodbar package  needs GStreamer 1.0.* installed, plus the 1.0.* version of [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|various plugins]]. Be sure to install the Moodbar package into the ''same prefix'' as GStreamer &mdash; follow the instructions in [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Summary_of_Requirements | the summary of requirements chapter]]. The 0.1.4 is a a fork of original 0.1.2 sources, updated to use GStreamer 1.0. The old 0.1.2 sources are not reliably available online any more, but packages might be still available for some distributions.


Hvis du opdager programfejl, så indrapportér dem venligst til [http://bugs.kde.org bugs.kde.org].
Hvis du opdager programfejl, så indrapportér dem venligst til [http://bugs.kde.org bugs.kde.org].
Line 43: Line 43:
===== Pakker til Debian =====
===== Pakker til Debian =====


Der findes nu en Moodbar-pakke i Debian unstable. Kør blot {{Input|1=apt-get install moodbar}}. Du vil nok også skulle installere gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-good og gstreamer0.10-plugins-bad til at understøtte filformater.
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
A package for Moodbar is now available in Debian unstable. Simply run {{Input|1=apt-get install moodbar}}. You will likely also want to install gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-good, and gstreamer0.10-plugins-bad for format support.


===== Pakker til Kubuntu og Ubuntu =====
===== Pakker til Kubuntu og Ubuntu =====
Line 56: Line 57:
===== Gentoo ebuilds =====
===== Gentoo ebuilds =====


Moodbar findes i Portage; kør blot {{Input|1=emerge moodbar}} Uofficielle ebuilds er ikke længere nødvendige.
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
Moodbar is available in Portage, simply {{Input|1=emerge moodbar}} Unofficial ebuilds are no longer required.


===== Bygning af RPM pakker =====
===== Bygning af RPM pakker =====


Hvis du bruger en rpm-baseret distribution, så kan du bygge en .rpm-pakke ved brug af rpmbuild med den seneste [http://cvs.pld-linux.org/cgi-bin/cvsweb/SPECS/gstreamer-plugins-moodbar.spec gstreamer-plugins-moodbar.spec]. Den binære pakke vil snart være tilgængelig til distributionen [http://pld-linux.org PLD-linux].
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated}}
If you are a rpm-based distro user, you can build a .rpm using rpmbuild with latest
[http://cvs.pld-linux.org/cgi-bin/cvsweb/SPECS/gstreamer-plugins-moodbar.spec gstreamer-plugins-moodbar.spec]. The binary package will be soon available for [http://pld-linux.org PLD-linux] distro.


===== Fedora =====
===== Fedora =====


I Fedora 7 og senere (op til 16 mens dette skrives) findes pakken Moodbar i standard-arkiverne. De kan let installeres med PackageKit eller med følgende kommando:
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
In Fedora 7 and higher (up to 16 as of this writing) Moodbar is available in the default repositories. Simply install it with your PackageKit GUI or with the following yum command:


{{Input|1=yum install moodbar}}
{{Input|1=yum install moodbar}}
Line 71: Line 76:




openSUSE 11.0 og senere installerer automatisk følgende pakker:
GStreamer 1.0 based version 0.1.4 is available in KDE:Extra repository for openSUSE Leap 42.3 and later. An earlier GStreamer 0.10 based version 0.1.2 is also still available in the main repository for some openSUSE versions.
*gstreamer-0_10-fluendo-mp3
*gstreamer-0_10-plugins-base


Detaljer om, hvordan du tilføjer arkiver kan du finde i [http://en.opensuse.org/SDB:Add_package_repositories openSUSE's wiki].
Detaljer om, hvordan du tilføjer arkiver kan du finde i [http://en.opensuse.org/SDB:Add_package_repositories openSUSE's wiki].




1-Click Install for openSUSE 11 - vælg blot din version, så ordner installationsproceduren resten:
1-Click Install for openSUSE - just choose your version and installation procedure will do the rest:
* [http://software.opensuse.org/ymp/home:dstoecker/openSUSE_11.2/moodbar.ymp openSUSE 11.2]
* [https://software.opensuse.org/ymp/KDE:Extra/KDE_Frameworks5_openSUSE_Tumbleweed/moodbar.ymp openSUSE Tumbleweed]
* [http://software.opensuse.org/ymp/home:dstoecker/openSUSE_11.1/moodbar.ymp openSUSE 11.1]
* [https://software.opensuse.org/ymp/KDE:Extra/openSUSE_Leap_15.0/moodbar.ymp openSUSE Leap 15.0]
* [https://software.opensuse.org/ymp/KDE:Extra/openSUSE_Leap_42.3/moodbar.ymp openSUSE Leap 42.3]




===== Pakker til Mandriva =====
===== Pakker til Mandriva =====


For det første skal du tilføje arkiverne PLF, så besøg [http://easyurpmi.zarb.org easyurpmi.zarb.org] og føj dem til til liste af arkiver. Installér så blot følgende pakker:
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
First of all, you need to add PLF repositories, so visit [http://easyurpmi.zarb.org easyurpmi.zarb.org] and add them to your repositories list.
Then simply install the following packages:


* gstreamer0.10-moodbar
* gstreamer0.10-moodbar
Line 94: Line 100:
===== Arch Linux =====
===== Arch Linux =====


Der findes en PKGBUILD for Moodbar i [http://aur.archlinux.org Arch User Repository (AUR)]. Den findes [http://aur.archlinux.org/packages.php?ID=6552 her].
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
There is a PKGBUILD for Moodbar in the [http://aur.archlinux.org Arch User Repository (AUR)] available [http://aur.archlinux.org/packages.php?ID=6552 here].


Find mere information om AUR og hvordan PKGBUILD'er virker i [http://wiki.archlinux.org/index.php/AUR_User_Guidelines AUR User Guidelines].
Find mere information om AUR og hvordan PKGBUILD'er virker i [http://wiki.archlinux.org/index.php/AUR_User_Guidelines AUR User Guidelines].
Line 100: Line 107:
===== FreeBSD =====
===== FreeBSD =====


Der er en port [http://www.freshports.org/audio/gstreamer-plugins-moodbar audio/gstreamer-plugins-moodbar her].
{{Note|This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.}}
There is a port: [http://www.freshports.org/audio/gstreamer-plugins-moodbar audio/gstreamer-plugins-moodbar here].


For at installere port'en skriv {{Input|1=cd /usr/ports/audio/gstreamer-plugins-moodbar/ && make install clean}}For at tilføje pakken skriv {{Input|1=pkg_add -r gstreamer-plugins-moodbar}}
For at installere port'en skriv {{Input|1=cd /usr/ports/audio/gstreamer-plugins-moodbar/ && make install clean}}For at tilføje pakken skriv {{Input|1=pkg_add -r gstreamer-plugins-moodbar}}
Line 173: Line 181:
==== Problemløsning ====
==== Problemløsning ====


* Hvis programmet '''Moodbar''' giver dig en ''bus error'', så betyder det næsten altid, at den ikke kan dekode (eller ikke kan finde) din fil. Se de [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|understøttede filtyper]] herunder for at finde ud af, hvilke GStreamer-plugins, du skal installere. Du kan også prøve kommandoen herunder for at teste om GStreamer kan dekode din fil:{{Input|1=gst-launch filesrc location=[file] ! decodebin ! fakesink}}
* If the '''Moodbar''' executable gives you a ''bus error'', that almost always means it can't decode (or can't find) your file. Take a look at the [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|supported file types]] below for ideas on which GStreamer plugins to install. You can also try the command below to test whether GStreamer can decode your file:{{Input|1=gst-launch-1.0 filesrc location=[file] ! decodebin ! fakesink}}


* Hvis du bruger plugin'et ffmpeg til af decode mp3'er, så kan du også få mystiske bus-fejl. Løsningen er at holde op med at bruge plugin'et ffmpeg, da det har mange fejl &mdash; brug mad i stedet.
* Hvis du bruger plugin'et ffmpeg til af decode mp3'er, så kan du også få mystiske bus-fejl. Løsningen er at holde op med at bruge plugin'et ffmpeg, da det har mange fejl &mdash; brug mad i stedet.
Line 179: Line 187:
* Hvis programmet '''Moodbar''' fortæller dig, at det ikke kan finde et element &mdash; hvis det fx giver dig en fejlmeddelelse som denne: {{Output|1=Could not create element of type fftwspectrum, please install it.}}&mdash; så betyder det i reglen at du enten ikke har installeret det nødvendige plugin (se [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|listen med plugins]]) eller at du ikke installerede pakken Moodbar i samme prefiks som GStreamer. Hvis libmoodbar.so og libgstdecodebin.so ikke ligger i samme mappe, så er Moodbar ikke installeret i samme prefiks som GStreamer. Find instruktioner om, hvordan man konfigurerer pakken moodbar korrekt i filen INSTALL . Det kan også være lettere at bruge miljøvariablen <tt>GST_PLUGIN_PATH</tt> ''hvis du ved hvad du gør''.
* Hvis programmet '''Moodbar''' fortæller dig, at det ikke kan finde et element &mdash; hvis det fx giver dig en fejlmeddelelse som denne: {{Output|1=Could not create element of type fftwspectrum, please install it.}}&mdash; så betyder det i reglen at du enten ikke har installeret det nødvendige plugin (se [[Special:myLanguage/Amarok/Manual/Various/Moodbar#Supported Filetypes|listen med plugins]]) eller at du ikke installerede pakken Moodbar i samme prefiks som GStreamer. Hvis libmoodbar.so og libgstdecodebin.so ikke ligger i samme mappe, så er Moodbar ikke installeret i samme prefiks som GStreamer. Find instruktioner om, hvordan man konfigurerer pakken moodbar korrekt i filen INSTALL . Det kan også være lettere at bruge miljøvariablen <tt>GST_PLUGIN_PATH</tt> ''hvis du ved hvad du gør''.


* Hvis du undrer dig over, at '''Moodbar''' ikke virker, enten slet ikke eller ikke med en bestemt fil, så kør følgende kommando, hvor [file] er en musikfil:{{Input|1=moodbar -o test.mood [file]}}
* If you're wondering why the '''Moodbar''' isn't working, either not working at all or not working for a particular file, run the command below, where [file] is a music file:{{Input|1=moodbar -o test.mood [file]}} To generate a test image preview, one can use the commandː{{Input|1=gst-launch-1.0 filesrc location=[file] ! decodebin ! audioconvert ! fftwspectrum ! moodbar height=50 max-width=300 ! pngenc ! filesink location=mood.png}}


* Hvis du har flere versioner af GStreamer installeret, så sørg for at alle de nødvendige plugins er installeret ''for version 0.10.*'' &mdash; forskellige versioner ''kan ikke'' bruge hinandens plugins.
* If you have multiple versions of GStreamer installed, make sure all of the required plugins are installed ''for version 1.0.*'' -- different versions ''cannot'' use each other's plugins.
<span id="Supported Filetypes"></span>
<span id="Supported Filetypes"></span>
==== Understøttede filtyper ====
==== Understøttede filtyper ====


Du skal fruge forskellige plugins til GStreamer for at gøre '''Moodbar''' i stand til at analysere dine filer. Her er en liste med de plugins, som du får brug for; sørg for at installere ''0.10.* versionen'' af hvert plugin:
You will need various Gstreamer plugins to enable '''Moodbar''' to analyze your files. Here is a list of the plugins you will need; make sure to install the ''1.0.* version'' of each plugin:


{| border="1" cellpadding="5" <!--}-->
{| border="1" cellpadding="5" <!--}-->
! Filetype !! Nødvendigt plugin !! Note
! Filetype !! Nødvendigt plugin !! Note
|-
|-
| Alle || gstreamer-0.10.*, gst-plugins-base, gst-plugins-good
| All || gstreamer-1.0.*, gst-plugins-base, gst-plugins-good
|-
|-
| mp3 || gst-plugins-mad (i gst-plugins-ugly) || plugin'et ffmpeg har problemer; ''brug det ikke'' til mp3
| mp3 || gst-plugins-mad (i gst-plugins-ugly) || plugin'et ffmpeg har problemer; ''brug det ikke'' til mp3

Revision as of 13:10, 6 August 2018

Stemningslinjen

Stemningslinjen viser dig et spors "stemning", som du kan bruge til at finde ud af, om der sker noget interessant i nummeret.

Amarok skal bruge programmet Moodbar for at kunne lave stemningslinjer for din musik (se nedenfor om downloads og binære pakker).

Pakken Moodbar skal bruge GStreamer og diverse plugins afhængigt af, hvilke filtyper du bruger (se Understøttede filtyper). Du har ikke brug for pakken phonon-backend-gstreamer for at lave .mood-filer.

Den nye implementering af Stemningslinjen består af to dele: dels pakken Moodbar, som indeholder et program, som tager en musikfil og genererer en .mood-fil, dels understøttelse i Amarok selv, som viser stemningslinjen. Pakken Moodbar afhænger af GStreamer-bibliotekerne. Uden pakken Moodbar kan Amarok ikke generere stemningslinjer for din musik.

Som et alternativ er der et nyt script, som kan lave moodbar-filer for spor i en af Amaroks spillelister. Dette er en undtagelse til ovenstående. Scriptet skal blot bruge Amarok for at virke, men laver kun .mood-filer når de spilles i Spillelisten.

Stemningslinjen skyldes Gavin Woods and Simon O'Keefes arbejde. De designede algoritmerne; deres oprindelige artikel er her.

Oversigt over forudsætningerne

  • Programmet Moodbar skal findes i din PATH (det skal blive fundet, hvis du kører
    which moodbar
    i en konsol) — husk at konfigurere pakken Moodbar med den korrekte sti. Du kan fx bygge og installere med kommandoerne
    ./configure --prefix=`pkg-config --variable=prefix gstreamer-0.10`
  • The GStreamer 1.0 library and plugins for the formats you want Moodbar to be able to analyse. (An earlier GStreamer 0.10 based version is also still available for some distributions)
  • Biblioteket FFTW (Den hurtigste Fouriertransformation i vesten, fftw.org) i version 3.0 eller derover (mindst en udgave med single-precision flydende-tal - libfftw3f) — hvis din platform ikke giver dig dette, eller hvis du er nødt til at kompilere din egen version, så husk at konfigurere pakken FFTW med
    ./configure --enable-single
  • En udgave af Amarok med tilvalget Vis stemningslinje i fremgangslinjen i afsnittet Generelt i indstillingsdialogen, det vil sige version 1.4.4 eller højere i 1.4-serien eller 2.2.2 eller højere i 2.x-serien.

Information

Systems with package managers should automatically install the GStreamer plugins and FFTW along with the Moodbar package if available; this information is provided mostly for people who want or need to compile from source or manually install packages, or where the distribution specific instructions are outdated and no updated moodbar package is yet available.


Brug

I øjeblikket skal .mood-filerne genereres manuelt. Amarok kan ikke gøre det for dig. For at gøre det for hele din musiksamling kan du bruge scriptet til at generere stemningslinjer, som beskrevet nedenfor.

For at muliggøre visning af stemningslinjer i Amarok skal det aktiveres i indstillingerne: Indststillinger -> Indstil Amarok... -> Generelt -> Vis stemningslinje i fremgangslinjen. Nu skulle stemningslinjer dukke op i skyderen for sporet i afspillervinduet og i Spillelisten. Der er også en stemningslinje, som du kan føje til dit spillelistelayout.

Installation

Download kildekoden
Latest release: moodbar-0.1.4.tar.gz — this is the Moodbar source package, which contains the Moodbar program (which generates .mood files from music files), and a GStreamer plugin that does the work. The Moodbar package needs GStreamer 1.0.* installed, plus the 1.0.* version of various plugins. Be sure to install the Moodbar package into the same prefix as GStreamer — follow the instructions in  the summary of requirements chapter. The 0.1.4 is a a fork of original 0.1.2 sources, updated to use GStreamer 1.0. The old 0.1.2 sources are not reliably available online any more, but packages might be still available for some distributions.

Hvis du opdager programfejl, så indrapportér dem venligst til bugs.kde.org.

Pakker til Debian

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

A package for Moodbar is now available in Debian unstable. Simply run

apt-get install moodbar

. You will likely also want to install gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-good, and gstreamer0.10-plugins-bad for format support.

Pakker til Kubuntu og Ubuntu

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

A package for Moodbar is available in the official package repository; just ensure the universe section is activated (which should be default anyway). Just install the package moodbar with your preferred package manager (Kpackagekit, Aptitude, Adept, Synaptic). You will likely also want to install gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-good, and gstreamer0.10-plugins-bad for format support.

Du kan også kopiere følgende ind i adresselinjen i Firefox eller Konqueror og taste Enter.

apt://moodbar,gstreamer0.10-plugins-ugly,gstreamer0.10-plugins-good,gstreamer0.10-plugins-bad?section=universe?refresh=yep
Gentoo ebuilds

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

Moodbar is available in Portage, simply

emerge moodbar

Unofficial ebuilds are no longer required.

Bygning af RPM pakker

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated

If you are a rpm-based distro user, you can build a .rpm using rpmbuild with latest gstreamer-plugins-moodbar.spec. The binary package will be soon available for PLD-linux distro.

Fedora

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

In Fedora 7 and higher (up to 16 as of this writing) Moodbar is available in the default repositories. Simply install it with your PackageKit GUI or with the following yum command:

yum install moodbar
Pakker til openSUSE

GStreamer 1.0 based version 0.1.4 is available in KDE:Extra repository for openSUSE Leap 42.3 and later. An earlier GStreamer 0.10 based version 0.1.2 is also still available in the main repository for some openSUSE versions.

Detaljer om, hvordan du tilføjer arkiver kan du finde i openSUSE's wiki.


1-Click Install for openSUSE - just choose your version and installation procedure will do the rest:


Pakker til Mandriva

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

First of all, you need to add PLF repositories, so visit easyurpmi.zarb.org and add them to your repositories list. Then simply install the following packages:

  • gstreamer0.10-moodbar
  • gstreamer0.10-plugins-ugly
  • gstreamer0.10-plugins-good
  • gstreamer0.10-plugins-bad
Arch Linux

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

There is a PKGBUILD for Moodbar in the Arch User Repository (AUR) available here.

Find mere information om AUR og hvordan PKGBUILD'er virker i AUR User Guidelines.

FreeBSD

Note

This section contains old instructions for the GStreamer 0.10 based moodbar version 0.1.2, they might be outdated.

There is a port: audio/gstreamer-plugins-moodbar here.

For at installere port'en skriv

cd /usr/ports/audio/gstreamer-plugins-moodbar/ && make install clean

For at tilføje pakken skriv

pkg_add -r gstreamer-plugins-moodbar

Script til at generere .mood-filer

Her er et simpelt bash-script, som føjer .mood-filer til hele din samling. Det tilføjer en .mood-fil for enhver fil, som matcher filendelserne i den aktuelle mappe og alle dens undermapper, så det er lettest at køre scriptet fra roden af dit musikbibliotek.

#!/bin/bash
 DIR=${1:-.}
 LAST=~/.moodbar-lastreadsong
 C_RET=0
 
 control_c()        # run if user hits control-c
 {
   echo "" > "$LAST"
   echo "Exiting..."
   exit
 }
 
 if [ -e "$LAST" ]; then
   read filetodelete < "$LAST"
   rm "$filetodelete" "$LAST"
 fi
 exec 9< <(find "$DIR" -type f -regextype posix-awk -iregex '.*\.(mp3|ogg|flac|wma)') # you may need to add m4a and mp4
 while read i
 do
   TEMP="${i%.*}.mood"
   OUTF=`echo "$TEMP" | sed 's#\(.*\)/\([^,]*\)#\1/.\2#'`
   trap 'control_c "$OUTF"' INT
   if [ ! -e "$OUTF" ] || [ "$i" -nt "$OUTF" ]; then
     moodbar -o "$OUTF" "$i" || { C_RET=1; echo "An error occurred!" >&2; }
   fi
 done <&9
 exec 9<&-
 
 exit $C_RET

Kopier ovenstående og sæt det ind i en tekstfil ved navn moodbar.sh i din musikmappe og kør så følgende:

cd /path/to/music
 bash moodbar.sh

Hvis ovenstående ikke virker, så kan du i stedet prøve med

chmod +x moodbar.sh
 ./moodbar.sh

Dette kan tage lang tid, hvis din samling er stor! Bemærk, at stemningslinjer ikke vil dukke op i Amarok før Amarok genscanner samlingen. De genererede mood-filer vil være skjulte filer (dvs. deres navn starter med et punktum) - husk det, hvis du ikke kan finde de genererede mood-filer.

Her er et alternativt script til multicore-CPU'er baseret på ovenstående:

#!/bin/bash
 NUMCPU="$(grep ^processor /proc/cpuinfo | wc -l)"
 
 find . -type f -regextype posix-awk -iregex '.*\.(mp3|ogg|flac|wma)' | while read i ; do
 
        while [ `jobs -p | wc -l` -ge $NUMCPU ] ; do
                sleep 0.1
        done
 
        TEMP="${i%.*}.mood"
        OUTF=`echo "$TEMP" | sed 's#\(.*\)/\([^,]*\)#\1/.\2#'`
        if [ ! -e "$OUTF" ] ; then
                moodbar -o "$OUTF" "$i" &
        fi
 done


Problemløsning

  • If the Moodbar executable gives you a bus error, that almost always means it can't decode (or can't find) your file. Take a look at the supported file types below for ideas on which GStreamer plugins to install. You can also try the command below to test whether GStreamer can decode your file:
    gst-launch-1.0 filesrc location=[file] ! decodebin ! fakesink
  • Hvis du bruger plugin'et ffmpeg til af decode mp3'er, så kan du også få mystiske bus-fejl. Løsningen er at holde op med at bruge plugin'et ffmpeg, da det har mange fejl — brug mad i stedet.
  • Hvis programmet Moodbar fortæller dig, at det ikke kan finde et element — hvis det fx giver dig en fejlmeddelelse som denne:
    Could not create element of type fftwspectrum, please install it.
    — så betyder det i reglen at du enten ikke har installeret det nødvendige plugin (se listen med plugins) eller at du ikke installerede pakken Moodbar i samme prefiks som GStreamer. Hvis libmoodbar.so og libgstdecodebin.so ikke ligger i samme mappe, så er Moodbar ikke installeret i samme prefiks som GStreamer. Find instruktioner om, hvordan man konfigurerer pakken moodbar korrekt i filen INSTALL . Det kan også være lettere at bruge miljøvariablen GST_PLUGIN_PATH hvis du ved hvad du gør.
  • If you're wondering why the Moodbar isn't working, either not working at all or not working for a particular file, run the command below, where [file] is a music file:
    moodbar -o test.mood [file]
    To generate a test image preview, one can use the commandː
    gst-launch-1.0 filesrc location=[file] ! decodebin ! audioconvert ! fftwspectrum ! moodbar height=50 max-width=300 ! pngenc ! filesink location=mood.png
  • If you have multiple versions of GStreamer installed, make sure all of the required plugins are installed for version 1.0.* -- different versions cannot use each other's plugins.

Understøttede filtyper

You will need various Gstreamer plugins to enable Moodbar to analyze your files. Here is a list of the plugins you will need; make sure to install the 1.0.* version of each plugin:

Filetype Nødvendigt plugin Note
All gstreamer-1.0.*, gst-plugins-base, gst-plugins-good
mp3 gst-plugins-mad (i gst-plugins-ugly) plugin'et ffmpeg har problemer; brug det ikke til mp3
ogg gst-plugins-vorbis, gst-plugins-ogg
flac gst-plugins-flac
mp4 gst-plugins-faad, gst-plugins-bad
musepack gst-plugins-musepack
wma gst-plugins-ffmpeg

Skærmbilleder

Stemningslinjen i fremgangsskyderen i Amarok 2
Stemningslinjen i fremgangsskyderen i Amarok 2