[opensuse] Generating play lists
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing. <https://eyed3.readthedocs.io/en/latest/> What else can I use? - -- Cheers Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXUs1VRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV/uAAnjYfrp3KiXZfft5p/IH7 pLV3D4M5AJ9AjFXJiLKO9f1TQQ3SmlrrbvHK8Q== =cXSQ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/08/2019 21:32, Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
Your own imagination ?
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/08/2019 22:32, Carlos E. R. wrote:
Hi,
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
Maybe try Kid3? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2019-08-08 at 09:27 +0200, gumb wrote:
On 07/08/2019 22:32, Carlos E. R. wrote:
Hi,
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
Maybe try Kid3?
Ah. Maybe. Installing. (A search for "playlist" in YaST found a bunch of libraries and plugins, but I could not see a program to generate them) Mmm, at starts, kid3 reports a bug: there are two actions (Replace, Reload) that want to use the same shortcut (Ctrl+R). It does so many things that it is complex to use. I then try the cli version, but it is not a command line, but instead enters a "session" in text mode. I have this structure in the usb stick: 2015-11 Jazz Classic Piano ... If I start kid3-cli in the root of the stick, I can not get it to list the directory structure: cer@Telcontar:/media/EMTEC C410> kid3-cli kid3-cli> ls 2015-11 kid3-cli> ls 2015-11 2015-11 kid3-cli> ls 2015-11/ 2015-11 kid3-cli> pwd /media/EMTEC C410 kid3-cli> It does not see the contents of the directory. The KDE GUI version fails to load the help file, says it does not exist, but this happens to all KDE programs, no surprise. Had this problem for decades :-/ Trying, from an example in man page: cer@Telcontar:/media/EMTEC C410> time kid3-cli -c "timeout off" -c autoimport -c playlist 2015-11/Café\ de\ Paris/*aac Problem: it writes the file to the last directory, the directory where the aac files are. Of course, I want them at the root of the USB stick, where my car audio system looks for it. Googling for "kid3-cli examples" finds me <https://kid3.sourceforge.io/kid3_en.html#kid3-cli-examples>, which are the same as in the manual, and thus far from sufficient. Some discouraging info: <https://kid3.sourceforge.io/kid3_en.html#create-playlist> +++....................... The location of the generated playlist is determined by the selection of the Create in combo box. Current directory The playlist is created in the current directory and contains only files of the current directory. The current directory is the directory where the current file is located. If multiple files are selected, the current file is probably the last selected file. Every directory A playlist is created in every directory which contains listed files, and each playlist contains the files of that directory. Top-level directory Only one playlist is created in the top-level directory (i.e. the directory of the file list) and it contains the listed files of the top-level directory and all of its sub-directories. .......................++- Clear as mud. It appears I can not tell it the specific directory to create the list in, with filenames relative to it :-/ Googling again. "how to create playlists in linux" Finds this at <https://itsfoss.com/create-m3u-playlist-linux/>: ls -1v |grep .mkv > /tmp/1.m3u && mv /tmp/1.m3u . Just that? This is wonderful. Of course, tag info is missing, I thought that was mandatory in the list format. I only have to script a bit to produce a combined list. Just wonderful! - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXUwS5hwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVJvwAnihtSgrEYtJSlRtU+fNL nl6uRJ55AJ47tArgI7Y+74ZE5e/7PhSD1om4cA== =EaP6 -----END PGP SIGNATURE-----
Hello, On Wed, 07 Aug 2019, Carlos E. R. wrote:
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
find ... -printf '%p\n' > foo.m3u HTH, -dnh -- How should I know if it works? That's what beta testers are for. I only coded it. -- Attributed to Linus Torvalds, somewhere in a posting -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2019-08-08 at 09:27 +0200, David Haller wrote:
Hello,
On Wed, 07 Aug 2019, Carlos E. R. wrote:
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
find ... -printf '%p\n' > foo.m3u
Perfect! :-) find 2015-11/Piano/* -iname *.aac -type f -printf '%p\n' I had no idea it was that easy. The lists I had all have two lines per file: #EXTINF:486,02/ - Mauro Giuliani - Mostly Classical - 12 Landler for Flute and Guitar Classical\0001 -- Mauro Giuliani - 12 Landler for Flute and Guitar.mp3 Although... I think I have to search and replace all "/" with "\". - -- Cheers, Carlos E. R. (from openSUSE 15.0 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXUwVBhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV05YAnRKf6bn7XBwvg2TBmhST XOaNAfTNAJ9tnm3n8Zno51aQX68Qh16aUTYGHA== =HiuY -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Thu, 08 Aug 2019, Carlos E. R. wrote:
On Thursday, 2019-08-08 at 09:27 +0200, David Haller wrote:
On Wed, 07 Aug 2019, Carlos E. R. wrote:
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
find ... -printf '%p\n' > foo.m3u
Perfect! :-)
find 2015-11/Piano/* -iname *.aac -type f -printf '%p\n'
I had no idea it was that easy. The lists I had all have two lines per file:
#EXTINF:486,02/ - Mauro Giuliani - Mostly Classical - 12 Landler for Flute and Guitar Classical\0001 -- Mauro Giuliani - 12 Landler for Flute and Guitar.mp3
Jep. The "extended info" may or may not be there and may or may not be used by the player (software). You could add that by piping the filenames into a script running mediainfo --Inform=... See mediainfo --Info-Parameters. You might want to start with: ==== find2m3u.sh ==== #!/bin/bash EXTINF='%Duration/String3%/ %Genre% - %Album/Performer% - %Album% - %Title% -- %Codec%/%BitRate/String%' # you could use e.g. %FolderName%\%FileName%.%FileExtension% too do_info() { f="$1" # mediainfo --Inform="General;#EXTINF:${EXTINF}\n%CompleteName%" "$f" mediainfo --Inform="General;#EXTINF:${EXTINF}" "$f" # [ do something to $f ] printf '%s\n' "$f" } for file; do do_info "$file" done while read -r file; do do_info "$file" done ==== find ... | find2m3u.sh For more control, I recommend using a perl-script with 'use File::Find;' and 'use MediaInfo;' (from package perl-Mediainfo). The File::Find module gives you very fine grained control over how to find files (start with 'find2perl'!) and Mediainfo gives you easy access to the metainfo that Mediainfo can read. See 'man 3pm Mediainfo'. Alternatively, you could use Exiftool instead of Mediainfo. See 'man Image::ExifTool'.
Although... I think I have to search and replace all "/" with "\".
$ find ... | tr '/' '\\' > foo.m3u HTH, -dnh --
I hate black text on a white background on CRTs. Too damned bright. You're right. Black text on a black background is so much more restful. -- J. Bowden and Tanuki
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/08/2019 18.05, David Haller wrote:
Hello,
On Thu, 08 Aug 2019, Carlos E. R. wrote:
On Thursday, 2019-08-08 at 09:27 +0200, David Haller wrote:
On Wed, 07 Aug 2019, Carlos E. R. wrote:
The last time I needed to generate a play list for an USB stick of mp3 files I used eyeD3. That package is now missing.
<https://eyed3.readthedocs.io/en/latest/>
What else can I use?
find ... -printf '%p\n' > foo.m3u
Perfect! :-)
find 2015-11/Piano/* -iname *.aac -type f -printf '%p\n'
I had no idea it was that easy. The lists I had all have two lines per file:
#EXTINF:486,02/ - Mauro Giuliani - Mostly Classical - 12 Landler for Flute and Guitar Classical\0001 -- Mauro Giuliani - 12 Landler for Flute and Guitar.mp3
Jep. The "extended info" may or may not be there and may or may not be used by the player (software). You could add that by piping the filenames into a script running mediainfo --Inform=... See mediainfo --Info-Parameters.
You might want to start with:
==== find2m3u.sh ==== #!/bin/bash EXTINF='%Duration/String3%/ %Genre% - %Album/Performer% - %Album% - %Title% -- %Codec%/%BitRate/String%'
# you could use e.g. %FolderName%\%FileName%.%FileExtension% too do_info() { f="$1" # mediainfo --Inform="General;#EXTINF:${EXTINF}\n%CompleteName%" "$f" mediainfo --Inform="General;#EXTINF:${EXTINF}" "$f" # [ do something to $f ] printf '%s\n' "$f" } for file; do do_info "$file" done while read -r file; do do_info "$file" done ====
find ... | find2m3u.sh
Ah. Interesting!
For more control, I recommend using a perl-script with 'use File::Find;' and 'use MediaInfo;' (from package perl-Mediainfo). The File::Find module gives you very fine grained control over how to find files (start with 'find2perl'!) and Mediainfo gives you easy access to the metainfo that Mediainfo can read. See 'man 3pm Mediainfo'.
I would have to learn perl first
Alternatively, you could use Exiftool instead of Mediainfo. See 'man Image::ExifTool'.
Although... I think I have to search and replace all "/" with "\".
$ find ... | tr '/' '\\' > foo.m3u
I used the editor :-) In fact, what I do is that, having a directory per genre, I generate the play list taking one file from each directory in rotation. I wrote a script for that, and having a single line source play list (per directory) makes things easier. #!/bin/bash declare -a ENTRADAS_1 SALIDATMP=/tmp/2015-11.m3u SALIDA=2015-11.m3u COUNT=1 while read FILES ; do ENTRADAS_1[$COUNT]="$FILES" COUNT=`expr $COUNT + 1` done < Genre_1.m3u COUNT_1=$COUNT echo ${ENTRADAS_1[1]} COUNT=`expr $COUNT - 1` echo ${ENTRADAS_1[$COUNT]} COUNT=1 while read FILES ; do ENTRADAS_2[$COUNT]="$FILES" COUNT=`expr $COUNT + 1` done < Genre_1.m3u COUNT_2=$COUNT echo ${ENTRADAS_2[1]} COUNT=`expr $COUNT - 1` echo ${ENTRADAS_2[$COUNT]} ... # 11 genres echo "read" echo > $SALIDATMP for((i=1; i<=2000;i++)) do if [ $i -le $COUNT_1 ]; then echo ${ENTRADAS_1[$i]} >> $SALIDATMP fi if [ $i -le $COUNT_2 ]; then echo ${ENTRADAS_2[$i]} >> $SALIDATMP fi ... if [ $i -le $COUNT_10 ]; then echo ${ENTRADAS_10[$i]} >> $SALIDATMP fi done echo "coyping to stick" cp $SALIDATMP $SALIDA (sure, functions would be appropriate, but I did not bother for a one_shot) Generating or handling the information line is a complication I do not like. If my car needs it, I will go back to the chair and do something about it, using your samples, so thanks :-) Mmm... Not that complicated, though. As I write each line, first obtain its info line and print it :-) -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)
participants (4)
-
Carlos E. R.
-
David Haller
-
gumb
-
michael norman