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: foobar2000 and iTunesEncode46 (Read 6324 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar2000 and iTunesEncode46

I have a collection of music ripped into raw wav files on my hard drive.  I have been trying to use foobar2000 and iTunesEncode46 with iTunes 4.7 to encode them into AAC files.  Here was my process:

Ripped the CDs into wav files into a directory structure looking like:
\Artist\Year - Album\Track - Song.wav

Then I used the masstagger to get the information from the path and file name into tags.  I was iffy about this part because I am not very knowledgeable about tagging wav files, but it seemed to work just fine.

From there, I set up iTunes to encode AAC in custom 192 kilobit files.

Then I set up foobar2000 to use iTunesEncode46.

I set it to put encoded files here:
%artist%\%date% - %album%\%tracknumber% - %title%

I checked the "Create subdirectories" option.

In the Commandline encoder settings, I pointed it to the encoder.

I used these commandline options:
-a "%artist%" -l "%album%" -t "%title%" -y %date% -n %tracknumber% -i %s -o %d -d

The extention is "m4a".

The Format is "Lossy".

Everything else is default in the foobar2000 settings.


Okay, here is the problem.  Before I went to bed last night, I selected all the music and started foobar converting it.  I came down to check on it and toward the beginning of my collection, and iTunes had errored.

foobar kept going since it has no way of knowing that iTunes had errored.  It created directories for every album after the one that had errored, but there were no files.

I spent some time trouble shooting this today.  I originally thought the problem was repeatable, but I'm not so sure.  I started by letting it go until it errored, and then just hitting okay on the error.  When I do this, it starts spitting out files again.  I don't know how useful that is, but I tried some other things.

I tried changing the bitrate of the encoding through iTunes back to the "High Quality" 128kilobit preset.  I THOUGHT that fixed it and I set it to do the collection again.  I hung around and it wasn't long before it errored again.  I tired a couple bitrate settings, but I don't think anything was helping.

I also tried to take the wav files in iTunes and do it with iTunes only, and it seemed to work okay.  This would be fine if iTunes would tag them, but it won't.

I tried running the encoder using foobar's default location and the following parameters:
-i %s -o %d -d

Still no luck.

Whatever is causing the error has to be something to do with what either foobar or itunesencode is doing to the file.  Could it be foobar tagging the wav files?  I thought it was repeatable but it just seems to be happening randomly now.  I don't know what to make of it.  Any ideas?

foobar2000 and iTunesEncode46

Reply #1
What, exactly, is erroring out? You say you hit "OK" so obviously some kind of error or crash is actually occurring. iTunesEncode's only failure mode is to spit out what sort of error occured and exit with a non-zero return code. No OK box, sort of thing.

I know that iTunesEncode has some kind of issue where it will occassionally quit early for some kind of reason that I can't duplicate consistently. If you figure out a way to duplicate this, let me know.

BTW, I did find/fix one problem with excessively large files a couple of days ago, so if you have an older copy, you might want to redownload it. http://otto.homedns.org:8888/iTunes/iTunesEncode46.zip .

Basically, I was trying to encode some big audiobooks and it'd quit way early because iTunes overflowed a long int. Now it'll work okay on those, but the progress display will be all wonky. Blame Apple.

foobar2000 and iTunesEncode46

Reply #2
Quote
Okay, here is the problem.  Before I went to bed last night, I selected all the music and started foobar converting it.  I came down to check on it and toward the beginning of my collection, and iTunes had errored.

[{POST_SNAPBACK}][/a]


Are you sure it was iTunes that errored, or was it itunesencode.  I had a problem with itunesencode46 crashiing on me, but since switching back to the older version, itunesencode w/o the 46, everything has been fine.  It really is a great tool.

[a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=29810&hl=]http://www.hydrogenaudio.org/forums/index....topic=29810&hl=[/url]

look for the link to the older itunesencode.

hope this helps
- FLAC/200GB external
- AAC 128 vbr/local
- iPod Nano 2G 8GB

foobar2000 and iTunesEncode46

Reply #3
Quote
http://www.hydrogenaudio.org/forums/index....topic=29810&hl=

look for the link to the older itunesencode.
[a href="index.php?act=findpost&pid=263725"][{POST_SNAPBACK}][/a]

Actually, I screwed up and deleted the older iTunesEncode about a week ago. I've been unable to find a copy of it since then. If you have a copy, could you email it to me? sam dot wood at gmail.

The newer one should actually work better if you have iTunes 4.6 or up, since I added a bunch of error checking. The old one sorta just forged on regardless of what errors cropped up, and gave me no end of trouble.

foobar2000 and iTunesEncode46

Reply #4
I was a little vague, and I was gonna paste the error code in here and couldn't reproduce it again, and then forgot.

The error occurs in iTunes 4.7, not iTunesEncode46.  It's late and I don't want to try to reproduce it now, but it said something to the extent of "Unknown error occurred while importing" or encoding or whatever, and then gave a hex address which was the same everytime.  I thought I saved a screen shot of the error the first time I saw it, but evidently I didn't.  At any rate, my testing wasn't as systematic as I would like because I was scatterbraining a bunch of ideas of what the problem might have been at the same time.  I thought they were reproducible, but maybe they weren't.  I can't even remember anymore.

My theory was either foobar or iTunesEncode was adding something to the file that screwed up iTunes.  I thought maybe this was the tags that foobar added to my wav files.  I tested that theory by using the original wavs and encoding them with iTunes directly (without foobar or iTunesEncode) and that seemed to work without erroring on an album that seemed to be consistantly erroring up to that point.  But again, my tests weren't systematic enough to tell for sure, and I didn't test enough files to uphold the basis of that theory.

I'll do some more testing and update you on it.

I hope it doesn't seem like I am being negative or ungrateful.  iTunesEncode is truely great.  I am pretty sure the kink has something to do with what I am doing.

foobar2000 and iTunesEncode46

Reply #5
Quote
I hope it doesn't seem like I am being negative or ungrateful.  iTunesEncode is truely great.  I am pretty sure the kink has something to do with what I am doing.
[a href="index.php?act=findpost&pid=263752"][{POST_SNAPBACK}][/a]

No dude, bug reports are essential to fixing issues. Thanks for the help!

foobar2000 and iTunesEncode46

Reply #6
I just did a little testing.  I attempted to encode a troublesome album with the tagged wav files (tagged with foobar's masstagger) from foobar to itunesencode to itunes.  It errored as I expected, although I only got an error in foobar's console, and no error box in iTunes like I was getting before.  Then I deleted the tags in foobar and encoded it the same way, except I had to change foobar's settings for where the files were going, since it didn't have the information from the tag.  No errors.  I thought, "Great!  That is what I expected.  It's foobar."  Then I tagged the wav files again in foobar, closed it and added the wav files in iTunes.  I selected all the files and hit "Convert to AAC" expecting to get the error because of the tagged wavs.  It went through without erroring.  I didn't bother trying to use just iTunes to encode wavs without tags.  Apple has tested that plenty, I'm sure.

So now I don't know if I am getting closer or further away.  The wavs are being tagged in foobar as metadata (something I am not real familiar with).  Foobar calls iTunesEncode to encode the wav files and iTunesEncode calls foobar for the tag information so it knows how to name the file and what directories to create for the artist and album.  Then iTunes encode calls iTunes to encode the file, and finally tags it afterward.  From what I was seeing in the command prompt window on iTunesEncode, the error was occuring during the encode, before it tags the final m4a file.

My thoughts:
iTunes seems to ignore the metadata in the wav file when I use iTunes alone.  I can tag the files, close foobar, open iTunes, add the files (it doesn't notice the metadata), close iTunes, open foobar, add the files and foobar still sees the metadata.  So iTunes doesn't strip the metadata, it just ignores it.  I don't know what to make of that.  If it is tag related it has got to be happening before it gets to iTunes.  Can anyone repeat this problem?  Has anyone tried to encode wavs tagged in foobar with iTunesEncode?

foobar2000 and iTunesEncode46

Reply #7
Remove all those tags, then try enabling "Block Tag Update Operations" on the database page in the preferences, then add the tags back.

I think that will keep the tags only in foobar and not write them out to the WAV file itself. Thus the tags it passes to iTunesEncode will be on the command line, but it won't be changing the WAV file and potentially causing interference.

I didn't think WAVs supported a tag standard in any case.

foobar2000 and iTunesEncode46

Reply #8
THAT is exactly the information I wanted to hear.  I knew there had to be a way to make the database know the information on the file without actually tagging the file.  I will give that a try and post again.  Thanks!

foobar2000 and iTunesEncode46

Reply #9
Well, I had no luck with that.  It still errors.  I haven't been getting an actual error box lately, so if one errors, it goes on to the next one and keeps encoding.  I just have to go back and redo the ones that error.  This time I encoded about 250 files and 4 errored.  Not a real big deal, so I will probably just have it finish the rest of my files when I go to bed and fix the errorred files tomorrow morning.  Thanks for all the help.

foobar2000 and iTunesEncode46

Reply #10
Hmm.. Just be aware that if iTunesEncode errors out, for whatever reason, you might miss some files. Basically, iTunesEncode is calling iTunes functions to encode the file.. But if iTunes is currently encoding something, an error will be returned when you try to encode something else and iTunesEncode will quit instantly. This happened to me on a number of long batch encodes. I was using an actual batch file in those cases, but the point remains.

Of course, if iTunes itself is what errors on you, then it's not a big deal I guess. I've never seen iTunes have an error like this though, so I can't provide info on what would happen in that case.

foobar2000 and iTunesEncode46

Reply #11
Well, out of about 1400 songs, about 30 errored.  The nice thing about that was iTunes left the temp files in its library.  I was using the -d command in iTunesEncode, so the successful encodes were getting deleted from the library to be added later.  Because of that, I could easily tell which songs were erroring.  I could go back and re-encode the ones that had errored.  30 was no big deal, I just didn't want to do the whole collection one at a time.  At any rate, most everything got encoded and I easily covered the remainder.

More thoughts on the problem:
iTunes was actually returning an error code before, but it isn't doing that anymore.  I am not sure if iTunesEncode is returning an error, but foobar does return an "Encode Failed" in its console.  So I am thinking maybe iTunesEncode is getting hung up and foobar is sending the command for a new encode, thus producing an error like you were talking about.  Just a theory.  Thanks again.

 

foobar2000 and iTunesEncode46

Reply #12
I have exactly the same problems like cbarnes913. Also nearly the same ratio (28 errors, while encoding about 1700 tracks). I also look for the appropriate (remaining) temp files in iTunes and re-encode them.
Of course it would be nicer, if the whole batch would run without errors. Nevertheless iTunesEncode is a geat piece of code and it's very important for my whole workflow. Thanks very much Otto42.

Urs