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: Conversion failed: File is already in use (Read 13068 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Conversion failed: File is already in use

I am getting "Conversion failed: File is already in use" when  using the file converter to go from FLAC to AAC(Nero).  This issue seems to be related to having a duplicate album.  I have the software set up to skip, if file already exists. I'm running v1.2.


Duplicate album paths:

E:\Music\The Cure\Disintegration
E:\Music\The Cure\Disintegration_


Converter Status Report:

8 out of 24 tracks converted with major problems.

Source: "E:\Music\The Cure\Disintegration_\01 Plainsong.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 01 Plainsong.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration_\02 Pictures Of You.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 02 Pictures Of You.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration\03 Closedown.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 03 Closedown.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration_\04 Lovesong.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 04 Lovesong.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration\05 Last Dance.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 05 Last Dance.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration_\06 Lullaby.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 06 Lullaby.m4a"
  Conversion failed: File is already in use
Skipped: "E:\Music\The Cure\Disintegration_\07 Fascination Street.flac"
Skipped: "E:\Music\The Cure\Disintegration\08 Prayers For Rain.flac"
Skipped: "E:\Music\The Cure\Disintegration\09 The Same Deep Water As You.flac"
Skipped: "E:\Music\The Cure\Disintegration_\10 Disintegration.flac"
Source: "E:\Music\The Cure\Disintegration_\11 Homesick.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 11 Homesick.m4a"
  Conversion failed: File is already in use
Source: "E:\Music\The Cure\Disintegration\12 Untitled.flac"
  Unable to open file for writing (File is already in use) : "C:\Users\user\Desktop\New folder (2)\The Cure - Disintegration - 12 Untitled.m4a"
  Conversion failed: File is already in use

Conversion failed: File is already in use

Reply #1
That is likely due to multi-threading the conversion process, when two or more threads try to convert to the same target at once. Quite an interesting error case.

Conversion failed: File is already in use

Reply #2
That is likely due to multi-threading the conversion process, when two or more threads try to convert to the same target at once. Quite an interesting error case.


I have a similar problem. I have recently purchased Sansa Clip+ and I am trying to play by FLAC files (Mix of 24 bit and 16 bit) on it knowing that Clip+ supports this format. However, when I try to play FLAC songs, some of the songs get skipped. 

I read lots of threads around this topic with following being the reasons -
1. Clip+ does not support 24 bit
2. Tool -> reference libFLAC 1.2.1 20070917 (this is an issue even with 16 bit)

And I agree with this  as this is my observation as well.

And the recommendation was to use foobar2k convert function to convert these songs to 16 bit and tool -> libFLAC 1.3.0 20130526.

I am trying to do this but get following error with no conversion - 1 out of 1 tracks converted with major problems. Source: "filepath\filename" Unable to open file for writing (File is already in use) "filepath\filename" Conversion Failed: File is already in use.

I am using foobar2000 v1.3 and Free_Encoder_Pack_2013-12-06.exe. And I perform following steps for the conversion -

1. Add FLAC songs to the default playlist (tried single and multiple songs conversion with same error)
2. Right click songs and select convert with following options
- Output file format: FLAC, Output bit depth: 16-bit, Dither:never, Compression Level: tried all 0-8
- Output path: Source track folder (as I don't want to create another copy but overwrite existing one), If file already exists: Overwrite, Name format: %filename% (as I want to overwrite existing file)
- ReplayGain: None (default selection)
- In Other tab - no selection except Transfer attached pictures checked (default)

Could you please let me know what am I doing wrong? And how to resolve this problem.

Conversion failed: File is already in use

Reply #3
It's not possible to overwrite an input file.

Conversion failed: File is already in use

Reply #4
It's not possible to overwrite an input file.

Could you please elaborate?

Understood that you cannot write back on the same file while its being converted. However, my thinking was while each file is being converted a temporary file (unknown extn) is created for the converted file. And when the conversion is complete, the source file is overwritten with converted file.

What else is this option "Output path: Source track folder" for?



Conversion failed: File is already in use

Reply #6
What else is this option "Output path: Source track folder" for?
Conversion between different formats or - more generally - for when the output file name is different from the input file name.

Ok, thanks foosion.
Is there anyway by which I can retain my source folder (album) structure while converting files?
I have collection some 1000 plus flac files Organised in folder/album structure. And I want to convert all these songs in one go while retaining the source folder structure. How do I achieve this using foobar2000?

 

Conversion failed: File is already in use

Reply #7
Is there anyway by which I can retain my source folder (album) structure while converting files?
I have collection some 1000 plus flac files Organised in folder/album structure. And I want to convert all these songs in one go while retaining the source folder structure. How do I achieve this using foobar2000?


You can still use the source folder option, but rename the output file to include something that differentiates it from the original. Of course, you'll need to have space available for the converted tracks plus the original until you delete the originals.

What I would do, use source folder, and and then use %filename%-16 for the output filenames, this will allow you to convert, then you can easily filter out all the tracks that don't have "-16" in the filename and remove them.

Depending on how much space you have available, you can convert an album or group of tracks at a time.

Conversion failed: File is already in use

Reply #8
in the Destination bit of the converter, try this as the pattern...

Code: [Select]
$replace(%path%,$left(%path%,3),,%filename_ext%,%filename%)


the number 3 there is stripping the first 3 characters from the path like e:\

you could use 9 if you wanted to strip e:\music\

Conversion failed: File is already in use

Reply #9
I use something like
Code: [Select]
$substr($directory_path(%path%),10,10000)\%filename%


Conversion failed: File is already in use

Reply #10
Thanks LifeWOutMilk, maec2003, lvqcl.

Re: Conversion failed: File is already in use

Reply #11
I get this error on random files when using the new FLAC encoder with multithread support. Any way to fix it other than reverting to an older version?

edit: Found a workaround, turned on Encode to a temporary location in the custom settings.

Re: Conversion failed: File is already in use

Reply #12
What exactly is your conversion scenario? This thread was about at least two user errors: trying to convert two albums at the same time into one and trying to overwrite source files with new encodes.

Also note that encoding to a library watched directory might have issues, as any new file appearing there will be opened by library watcher for inspection. And the converter will need to open encodes again after they are done if you chose to do any tagging for them.

Re: Conversion failed: File is already in use

Reply #13
Also note that encoding to a library watched directory might have issues, as any new file appearing there will be opened by library watcher for inspection.
Yeah, that might be the problem. It works fine for singlethreaded encodes, but it's messing with the new multithreaded FLAC encoder. Writing the files to a temporary location first solves it. Found a setting for it in Preferences > Advanced.

Re: Conversion failed: File is already in use

Reply #14
I'm assuming then that you have set up FLAC with custom -j commands. foobar2000 spawns as many conversions as threads by itself, and that is usually more efficient than -j. Except if you convert very few files at the time, say one image file.

Nothing wrong in posting about unexpected quirks, though.

Re: Conversion failed: File is already in use

Reply #15
Nothing about new FLAC should be the cause for triggering this, that is why I was asking about what is actually being done.
FLAC just eats PCM data and each encoder instance will just write one output file, it doesn't matter for sharing issues how many threads it uses or how fast it operates.
Doing the same action with any encoder should cause the exact same issue.

Also foobar2000 has built-in retry operations for various tasks thanks to Anti-Virus programs historically causing a lot of sharing violation problems. If something doesn't work immediately it will be tried again. And if foobar's workarounds for stuff that should work don't work, it would be good to know about so that things can be improved.

Re: Conversion failed: File is already in use

Reply #16
I'm trying to split a cue+flac file. No custom settings. All i did was update FLAC to 1.5.0. No idea where the problem lies.

Re: Conversion failed: File is already in use

Reply #17
So, i guess, problem is in otuput file name template. Probably it is simple %filename%. Use %tracknumber%. %title%.