Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: script to copy a cd then metaflac to import cover - make a error (Read 1835 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

script to copy a cd then metaflac to import cover - make a error

Hello
use a Laptop with linux debian

with abcd -0 flac i copy a MusicCD to ~/Musik/rip-CD/ there it make the subdirectory of artist and album name so far OK

in the ~/Musik/rip-CD/
i add a cover.jpg file

find ~/Musik/rip-CD/ -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="3|~/Musik/rip-CD/cover.jpg"

and now i got a
ERROR: while parsing picture specification "3|~/Musik/rip-CD/cover.jpg": invalid picture specification

so the question what did i wrong?

have a nice day
vinc

Re: script to copy a cd then metaflac to import cover - make a error

Reply #1
Instead of using find, what about a for loop?

Code: [Select]
for i in *.flac; do metaflac --import-picture-from=cover.jpg "$i"; done

Re: script to copy a cd then metaflac to import cover - make a error

Reply #2
find ~/Musik/rip-CD/ -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="3|~/Musik/rip-CD/cover.jpg"

and now i got a
ERROR: while parsing picture specification "3|~/Musik/rip-CD/cover.jpg": invalid picture specification

so the question what did i wrong?

Quote
The format of SPECIFICATION is
[TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE

Code: [Select]
find ~/Musik/rip-CD/ -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="3||||~/Musik/rip-CD/cover.jpg"
Should work

Re: script to copy a cd then metaflac to import cover - make a error

Reply #3
Instead of using find, what about a for loop?

Code: [Select]
for i in *.flac; do metaflac --import-picture-from=cover.jpg "$i"; done
i think would not work because i don't know where the flac are, which subdirectory!

Re: script to copy a cd then metaflac to import cover - make a error

Reply #4
Code: [Select]
find ~/Musik/rip-CD/ -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="3||||~/Musik/rip-CD/cover.jpg"
Should work

should work, but no, i got still a error!

/Musik/rip-CD/Die_Prinzen/Alles_nur_geklaut/08.Mein_Portemonnaie.flac: ERROR: while parsing picture specification "3||||~/Musik/rip-CD/cover.jpg": error opening picture file

Re: script to copy a cd then metaflac to import cover - make a error

Reply #5
Code: [Select]
find ~/Musik/rip-CD/ -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="3||||~/Musik/rip-CD/cover.jpg"
Should work

should work, but no, i got still a error!

/Musik/rip-CD/Die_Prinzen/Alles_nur_geklaut/08.Mein_Portemonnaie.flac: ERROR: while parsing picture specification "3||||~/Musik/rip-CD/cover.jpg": error opening picture file

The problem now is with the ~. Isn't it just a shell construct?
Run the metaflac command through a shell or use the full path e.g. /home/name/Musik/rip-CD/cover.jpg

Re: script to copy a cd then metaflac to import cover - make a error

Reply #6
@SimBun
it works like that - with the full path. Thanks a lot for helping.
another question with the 3 what i do define exaclty?

have a nice day
vinc

Re: script to copy a cd then metaflac to import cover - make a error

Reply #7
another question with the 3 what i do define exaclty?
TYPE denotes the type of artwork you're embedding. 3 represents front cover and is the default, so if you're only embedding front covers you could use:
Code: [Select]
--import-picture-from="/home/name/Musik/rip-CD/cover.jpg"

Code: [Select]
[TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE

TYPE is optional; it is a number from one of:

0: Other
1: 32x32 pixels 'file icon' (PNG only)
2: Other file icon
3: Cover (front)
4: Cover (back)
5: Leaflet page
6: Media (e.g. label side of CD)
7: Lead artist/lead performer/soloist
8: Artist/performer
9: Conductor
10: Band/Orchestra
11: Composer
12: Lyricist/text writer
13: Recording Location
14: During recording
15: During performance
16: Movie/video screen capture
17: A bright coloured fish
18: Illustration
19: Band/artist logotype
20: Publisher/Studio logotype

The default is 3 (front cover).  There may only be one picture each of type 1 and 2 in a file.

 

Re: script to copy a cd then metaflac to import cover - make a error

Reply #8
Perfect thanks a lot!
have a nice day
vinc