Welcome Guest

Pages: 1 2
Batch processing for copying metadata between files?
saitohPostAugust 18, 2014, 01:08
Newbie
Posts: 12
Registered:
February 5, 2014, 01:55
Normal topicBatch processing for copying metadata between files?

So I ripped my stuff to flac, great. Got it tagged via Yate with current/original release years, catalog ids, labels, etc. Lots of stuff above and beyond the normal artist/album/year/title basics. Along comes my wonderful spouse who now wants to listen to this stuff on her ipod. Did some research and found an optimum lossy codec and settings and conversion mechanism to automate converting the collection. What didn't happen was the copying of tags outside those basic ones so none of the catalog information, non of the total track numbers (just the count) or disc ids copied. I can't switch that in the conversion program, so I'm looking at Yate to help alleviate it.

I know I can pull both albums in and do copy from bottom/top and that works great. For purposes of discussion, one can assume that the aac files are in the same directory as the flac files. Second, having done a handful of albums so far manually, I can safely assume that it will always be copy from bottom to top.

How can I work toward automating that via the Batch Processor, or, is it better to drag lots of folders in, sort by format (Audio Stream), and run it that way (which in limited testing works, but I'm afraid of performance issues once I get up into the hundreds of albums/discs)?

bonus points: How can I save the "iTunSMPB" tag that is existing in the aac files already (which should be the gapless information)? I'm assuming it's an export to DB > copy from bottom to top > import from DB. Correct?

2MR2PostAugust 18, 2014, 07:57
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Batch processing for copying metadata between files?

It all depends on how deterministic is the location of the flac files when processing the m4a files. If you work on the assumption that you have a single m4a file open can you determine the path to the associated flac file? If you can, you can use the 'Import Metadata from Audio File' function.

Simply create an action (running grouped) which imports the metadata for every m4a file from its flac equivalent.

If both files are under the same root folder traversed by the batch run, include a test for the file extension and skip all flac files.

As for the bonus points....this is problematic. The Import Metadata from Audio File function blows aways the initial metadata. Using export/import will cause the same problems as you need metadata from both files. You really need a merge or an 'Import Metadata from Audio Files but keep the iTunes Comment and UDTI metadata' function. Let me think on this. It won't help regardless if you can't determine the source (flac) paths.

saitohPostAugust 18, 2014, 09:03
Newbie
Posts: 12
Registered:
February 5, 2014, 01:55
Normal topicRe: Batch processing for copying metadata between files?

Quote from 2MR2 on August 18, 2014, 07:57
It won't help regardless if you can't determine the source (flac) paths.

The more I play with it, the more I'm confident that the source file will be in the same folder. I'm using Xact which will do batch conversion and either stick everything in a folder of my choosing, or the source folder. So in this instance, I'd do better to stick it in the source folder otherwise i have a ton of m4a files that get stuck in the same folder. I figure I'll make a duplicate of the collection so I can then process the flac files and delete them leaving the original directory structure intact with the m4a files remaining.

So yeah, the path would be the same relative folder, and same pre-extension file name as it's transcoded result.

2MR2PostAugust 18, 2014, 10:54
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Batch processing for copying metadata between files?

Using the same folder and file name is good news. That means the batch processor will see the .m4a and .flac files and have easy access to both types.

For each file: (Make sure you're running groupwise via a Force Grouped statement).
- get the filename extension via Get Property-File Extension
- do a case insensitive compare against "flac". If you have a match do nothing

otherwise:

- do a Get Property-File Name (without extension) to say Variable 1
- setup your Import Metadata From Audio File statement to be Relative, 0 levels up. Set the Base filename field to "\v1.flac" which will load the filename from variable 1. I'm having issues here with differences in the displayed post and the emailed post. Only one slash is required before the "v1")

That should do the trick. (Test, test test)

I'm think of adding an optional Tag Set field to the Import Metadata From Audio File function. The original contents of any selected field type in the tag set would be merged into the imported metadata if unique for multiple item types or in the case of simple text fields if not empty. That would allow you to specify User Defined Text Info. I can't think of anything else that would be in there after encoding other than possible iTunes related information. Make sense? Generalizing the iTunes metadata is tough as in the case of mp3s some of it appears as a Comment as opposed to a UDTI.

2MR2PostAugust 18, 2014, 11:29
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Batch processing for copying metadata between files?

Actually preserving the iTunes metadata turns out to be pretty easy. I've attached an image which should show two different actions.

Before doing the Import Metadata from Audio Files call 'Retain iTunes Metadata'.

After doing the import Metadata from Audio Files call 'Restore iTunes Metadata'.

As far as I can tell the actions should preserve and restore anything that might be pertinent to iTunes.

Again.....make sure you're running groupwise. 🙂

Image

saitohPostAugust 18, 2014, 14:20
Newbie
Posts: 12
Registered:
February 5, 2014, 01:55
Normal topicRe: Batch processing for copying metadata between files?

Thanks!

What help topics should I review to brush up on to accomplish this?

2MR2PostAugust 18, 2014, 17:48
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Batch processing for copying metadata between files?

The only really tricky thing about Yate actions is wrapping your head around the difference between stepwise and groupwise execution. The help topic 'How actions execute' is the best write up we currently have. The Variables topic is also useful so you can understand the different variable types in Yate and their respective persistence.

The best way to learn about actions is to write them 🙂 I know that we could do with far more examples with an explanation as to what they do. This is a priority for me once we get v3.0 out the door.

I've written an action called: 'Copy Metadata from flac to xxx while retaining iTunes settings'. I have not done exhaustive testing but it seems to work fine. I've put a fair amount of documentation in the action.

You can download the action at:
http://2manyrobots.com/actions/CopyMetadataExample.zip

Unzip the file and do a Yate>Import Preferences on the unzipped plist file.

I hope this helps you out.

saitohPostAugust 18, 2014, 20:32
Newbie
Posts: 12
Registered:
February 5, 2014, 01:55
Normal topicRe: Batch processing for copying metadata between files?

Quote from 2MR2 on August 18, 2014, 17:48
I hope this helps you out.

oh, definitely. I'll play with it, but at least I now know I don't have to go hunting for a third program to pull this off. Thank you!

saitohPostAugust 19, 2014, 00:32
Newbie
Posts: 12
Registered:
February 5, 2014, 01:55
Normal topicRe: Batch processing for copying metadata between files?

A short follow up: you need both the itunSMPB value and the playlist delay set to '0' to get itunes to see it as "gapless" so I inserted a set command during that if statement. (attached in case anyone else is looking later).

Last; How do you export and re-import values for defined fields? I see your example for the user defined stuff, but I'm having trouble getting it to pull something out of a stock field (e.g. Artist, Album, Encoded By). This is more academic than functional, I'm just curious about the language formatting if I was going to pull out the aac encoder settings/version used. Otherwise, I've tried it on the following all with success:

  • Multiple albums (each album in a folder)
  • Multiple levels of folders (e.g. root/Artist_folder/album_1 subfolders)

As long as I only have one set of aac/m4a files in the folder with the flacs, it seems to behave and for my purposes of transcoding everything and preserving the metadata, I can safely assume that. Thanks!

2MR2PostAugust 19, 2014, 07:14
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Batch processing for copying metadata between files?

You need the value you want to retain in a Variable so that it can be written to a Named Variable. Named Variables are used to 'retain' your data across the Import Metadata from Audio File function as it will effectively zero the current file's Variable 0 through Variable1 fields as they are standard fields even though not written to the files. Named Variables are outside a track's standard fields.

..... so to save any standard field such as Encoded By simply do the following:
Copy Encoded By field to Variable1
Set Named Variable 'Retained Encoded By' to "\v1"

You might want to use the above example to preserve the Playlist Delay value as opposed to always setting it. Note that a Playlist Delay of 0 (not empty) represents gapless in an m4a file.

As long as I only have one set of aac/m4a files in the folder with the flacs, it seems to behave

Yes you're getting an error message where a flac does not exist for a corresponding m4a file. I should probably put in a pre-check to verify the file exists before attempting to open it. I'd have to change the Import... function to have a 'silent mode' as sometimes you want an error message.

Pages: 1 2
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.025 seconds.