Ptag 0.9.6 (2019-10-12)
updated to 0.7.
Support for adding artwork to ogg files. Neither vorbiscomment nor oggz-comment will directly add artwork, you need to convert the picture to base64 first. After searching google and thru quite a bit of trial and error, I was able to get it working. Easytag creates 3 fields when adding artwork to an ogg file:
COVERARTDESCRIPTION : the name of the jpg/png file
COVERARTMIME : the mime type of the image file
COVERART : the base64 encoded data of the image file
After reading up on this at:
http://wiki.xiph.org/VorbisComment#Unof ... recated.29
I found that the COVERART field is deprecated and METADATA_BLOCK_PICTURE is to be used instead. Ptag will convert an existing COVERART field to METADATA_BLOCK_PICTURE. The only down side is that if you use Easytag afterwards you won't see the attached image. I also wrote a script and named it <oggart> that will add artwork to an ogg file and allow you to use the old COVERART for Easytag compatibility or use the new way (default).
for Easytag compatibility:
the script:
ptag does not call this script but I thought it may be useful to someone.
Support for adding artwork to ogg files. Neither vorbiscomment nor oggz-comment will directly add artwork, you need to convert the picture to base64 first. After searching google and thru quite a bit of trial and error, I was able to get it working. Easytag creates 3 fields when adding artwork to an ogg file:
COVERARTDESCRIPTION : the name of the jpg/png file
COVERARTMIME : the mime type of the image file
COVERART : the base64 encoded data of the image file
After reading up on this at:
http://wiki.xiph.org/VorbisComment#Unof ... recated.29
I found that the COVERART field is deprecated and METADATA_BLOCK_PICTURE is to be used instead. Ptag will convert an existing COVERART field to METADATA_BLOCK_PICTURE. The only down side is that if you use Easytag afterwards you won't see the attached image. I also wrote a script and named it <oggart> that will add artwork to an ogg file and allow you to use the old COVERART for Easytag compatibility or use the new way (default).
Code: Select all
# oggart /path/to/file.ogg /path/to/jpg-or-png
Code: Select all
# oggart /path/to/file.ogg /path/to/jpg-or-png -e
Code: Select all
#!/bin/sh
FILE1="`basename \"$1\"`"
EXT1=${FILE1##*.}
EXTTYPE1=`echo $EXT1 | tr '[:upper:]' '[:lower:]'`
FILE2="`basename \"$2\"`"
EXT2=${FILE2##*.}
EXTTYPE2=`echo $EXT2 | tr '[:upper:]' '[:lower:]'`
OGG=""
if [ "$EXTTYPE1" = ogg ]; then
OGG="$1"
elif [ "$EXTTYPE2" = ogg ]; then
OGG="$2"
fi
if [ "$OGG" = "" ]; then
echo no ogg file selected
exit 0
fi
PIC=""
array=(jpeg jpg png)
for item in ${array[*]}
do
if [ "$item" = "$EXTTYPE1" ]; then
PIC="$1"
elif [ "$item" = "$EXTTYPE2" ]; then
PIC="$2"
fi
done
if [ "$PIC" = "" ]; then
echo no jpg or png file selected
exit 0
fi
if [ "$3" = -e ]; then
EASYTAG=Y
else
EASYTAG=N
fi
DESC=`basename "$PIC"`
APIC=`base64 --wrap=0 "$PIC"`
if [ "`which exiv2`" != "" ]; then
MIME=`exiv2 "$PIC" | grep 'MIME type ' | sed 's/: /|/' | cut -f 2 -d '|' | tail -n 1`
fi
if [ "$MIME" = "" ]; then
MIME="image/jpeg"
fi
vorbiscomment -l "$OGG" | grep -v '^COVERART=' | grep -v '^COVERARTDESCRIPTION=' | grep -v '^COVERARTMIME=' | grep -v 'METADATA_BLOCK_PICTURE=' > "$OGG".tags
if [ "$EASYTAG" = N ]; then
echo METADATA_BLOCK_PICTURE="$APIC" > "$OGG".tags2
else
echo COVERART="$APIC" > "$OGG".tags2
fi
vorbiscomment -w -R -c "$OGG".tags2 "$OGG"
vorbiscomment -a -R -t COVERARTDESCRIPTION="$DESC" "$OGG"
vorbiscomment -a -R -t COVERARTMIME="$MIME" "$OGG"
vorbiscomment -a -R -c "$OGG".tags "$OGG"
rm -f "$OGG".tags
rm -f "$OGG".tags2
- Attachments
-
- oggart.tar.gz
- (685 Bytes) Downloaded 995 times
Just wanted to thank ye for all the .pet work in the lossless audio space.. and CLI no less, which is where I prefer to operate. Buried in the flow, you might've not seen my little script shn2flac which I posted in the Lucid526 thread:
http://murga-linux.com/puppy/viewtopic. ... 705#549705
.. terribly simplistic but didn't know of any such script out there, and I have occasion to make the conversion often.
Going forward, I'd be interested to see how you could fare going about linking all the metadata tagging into & out of .k3b files.. the only way I burn on Linux! Also, you might strive for an equivalent or better of TLH... very common across the net amongst window$ types who are trading lossless.. stands for Traders' Little Helper and combines various functions.
http://murga-linux.com/puppy/viewtopic. ... 705#549705
.. terribly simplistic but didn't know of any such script out there, and I have occasion to make the conversion often.
Going forward, I'd be interested to see how you could fare going about linking all the metadata tagging into & out of .k3b files.. the only way I burn on Linux! Also, you might strive for an equivalent or better of TLH... very common across the net amongst window$ types who are trading lossless.. stands for Traders' Little Helper and combines various functions.
Last edited by str4y on Thu 15 Sep 2011, 00:01, edited 1 time in total.
[size=75]laptop.pet: [url]http://www.murga-linux.com/puppy/viewtopic.php?p=550279[/url]
K3B-1.0.5 self-contained .pet [url]http://www.murga-linux.com/puppy/viewtopic.php?t=71862[/url]
:oops: bitcoin: [url]http://xmail.net/str4y/bitcoin/[/url][/size]
K3B-1.0.5 self-contained .pet [url]http://www.murga-linux.com/puppy/viewtopic.php?t=71862[/url]
:oops: bitcoin: [url]http://xmail.net/str4y/bitcoin/[/url][/size]
Plinej, thanks for all the work you're doing with Ptag.
I tried Ptag several versions ago but couldn't find the time to write this until now.
I needed to add the file number, author and book name to the tag of every mp3 file of an audio book, so I could see what book I was listening to in my mp3 player. Ptag did this exactly as advertised, but required me to click the Enter key for every file. The average audio book has probably 200 mp3 files, so it takes 200 clicks of the Enter key to edit the tags of every file in the book. Is there a way, that I missed, to have Ptag automatically change all the files in a directory? Sort of a batch tag edit? Just show it file number 001 - 200 or whatever, tell it what to put in the tag fields, click go and it would go until it had done all 200 (or whatever) files in the directory.
Some books by Brilliance audio have over 900 files because Brilliance puts 99 tracks on each CD (the legal limit,) but all other audio books have a more reasonable 20 tracks per CD, so audio books with more than 400 files are rare.

I tried Ptag several versions ago but couldn't find the time to write this until now.
I needed to add the file number, author and book name to the tag of every mp3 file of an audio book, so I could see what book I was listening to in my mp3 player. Ptag did this exactly as advertised, but required me to click the Enter key for every file. The average audio book has probably 200 mp3 files, so it takes 200 clicks of the Enter key to edit the tags of every file in the book. Is there a way, that I missed, to have Ptag automatically change all the files in a directory? Sort of a batch tag edit? Just show it file number 001 - 200 or whatever, tell it what to put in the tag fields, click go and it would go until it had done all 200 (or whatever) files in the directory.
Some books by Brilliance audio have over 900 files because Brilliance puts 99 tracks on each CD (the legal limit,) but all other audio books have a more reasonable 20 tracks per CD, so audio books with more than 400 files are rare.
Flash, I don't think I want to add that capability to the gui but I made a simple script that will do what you're requesting using ptag's cli options. First of all, you need to open the first audio file in ptag and tag the file with whatever you'd like. Then open the file again and click the "dump" button which will create a .ptag file in the same directory, or from the cli you can type: <ptag NAMEOFAUDIOFILE -ptag>. For the next step you'll need to extract the attached script and put it in your $PATH. Go to the command line, cd into the directory your ptag and audio files are, and type:
Of course NAMEOFPTAGFILE needs to be the actual name of the file. This will tag all the same type of audio files with the fields in the ptag file.
Tracknumber field will be increased by one for each file.
You need to have at least version 0.8.1 of ptag for this script to work.
Code: Select all
tagdir NAMEOFPTAGFILE.ptag
Tracknumber field will be increased by one for each file.
You need to have at least version 0.8.1 of ptag for this script to work.
- Attachments
-
- tagdir.tar.gz
- (525 Bytes) Downloaded 452 times
updated to 0.8.2
Just a small bug fix.
I also created some audio conversion scripts to use with ptag which will convert and retain the tags.
http://www.murga-linux.com/puppy/viewtopic.php?t=70882
Just a small bug fix.
I also created some audio conversion scripts to use with ptag which will convert and retain the tags.
http://www.murga-linux.com/puppy/viewtopic.php?t=70882
updated to 0.9
cleaned up the code and internationalized with an English mo file.
cleaned up the code and internationalized with an English mo file.
Code: Select all
#English
L0="you must install"
L1=Title
L2=Artist
L3=Performer
L4=Album
L5=Track
L6=Total
L7=Disc
L8="Disc ID"
L9=Date
L10=Genre
L11=Comment
L12=Composer
L13=Lyricist
L14=Publisher
L15=Copyright
L16="Add replay gain to tag?"
L17="select ptag to tag file with"
L18="Select ptag"
L19="Extra Tagging Fields"
L20=Field
L21=Tag
L22="extract tags to file"
L23=dump
L24=info
L25="Kill this program and do not update this file, or any other files"
L26=Kill
L27="Do not update this file, will skip to the next file if one was given"
L28="Exit/Skip"
L29="Update the tags for this file"
L30="does not exist"
L31=tagged
L32="added replay gain to"
L33="Are you sure you want to delete the artwork?"
L34=No
L35=Yes
L36="Alphanumeric entries"
L37="Encoding Tool"
L38=Grouping
L39=Description
L40=Category
L41=Keyword
L42="Purchase Date"
L43="TV Network"
L44="TV Show Name"
L45="TV Episode"
L46="Album Artist"
L47="Select Artwork to add jpg/png"
L48="Select artwork"
L49=remove
L50=extract
L51=view
L52="Numeric entries"
L53=Year
L54="Tempo/BPM"
L55="Gapless playback"
L56="TV Season Number"
L57="TV Episode Number"
L58="true/false entries"
L59=Compilation
L60="Podcast flag"
L61="Choice entries"
L62=Advisory
L63=Stik
L64="URL entries"
L65="Podcast URL"
L66="Podcast GUID"
L67="keep tags"
L68="remove tags"
L69="view/add lyrics"
L70=help
L71=Extra
L72="view extra tags not in gui"
L73="Extra iTunes tags"
L74=Exit
L75=OK
L76="File info"
L77="Artwork options"
L78="Attached Artwork"
L79="Extra Tagging Fields"
L80=either
L81="Cover Art Description"
L82="Cover Art Mime"
L83="Select your directory or single file"
L84="Select a directory"
L85="or select a single file"
L86="Select an Existing File"
L87="Copy tag from one file to the next?"
L88="Check for yes"
L89=QUIT
I made this one, help from Google, but lots of changes from me - so it could be really bad
(Sorry)

Code: Select all
# German
L0="Sie installieren müssen"
L1=Titel
L2=Musiker
L3=Künstler
L4=Album
L5=Musikspur
L6=Total
L7=Disc
L8="Disc-ID"
L9=Datum
L10=Genre
L11=Kommentar
L12=Komponist
L13=Lyricist
L14=Verleger
L15=Copyright
L16="Add Replay Gain zu Tag?"
L17="select Ptag eine Datei mit dem Stichwort"
L18="Wählen Sie Ptag"
L19="Extra Tagging Fields"
L20=Eintrag
L21=Audio-Tag
L22="Extrahieren von Audio-tag in die Datei"
L23=Dump
L24=info
L25="Kill diesem Programm und nicht aktualisieren Sie diese Datei, oder beliebige andere Dateien"
L26=Tötet
L27="Nicht aktualisieren Sie diese Datei, wird die nächste Datei zu überspringen, wenn man bekam"
L28="Abbrechen / Weiter"
L29="Update der tags for this file"
L30="existiert nicht"
L31=getaggt
L32="Replay Gain hinzugefügt"
L33="Sind Sie sicher, dass Sie das Kunstwerk wirklich löschen?"
L34=Nein
L35=Ja
L36="Alphanumerische Eingaben"
L37="Encoding-Hilfswerkzeug"
L38=Gruppierung
L39=Beschreibung
L40=Kategorie
L41=Stichwort
L42="Purchase Date"
L43="TV Network"
L44="TV Show Name"
L45="TV Episode"
L46="Album-Interpret"
L47="Wählen Artwork auf jpg / png add"
L48="Wählen Kunstwerk"
L49=entfernen
L50=extrakt
L51=sehen
L52="Numerische Eingaben"
L53=Jahr
L54="Tempo / BPM"
L55="Lückenlose Wiedergabe"
L56="TV Saison Nummer"
L57="TV Serial Nummer"
L58="wahr / falsch Einträge"
L59=Kompilation
L60="Podcast flag"
L61="Choice Einträge"
L62=Advisory
L63=Stik
L64="URL-Einträge"
L65="Podcast-URL"
L66="Podcast GUID"
L67="halten Sie Audio-Tags"
L68="löschen Audio-Tags"
L69="sehen / anfügen Texte"
L70=hilfe
L71=Extra
L72="view zusätzlichen Tags nicht in gui"
L73="Extra iTunes tags"
L74=Exit
L75=OK
L76="Datei-Info"
L77="Artwork-Optionen"
L78="Attached Artwork"
L79="Extra Tagging Fields"
L80=entweder
L81="Cover Art Beschreibung"
L82="Cover Art Mime"
L83="Wählen Sie Ihr Verzeichnis oder einzelne Datei"
L84="Wählen Sie ein Verzeichnis"
L85="oder wählen Sie eine einzelne Datei"
L86="Wählen Sie eine bestehende Datei"
L87="Copy-Tag von einer Datei zur nächsten?"
L88="für ja Check"
L89=QUIT
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
.k3b files
Hey plinej, thanks for the great updatings.. I've been way distracted and just got back to this thread.plinej wrote:What do the .k3b files consist of?
.ape and .shn -- nice!
The .k3b files are just a .zip with two files, maindata.xml and mimetype ..
here's a audio CD example-- I'll attach a data one shortly..
- Attachments
-
- disc 1of3 - 31 August 1981 - Aladdin Hotel, Las Vegas GRATEFUL DEAD.k3b.zip
- sample .k3b file created by k3b 1.0.5 for an audio CD
(Forum choked on a .k3b extension-- note that I added the .zip to make it uplodable) - (902 Bytes) Downloaded 409 times
[size=75]laptop.pet: [url]http://www.murga-linux.com/puppy/viewtopic.php?p=550279[/url]
K3B-1.0.5 self-contained .pet [url]http://www.murga-linux.com/puppy/viewtopic.php?t=71862[/url]
:oops: bitcoin: [url]http://xmail.net/str4y/bitcoin/[/url][/size]
K3B-1.0.5 self-contained .pet [url]http://www.murga-linux.com/puppy/viewtopic.php?t=71862[/url]
:oops: bitcoin: [url]http://xmail.net/str4y/bitcoin/[/url][/size]
Is there a rational, authoritative description of audio file tagging metadata on the internet somewhere, or is it all ad-hoc and impossible to explain? If there is a good explanation, the people who specify the user interface of mp3 players should read it and all get on the same page.
I've used at least 5 different brands and models of mp3 player to listen to audio books. (I convert the standard audio CDs to mp3 so the whole book will fit on a cheap mp3 player.) No two mp3 players seem to display metadata the same way. Some display this part of the file tag, some display that part, one displays it one way, one displays it another. Not one of them offers the option to just display the damn file name the way I want it to.
I've used at least 5 different brands and models of mp3 player to listen to audio books. (I convert the standard audio CDs to mp3 so the whole book will fit on a cheap mp3 player.) No two mp3 players seem to display metadata the same way. Some display this part of the file tag, some display that part, one displays it one way, one displays it another. Not one of them offers the option to just display the damn file name the way I want it to.
