Audacity not preserving all EXIF data (metadata)

Feedback and Reviews for Audacity 2.x
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.

If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
cjsmall
Posts: 8
Joined: Mon Mar 22, 2021 12:02 am
Operating System: Linux *buntu

Audacity not preserving all EXIF data (metadata)

Post by cjsmall » Sun May 09, 2021 7:02 pm

I have discovered that when editing an existing MP3 file and then exporting it, the EXIF Album Artist and Composer are not being preserved. preserved. The Title, Track, Artist, Genre and Year do get transferred forward.

It would be great if the entire EXIF record, other than things like duration or other altered fields, would be maintained.

Regards.

jademan
Forum Crew
Posts: 1279
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Audacity not preserving all EXIF data

Post by jademan » Mon May 10, 2021 6:41 pm

Thanks for this report. Help me out. Is EXIF used for MP3 files or for photo files?

cjsmall
Posts: 8
Joined: Mon Mar 22, 2021 12:02 am
Operating System: Linux *buntu

Re: Audacity not preserving all EXIF data

Post by cjsmall » Mon May 10, 2021 11:28 pm

I probably should have said "metadata" rather than EXIF data. I tend to use the terms interchangeably.

I use the Clementine music player on Linux and it displays/writes these fields. After an Audacity editing session where I overwrite the original file, these fields are missing.

I use a very comprehensive program called exiftool to manage metadata for pictures/video/audio files. Here is a link to the software site. It has some very detailed documentation of file formats and on metadata fields that are divided into all sorts of categories.

https://exiftool.org/

Not that all of this is relevant, but here is a listing of metadata that exiftool spits out for a typical MP3 audio file:

Code: Select all

---- ExifTool ----
ExifTool Version Number         : 11.88
---- Other ----
File Name   : 07_Dance.mp3
Directory   : .
File Size   : 3.9 MB
File Permissions                : rw-r--r--
File Type   : MP3
File Type Extension             : mp3
MIME Type   : audio/mpeg
---- Time ----
File Modification Date/Time     : 2021:05:07 14:44:59-07:00
File Access Date/Time           : 2021:05:10 16:21:05-07:00
File Inode Change Date/Time     : 2021:05:07 14:44:59-07:00
Recording Time                  : 2005
Year        : 2005
Date/Time Original              : 2005
---- Audio ----
MPEG Audio Version              : 1
Audio Layer : 3
Bitrate     : 320 kbps
Sample Rate : 48000
Channel Mode: Stereo
MS Stereo   : Off
Intensity Stereo                : Off
Copyright Flag                  : False
Original Media                  : False
Emphasis    : None
Encoder Settings                : Lavf56.40.101
Title       : For The First Time:  7. Dance
Album       : Howard Hanson Conducts Howard Hanson
Genre       : Classical
Comment (xxx)                   : Eastman-Rochester Orchestra; Howard Hanson Conductor
Track       : 7
Popularimeter                   :  Rating=255 Count=0
Part Of Set :
Beats Per Minute                :
Composer    : Hanson, Howard
Grouping    :
Lyrics (xxx):
Band        : Hanson, Howard
Compilation : Unknown ()
User Defined Text               : (FMPS_Rating) 1.1
Comment     : Eastman-Rochester Orchestra;
---- Image ----
ID3 Size    : 111792
Picture MIME Type               : image/jpeg
Picture Type: Front Cover
Picture Description             : Album cover
---- Preview ----
Picture     : (Binary data 110173 bytes, use -b option to extract)
---- Author ----
Artist      : Hanson, Howard
Original Artist                 : Eastman-Rochester Orchestra; Howard Hanson Conductor
---- Video ----
Duration    : 0:01:39 (approx)
Rating      : 5
It would be good to preserve as much of the metadata as possible, other than things that change such a bit rate, duration, etc.

Does this answer the question?

jademan
Forum Crew
Posts: 1279
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: Audacity not preserving all EXIF data

Post by jademan » Wed May 12, 2021 12:23 am

cjsmall wrote:
Sun May 09, 2021 7:02 pm
I have discovered that when editing an existing MP3 file and then exporting it, the <metadata> Album Artist and Composer are not being preserved. preserved. The Title, Track, Artist, Genre and Year do get transferred forward.
OK, I cleared the default Metadata, then did Generate > DTMF Tones.., then Edited the Metadata Tags. I added Track Title, Track Number, Artist Name, Genre and Year, as you indicated. I also added Album Artist and Composer. Since those fields did not exist, I "Add"ed the Tags, and then the Values. I exported the tones as an MP3 file, and exited Audacity.

When I restarted Audacity, I imported the MP3 file and displayed the Metadata:
Fullscreen004.png
Fullscreen004.png (11.61 KiB) Viewed 271 times
As you can see, all 7 fields that you mentioned are present.

cjsmall
Posts: 8
Joined: Mon Mar 22, 2021 12:02 am
Operating System: Linux *buntu

Re: Audacity not preserving all EXIF data

Post by cjsmall » Sat May 22, 2021 2:38 am

OK, here is my result which is completely consistent using Audacity 2.3.3 on Xubuntu 20.04.

I copy a music file to a test directory and list the metadata using the external exiftool. Here is the actual command:

Code: Select all

exiftool -m -f -Artist -Band -Album -Title -Track -Year -Genre -Composer -Duration -AudioBitrate "02_Lean_On_Me2.mp3" | sed -e 's/<space><tab>//' | sed -e 's/Audio Bitrate */Bitrate     /'
[/b]

The initial output:

Code: Select all

Artist      : Withers, Bill
Band        : Withers, Bill
Album       : Lean on Me: The Best of Bill Withers
Title       : Lean On Me
Track       : 2
Year        : 1994
Genre       : Soul
Composer    : Withers, Bill
Duration    : 0:04:18 (approx)
Bitrate     : 241 kbps
Rating      : 4
I fire up Audacity and load the mp3 file. I do nothing except export it back out to another filename. This does change the bitrate.

Here is the metadata of the new file:

Code: Select all

Artist      : Withers, Bill
Band        : -
Album       : Lean on Me: The Best of Bill Withers
Title       : Lean On Me
Track       : -
Year        : -
Genre       : Soul
Composer    : -
Duration    : 0:04:18 (approx)
Bitrate     : 206 kbps
Band is apparently what Clementine is calling "Album Artist." We're missing Band, Track, Year, Composer and Rating.

However, just as you did, I loaded the saved file back into a new Audacity session and the metadata tags are indeed there.

Image won't load for me. Here is a link.

http://smallthoughts.com/photos/misc/audacity_01.png

At this point I cannot explain what is happening other than to guess that Audacity is actually writing out the metadata in a format it can recognize, but which external programs cannot.

Any ideas? I'll send the modified file to the author of exiftool and see if he has any insights.

cjsmall
Posts: 8
Joined: Mon Mar 22, 2021 12:02 am
Operating System: Linux *buntu

Re: Audacity not preserving all EXIF data

Post by cjsmall » Mon May 31, 2021 10:18 pm

There has been a discussion on the exiftool forum regarding this problem. So far, the consensus seems to be that this is an audacity problem. I've been using version 2.3.3, which is the latest in the Ubuntu repository. Someone there reported that they are using version 3.02 and that the metadata problems are different in that version but still exist. Anyone who is looking into this might want to read and contribute to that discussion at:

https://exiftool.org/forum/index.php?topic=12527.0

cjsmall
Posts: 8
Joined: Mon Mar 22, 2021 12:02 am
Operating System: Linux *buntu

Re: Audacity not preserving all EXIF data

Post by cjsmall » Mon May 31, 2021 10:23 pm

By the way, I'll take a look at the source in a bit, but what library is being used to read/write the metadata in Audacity? Is there any internal manipulation being done? I'm still trying to figure out how the data is being corrupted such that exiftool cannot read it, but Audacity can re-import it later.

waxcylinder
Forum Staff
Posts: 14663
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Audacity not preserving all EXIF data (metadata)

Post by waxcylinder » Tue Jun 01, 2021 8:31 am

Metadata support is known to be patchy in Audacity.

1) there are several metadata bugs listed in our Bugzilla bugtracker:
https://bugzilla.audacityteam.org/bugli ... t_id=28314

2) we also have a discussion proposal in our WiKi: https://wiki.audacityteam.org/wiki/Prop ... ta_Options

Part of the problem is there is no universal standard for all metadata fields, Audacity does handle consistently the fields that are there by default in the metadata editor - but for additional fields (like the two you mention) are not always handled properly/consistently - for example album art and lyrics are just discarded.

I will try to find some time to do some testing and if this looks like a new bug then we'll get it logged.

I will also flag a general issue about metadata in our GitHub Isssues.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14663
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Audacity not preserving all EXIF data (metadata)

Post by waxcylinder » Tue Jun 01, 2021 8:48 am

waxcylinder wrote:
Tue Jun 01, 2021 8:31 am
I will also flag a general issue about metadata in our GitHub Isssues.
Done:
Improved metadata handling in Auacity #947
https://github.com/audacity/audacity/discussions/947

Peter
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14663
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Audacity not preserving all EXIF data (metadata)

Post by waxcylinder » Tue Jun 01, 2021 1:29 pm

OK so testing with 3.0.2 on W10

A) I confirm that the "custom" metadata fields "Composer" and "Album artist" do not appera to get exported with the MP3
I exported an MP3 with these fields added and filled
Observe: Windows Explorer showns bo sign of these data

I imported the MP3 into iTunes:
Observe: no sign of these data in the Song Info dialog

I supect that these are just not being mapped by Audacity - and I further suspect that it is the same for all cutom fields.
I haven't expreimented with setting a metadata template in Audacity.

I supect that this is an enhabcement request for adding "Composer" and "Album artist" to the default set of metadata in Audacity.

--------------------------------------------------------------------------------------------------------------------------------

B) But now here's a fascinating use case

1) record some audio
2) Export as MP3
3) complete data in all the defauly=t fields
4) OK - to make the export
5) Examine the file with Windows Explorer
6) Observe: all data there present and correct
7) Import the file into iTunes
8) right click the song and choose "Song Info"
9) Observe: all data there present and correct
now
10) close audacity and relaunch
11) import the MP3 file
12) Export as MP3
13) Observe: Artist name, year and comments are missing in the metadata dialog on export.

This though looks like a pukka bug to me.

Can others please retest and see if we agree that it is a bug that should be logged.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

Post Reply