complexlogic / EasyAudioSync

Audio library syncing and conversion utility
The Unlicense
12 stars 0 forks source link

EasyAudioSync is messing with tags when transcoding from .flac to .opus #4

Closed Tom4tot closed 7 months ago

Tom4tot commented 8 months ago

First of all, sorry in advance if I give you a headache, as tags in general are a complete mess and really complicated to deal with, since they are different depending on file types, and nobody agrees on how they should be used/written, etc.

Basically, I have noticed the following issues, when transcoding from .flac to .opus:

  1. semi-columns are ignored (which are used to display multiple artists/gernres, etc.; on MP3TAG, they are shown on different lines). Opusenc handles them properly, ffmpeg removes spaces after them, and EAS just removes them.
  2. some tags are not transferred, especially custom fields, but I don't think it should be the case, since tags are transferred properly with opusenc and ffmpeg.
  3. This is very minor, but it's struggling to transfer tags when one line is extremely song, i.e. these two songs don't get any of their metadata transferred: The American Way Of Love: Part I- Metaphor For An Olderman/Part II- California Good-Time Music/Part III- Love Is All; Ballad Medley: Bewitched, Bothered and Bewildered / I Don't Know Why I Just Do / How Long Has This Been Going On / I Can't Get Started / Polka Dots and Moonbeams. Changing the file's name to a shorter one doesn't make a difference.

However, I have to say you did a good job with:

  1. Artworks embedded: they are transferred properly, just like with opusenc (it is not the case with ffmpeg)
  2. ReplayGain: as a Foobar2000 user, I'm happy to use this option Convert ReplayGain tags to R128 format that seems to work well!

Do you think you could fix these two issues?

I am sharing some screenshots as well as the files, so you can have a better understanding. I found the audio file here: https://helpguide.sony.net/high-res/sample1/v1/en/index.html so I assume, I can post it here.

Screenshot  2571 Screenshot  2572 Screenshot  2573 Screenshot  2574 Screenshot  2575 Screenshot  2577 Screenshot  2578

Encoding tests.zip

Thank you in advance for your answer.

complexlogic commented 8 months ago

Number 1 has an easy fix. I hadn't considered the possibility of multiple genres, but I can change the list delimiter from space to semicolon.

Number 2 was actually by design. The program only checks for a set number of tags in the input file, basically this list minus a few such as ratings. It doesn't transfer custom tags, although I may consider adding support for this in the future.

For number 3, long paths can sometimes be an issue on Windows platform. My guess is that the metadata writer isn't successfully opening the file, although it should be raising an error if this occurs. If you can upload the file I might be able to reproduce. Also a debug log may be helpful. Go to Settings->General and set log level to debug. After the sync you can find the log in %USERPROFILE%\.easyaudiosync

Tom4tot commented 8 months ago

Thanks for your quick answer!

  1. It might slightly more complicated, since Foobar2000 chooses to display multiple entries with a semi column, but I'm not sure it actually looks like this in the file. See this command & result:
    
    C:\Users\Tom\Downloads\Encoding tests\opus-tools-0.2-opus-1.3>opusinfo "C:\Users\Tom\Downloads\Encoding tests\2-opusenc.opus"
    Processing file "C:\Users\Tom\Downloads\Encoding tests\2-opusenc.opus"...

New logical stream (#1, serial: 00007255): type opus Encoded with libopus 1.3, libopusenc 0.2.1 User comments section follows... ENCODER=opusenc from opus-tools 0.2-3-gf5f571b ENCODER_OPTIONS=--bitrate 96 ARTIST=Blue Monday FM TITLE=Bee Moved ALBUM=Bee Moved REMASTER=Test DATE=1992 GENRE=Test GENRE=Hip GENRE=Music COMPOSER=TEST PERFORMER=TEST ALBUMARTIST=Blue Monday FM ALBUMARTIST=test TRACKNUMBER=1 TRACKTOTAL=1 DISCNUMBER=1 DISCTOTAL=1 COMMENT=Test 2 STARRED=1 MRAT=0 R128_TRACK_GAIN=0 METADATA_BLOCK_PICTURE=3|image/jpeg|image/jpeg|500x500x24|<58336 bytes of image data> Opus stream 1: Pre-skip: 312 Playback gain: -14.1289 dB Channels: 2 Original sample rate: 96000 Hz Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min) Page duration: 1000.0ms (max), 997.5ms (avg), 900.0ms (min) Total data length: 591885 bytes (overhead: 14.1%) Playback length: 0m:39.875s Average bitrate: 118.7 kbit/s, w/o overhead: 102 kbit/s Logical stream 1 ended



2. Yes, now that you say it, I remember reading it [here](https://github.com/complexlogic/EasyAudioSync/blob/master/docs/settings.md). Well, I guess you can see it as a feature request then! 

3. Here is the file: https://send.vis.ee/download/89f52d012972ceaa/#HP74Xs1d29FuQnLAmdCr2Q
It does seem like it's a problem with the file name and not its metadata. However, EAS kept the "broken" file in my destination folder despite syncing it again, after fixing the file name. So something wrong is going on.
And here is the log: 
[easyaudiosync.log](https://github.com/complexlogic/EasyAudioSync/files/13924923/easyaudiosync.log)

EDIT: missclick, sorry
complexlogic commented 7 months ago

You are correct about 1. There should be multiple entries in the file, they are not encoded with a semicolon; that's just how some programs choose to display it. I implemented this via https://github.com/complexlogic/EasyAudioSync/commit/0775ad629a47acdcd0ecd51d0a51ca5e8044f33c. You can use the CI development build here if you want to test out the fix before the next release.

Tom4tot commented 7 months ago

You are correct about 1. There should be multiple entries in the file, they are not encoded with a semicolon; that's just how some programs choose to display it. I implemented this via 0775ad6. You can use the CI development build here if you want to test out the fix before the next release.

Awesome, it works as I expected. Glad that it was only a minor "fix" (from what I understand, at least), great job!

Tom4tot commented 7 months ago

Regarding issue number 3, here is a new log. The main issue is that everytime I sync, files are transcoded again, and the previous ones deleted.

Also, I'm not sure why the number of transcoded files is not equal to the number of deleted files.

Scanning source directory...
Transcoding 134 file(s)...
Scanning destination directory...
Deleting 104 file(s) in destination directory...
Sync completed successfully in 00:00:54

easyaudiosync.log

complexlogic commented 7 months ago

@Tom4tot Can you try the build here and let me know if it fixes 3 for you? I added the longPathAware attribute per Microsoft's documentation on long paths. This has fixed long path issues on Windows for my other programs.

Tom4tot commented 7 months ago

The program crashed while I was trying to start a new sync. There's no log in %userprofile%\.easyaudiosync unfortunately. It also happened once in the past... Didn't do anything specifically.

With the new version, it's crashing everytime. When it crashes, I hear a sound like a device got unplugged.

Tom4tot commented 7 months ago

To be more accurate, it seems the program doesn't crash as long as it's in foreground. But it crashes when in background, both with previous test build and the last one you sent. I can't reproduce any crash consistently though.

complexlogic commented 7 months ago

@Tom4tot Thanks for your help. I develop and test this program primarily on Linux. It seems that the Windows version is not as stable as I thought.

I just did some testing and did experience a crash on Windows. I pushed a fix for it, but I'm not sure if it's the same issue that you're experiencing.

I enabled debug symbols in the latest development build. Please download that and give it a try. If you can still reproduce the crash, it would be extremely helpful if you can upload the dump file. There are good instructions on how to create local dumps here. That will tell me exactly where the program is failing so I can fix it.

Tom4tot commented 7 months ago

Well thank you for taking the time to fix your software on a OS you don't use lol. I'm trying to desync/resync but so far I can't make any version crash. However I can tell it's handling long paths properly now!

complexlogic commented 7 months ago

I have added a new setting to enable the transfer of custom tags when transcoding. It's disabled by default, so you'll need to enable the checkbox in Settings->Transcoding->Include extended tags. New build is available here. If you are able to test it before I merge into master, that would be great.

Tom4tot commented 7 months ago

I have added a new setting to enable the transfer of custom tags when transcoding. It's disabled by default, so you'll need to enable the checkbox in Settings->Transcoding->Include extended tags. New build is available here. If you are able to test it before I merge into master, that would be great.

Thank you, I will test it and report. Is it supposed to retransfer all files once the new setting is ticked? Since some tags will potentially be missing on the previous sync.

complexlogic commented 7 months ago

Is it supposed to retransfer all files once the new setting is ticked

No, you'll need to uncheck the "Skip files that exist in destination" setting.

Tom4tot commented 7 months ago

Is it supposed to retransfer all files once the new setting is ticked

No, you'll need to uncheck the "Skip files that exist in destination" setting.

Sorry to always ask for more, but maybe you could consider an option to replace files in the following scenario: if the date modified value of the original file is newer than the date modified/created of the copied/transcoded file, then copy/transcode file again.

complexlogic commented 7 months ago

That setting already exists, it's called "Except files with older timestamps" (referring to the destination file).

Tom4tot commented 7 months ago

That setting already exists, it's called "Except files with older timestamps" (referring to the destination file).

Yes sorry, forgot about it. I guess my issue mentioned here won't be a problem anymore after your program is updated, so it's not really an issue, it's only for files that have been transferred before updating.

Tom4tot commented 7 months ago

I have added a new setting to enable the transfer of custom tags when transcoding. It's disabled by default, so you'll need to enable the checkbox in Settings->Transcoding->Include extended tags. New build is available here. If you are able to test it before I merge into master, that would be great.

Can confirm it works perfectly, still no crash. Just a suggestion: update this field ENCODEDBY to 1.1 or whatever, and maybe mention the encoder being used?

complexlogic commented 7 months ago

I'll make a new release soon and bump the version number.

I'm going to close this issue now. If you experience any more crashes, please open a new issue.