Page 1 of 1
Audio Transcode Wizard Fails
Posted: 03 Oct 2007 22:53
by jr_2005
Using VLC 0.8.4a. I have a FLAC file that I would like on my portable mp3 player, and was pleasantly surprised to find that VLC plays the file just fine. When I try to use the Wizard (or any other GUI approach) to convert the file to mp3 (or wav), I get nowhere. The nearest I got once was a (slightly short) mp3 file that played white noise at full volume. No matter what options I choose, I cannot transcode the file. What am I doing wrong? I searched these forums back to 2005 and found some other similar queries but no solutions.
JR
Re: Audio Transcode Wizard Fails
Posted: 04 Oct 2007 13:26
by funman
first, upgrade vlc to the last version
after, did you select "raw" encapsulation ?
Re: Audio Transcode Wizard Fails
Posted: 04 Oct 2007 15:08
by Arite
I would recommend using the "Stream/Save" method instead. In VLC (0.8.6c), go to:
File >> Open File...
And select the FLAC file. Then tick the "Stream/Save" tick box and click on "Settings...". That should then take you to the "Stream output" window.
Select an output file, "WAV" encapsulation, and either "s16l" or "mp3" for WAV or MP3, respectively. You could also change the bitrate if you want to use MP3 (it is ignored for WAV).
For example:
Should give a stereo WAV output to the filename "C:\Temp\OUT.wav".
However, if you prefer to use the Wizard then that can be done also - what encapsulation format, audio codec etc. did you select?
Cheers, Arite.
Re: Audio Transcode Wizard Fails
Posted: 04 Oct 2007 18:22
by jr_2005
first, upgrade vlc to the last version
after, did you select "raw" encapsulation ?
I saw that other people with later versions than mine also had a problem so I was hoping that it was my finger trouble, not a version issue. I just HATE installing software 'upgrades' which end up being downgrades.
Select an output file, "WAV" encapsulation, and either "s16l" or "mp3" for WAV or MP3, respectively. You could also change the bitrate if you want to use MP3 (it is ignored for WAV).
I tried the stream output options as well (with all encapsulation methods I could find) and got nowhere, but I did not know that s16l corresponds to WAV format. (Is that option available on my version? I'm at work now and won't be able to try it until later.) Choosing mp3 was what gave me the file with white noise. (At least my other mp3 players actually recognised the file format
.) Although strangely the file was only half the size I expected.
Do you
know that this approach works - have you tried it - or is it a best guess based on what
should work?
At this rate I can see me sticking a microphone in front of the computer speakers...
Thanks for the input
JR
Re: Audio Transcode Wizard Fails
Posted: 04 Oct 2007 22:07
by jr_2005
OK I was afraid of that. "Upgraded" to the latest version from the website and tried again. EXACTLY the same result. Both mp3 and wav options produce files of half the size they should, full of white noise. (Well, I say full. Didn't actually listen to more than 10 seconds of it.) My Stream/Save panel and settings looks exactly like Arite's. I can only guess he didn't actually try it.
I don't understand it - the FLAC file plays in VLC just fine, so it can't be a codec problem?
And I've lost my old settings/preferences.
Where's my microphone...
JR
Re: Audio Transcode Wizard Fails
Posted: 05 Oct 2007 00:11
by Arite
Yes - sorry about that, you were right. I didn't try it as I assumed FLAC would be the same as it was for DTS (just encapsulate as a WAV and select an appropriate codec - streamed many times to a WAV using that method).
I was unable to transcode to even a WAV file. However I would suggest, since it is a FLAC file, to either uncompress to WAV (using flac.exe, part of the official FLAC tools package) and then recompress to e.g. MP3 (using lame.exe), or use a similar automated method. For example, foobar2000's (Windows only) convertor would be able to transcode a FLAC straight into a LAME MP3 file (if set up correctly). This is more accurate than streaming to a file in VLC since (some) samples would be lost in the process, whereas directly uncompressing then recompressing into a different format minimises audio quality loss.
If anyone else knows how to transcode a FLAC file to e.g. a WAV file using VLC it would be useful to know, and if not whether it is a known issue.
Cheers, Arite.
Re: Audio Transcode Wizard Fails
Posted: 25 Jul 2009 05:52
by nonsubmersibleunits
Hi, all. I'm not sure if this is still an issue, but I've resolved it. After several failed vlc conversions resulting in warped and/or static-y mp3 files and a bit of tinkering, I was able to create mp3 files that actually played. Here's how you do it:
1) Go to Preferences (Under Tools menu) and find the Audio menu. Under 'Output', switch the type from Default (or whatever it's set to) to File Audio Output. Set the destination, file name and extension - I used .mp3 (this won't be your finished file -it still reads as flac, even though the extension says its not-, so don't worry too much about the title). When you're done with this click Save.
2) Under Media, click Open File and choose the flac file you want to convert (I'm not sure if you can use this method for playlists or entire folders yet, creating one big file, but it might be worth trying -although casual observation implies that it probably wouldn't work), and then click Play. Unfortunately, I know of no workaround for the fact that you have to wait while the file plays. (By the way, you shouldn't hear anything while the file plays, it's output is not supposed to be audio, instead, it's writing to a new file. If the file plays as normal, then you haven't done step 1 correctly.)
3) When your file is finished playing, go back to Preferences and change the output back to default (this is very important!). If you don't do this, then as soon as you open the new file it will overwrite itself.
4) Go back to Media and select Convert/Save (or key combination Ctrl+R). Find the file you've just created (the output file with the proper extension, that is) and click Convert. Near the top check off the box next to 'File' and then give it a filename and a destination, along with your desired extension - make sure this corresponds with the extension under Profile. Then click Save. The resulting file? A real mp3!
Yes, it's clumsy, but as far as I'm concerned, it beats downloading new software. And it's a heck of a find. I didn't think VLC could pull off this conversion!
Cheers!
Re: Audio Transcode Wizard Fails
Posted: 26 Jul 2009 17:51
by jr_2005
Yes the FLAC format conversion problem still is an issue for me - I never did find a resolution of the problem. I've just tried your suggestions and they actually work!! Top marks. As you say, it is a tad clunky but as long as I don't need to do it every day it is at least a workable solution. I would only add that the volume control setting seems to affect the level within the files, so don't go changing it while the conversion is in progress.
Thanks again for posting the solution!
JR
Re: Audio Transcode Wizard Fails
Posted: 28 Nov 2009 02:10
by ddcast
I understand this is an old post, but I figured this is worth noting:
When executing this solution, I found it necessary to restart VLC after Step #1 else the audio file will not convert and according to Step #2, "If the file plays as normal, then you haven't done step 1 correctly." Restarting VLC would resolve this issue.
[VLC version 1.0.3]
Re: Audio Transcode Wizard Fails
Posted: 21 Dec 2010 14:39
by curtswanson
This is still an issue. I have VLC 1.1.5 and transcoding from FLAC to mp3 or WAV produces gibberish. I have been able to follow the directions above for a work-around but it is extremely time consuming.
First, is there a way, as a user, to remedy the problem?
Second, if not, can someone help with a command line version of the above method so that it can be automated?
Thanks.
Re: Audio Transcode Wizard Fails
Posted: 21 Dec 2010 19:47
by curtswanson
I looked around for a program to transcode FLAC to WAV and found this.
http://flac.sourceforge.net/download.html
It is easy to use and fast. Then I used VLC to transcode from WAV to MP3. I would still like a VLC-only solution, though, if anyone has one.
Re: Audio Transcode Wizard Fails
Posted: 22 Dec 2010 01:46
by Rémi Denis-Courmont
From the shell, I think it would be, from FLAC to MP3:
Code: Select all
vlc music.flac --no-sout-video --sout '#transcode{acodec=mp3}:std{access=file,mux=raw,dst=music.mp3}'
and from FLAC to PCM:
Code: Select all
vlc music.flac --no-sout-video --sout '#transcode{acodec=s16l}:std{access=file,mux=wav,dst=music.wav}'
Re: Audio Transcode Wizard Fails
Posted: 22 Dec 2010 15:58
by curtswanson
Thanks those do not seem to produce anything for me. Is anyone able to transcode flac files correctly using vlc?
Re: Audio Transcode Wizard Fails
Posted: 22 Dec 2010 19:53
by Arite
I tried (using VLC 1.1.5 on Win7):
Code: Select all
vlc -I dummy [INPUT] --no-sout-video --sout "#transcode{acodec=mp3}:std{access=file,mux=raw,dst=music.mp3}"
Where [INPUT] is the input file. So basically what Rémi wrote but with double-inverted commas and using the dummy interface.
This worked correctly for both an MP3 file and a WAV file as the input; however it just produces noise for a FLAC file input. Presumably VLC is just treating the FLAC file as an uncompressed LPCM file.
Arite.
Re: Audio Transcode Wizard Fails
Posted: 22 Jul 2011 10:26
by naltimari
Finally, after much frustration and a bit of luck, I managed to find the command line syntax to output the FLAC as a WAV, without resorting to change VLC's Preferences.
I will explain how to do it for Windows, because for Linux I'll assume you'll spot the differences and make the necessary changes...
1. Open up a MS-DOS window, navigate to there your FLAC files are and type:
The next line adds the default location of vlc.exe to the PATH for that MS-DOS window. The path may be different on your system.
Code: Select all
set PATH=%PATH%;"c:\Program Files (x86)\VideoLAN\VLC"
2. Then, in the same MS-DOS window (don't close it or you'll lose the PATH!), type the magic command:
The next line spawns a 'dummy' vlc instance (no GUI) which takes track1.flac and generates track1.wav in the same folder.
Code: Select all
vlc --intf dummy --aout=audiofile --audiofile-format=s16 --audiofile-channels=2 --audiofile-file=track1.wav track1.flac vlc://quit
3. (optional) You can also convert all the files at once, like this:
Next line will open many instances of VLC, one for each FLAC file, and generate a WAV file on the same folder.
Code: Select all
for %i in (*.flac) do vlc --intf dummy --aout=audiofile --audiofile-format=s16 --audiofile-channels=2 --audiofile="%~ni.wav" "%i" vlc://quit
Finally, you can use a similar approach to convert all the WAVs to MP3s:
Code: Select all
for %i in (*.wav) do vlc --intf dummy --sout=#transcode{acodec=mp3,ab=192}:std{access=file,mux=raw,dst="%~ni.mp3"} "%i" vlc://quit
I really hope this to be fixed on the next VLC release. It seems this is the only way to properly re-encode FLAC files as of VLC 1.1.11 (I mean, by decoding them to WAV using 'audiofile' and then re-encoding them to OGG/MP3/MP4 on another step).
If you know some other (hopefully easier) way, please don't refrain from posting
IMPORTANT: If you get
'vlc' is not recognized as an internal or external command..., you added the wrong location to the PATH!
NOTE: WAV files are HUGE! If you use the batch conversion in step 3, beware of storage space.
Audio Transcoding SUCCESS
Posted: 11 Oct 2011 00:24
by KutWrite
I use Ubuntu Linux 11.04 and VLC v 1.1.9. I have a Toshiba Satellite laptop with an i7 Pentium.
I had a similar problem with the "convert" wizard, though I am not converting from a FLAC. My source is a DVD RAM video VRO format my DVR uses, usually going to H64 (MP4) for YouTube use.
I had no (good) luck with the "Convert" option either. Somewhere I saw to try "stream" rather than "convert," and it works, but I had to muck with the settings. But, there's NO need to change preferences, as above.
(I didn't try the above method for that reason. I felt I might forget to switch it back from "file" to "default" and have future problems.)
Here are the steps that work for me:
1. In VLC, select Media/Streaming. This gives you a wizard box awaiting file selection.
2. Click "add" and browse to the file you want to convert from. You might have to refine the search by clicking the "Disc" tab, though I didn't have to.
3 Click on "stream" at the bottom; it will open another box entitled "Stream Output," with the "source" tab at the top highlighted. It should already show your source. If not, add it.
4. Click "Next" at the bottom right. It will go to the "destination" tab and await your definition of a "Stream Output." make sure the pull down near "New Destination" says "File."
Make sure "Activate Transcoding" is checked. Select the type of file you want as output from the pull-down menu. I usually choose H64+AAC (MP4) for use on YouTube.
Note that one option is to make an MP3 from a video. I find this useful for my web site radio show.
5. Click Next" I leave all the "Options" blank - I don't know what the hell they do.
6. Click "Stream." Be sure to Give the destination a file name to write to. I usually give it an mnemonic name but NO suffix. VLC will add that.
I find this works every time, and relatively quickly. At least, it's quicker than playing the video would be, by far, and beats my previous Mac Powerbook by a LOT!
Re: Audio Transcode Wizard Fails
Posted: 19 Jan 2013 18:34
by MediaManiac
Updated solution for an old problem. For Windows users, save the following code to a .VBS file, and you can drag and drop one or more .FLAC files on to the icon for conversion to .MP3.
Note 1: If using 64bit windows, modify vlc path. (2 places)
Note 2: Ensure file PATH does not contain ' or ,
'--- Start Code ---
'On Error Resume Next
Set objArgs = WScript.Arguments
Set objFSo = CreateObject("Scripting.FileSystemObject")
For Each strInputFileName in objArgs
strTempFileName = Left(strInputFileName,InstrRev(strInputFileName,".")) & "tmp"
'Removing special characters from filename (VLC fails id ' or , in filename)
strTempFileName = Replace(strTempFileName,",","-")
strTempFileName = Replace(strTempFileName,"'","^")
strWaveFileName = Left(strTempFileName,InstrRev(strTempFileName,".")) & "wav"
strOutputFileName = Left(strTempFileName,InstrRev(strTempFileName,".")) & "mp3"
objFSO.MoveFile strInputFileName ,strTempFileName
Set objShell = CreateObject("WScript.Shell")
'Stage 1: convert to wav
CommandLine = ""
CommandLine = CommandLine & """C:\Program Files\VideoLAN\VLC\vlc.exe"" "
CommandLine = CommandLine & """" & strTempFileName & """ "
'CommandLine = CommandLine & " --intf dummy --aout=audiofile --audiofile-format=s16 --audiofile-channels=2"
CommandLine = CommandLine & " --aout=audiofile --audiofile-format=s16 --audiofile-channels=2"
CommandLine = CommandLine & " --audiofile-file="""
CommandLine = CommandLine & strWaveFileName
CommandLine = CommandLine & """ vlc://quit"
objShell.Run CommandLine,,True
'Stage 2: Convert to MP3
CommandLine = ""
CommandLine = CommandLine & """C:\Program Files\VideoLAN\VLC\vlc.exe"" "
CommandLine = CommandLine & """" & strWaveFileName & """ "
CommandLine = CommandLine & " --sout=#transcode{acodec=mp3,ab=192,vcodec=dummy}:standard"
CommandLine = CommandLine & "{access=file,mux=raw,dst="""
CommandLine = CommandLine & strOutputFileName
CommandLine = CommandLine & """} vlc://quit"
objShell.Run CommandLine,,True
If instr(strOutputFileName,"^") Then
strOldOutputFileName = strOutputFileName
strOutputFileName = Replace(strOutputFileName,"^","'")
objFSO.MoveFile strOldOutputFileName, strOutputFileName
End If
Set Outfile = objFSO.GetFile(strOutputFileName)
'msgbox("File Size: " & Outfile.size )
If Outfile.size <> 0 Then
'Remove below comment marks to auto delete .flac and .wav file after .mp3 creation
'objFSO.DeleteFile strTempFileName
'objFSO.DeleteFile strWaveFileName
Else
objFSO.MoveFile strTempFileName, strInputFileName
End If
Next
'--- End Code ---
Re: Audio Transcode Wizard Fails
Posted: 26 Jan 2013 19:54
by kurtosis
Beautiful script, works like a dream, many thanks.
Re: Audio Transcode Wizard Fails
Posted: 30 Sep 2013 19:29
by dredig22
Would it be possible to modify this script to create a .WAV and leave the original source file unchanged? Thanks much.
Re: Audio Transcode Wizard Fails
Posted: 23 Oct 2013 01:14
by KyooMac
mediamaniac Thank you for the VBS file you posted, I have been using it for about 4 mos on a Windows 7 machine, recently I tried to use it on a Windows 8.1 machine after changing the VLC path as is noted in your post. I get a WAV file, but then I get error in line 44 800A0035 file not found that line is:
Set Outfile = objFSO.GetFile(strOutputFileName)
Any help would be appreciated.
Re: Audio Transcode Wizard Fails
Posted: 02 Feb 2014 17:11
by td22
Thanks for the VBS script, it helped me, too.
Pro:
+ Does what it is meant to do
Con:
- Is really slow
- Doesn't work in the background - after each file, VLC pops up again
- Renames your original .flac file to .tmp - to get your files back, you have to rename them one by one from .tmp to .flac. The script should do this automatically. Would appreciate if anyone who knows VBS a little better than me could change this.
Re: Audio Transcode Wizard Fails
Posted: 28 Mar 2019 11:56
by gmontag451
This is an old thread, but still very useful! I have made some simple tweaks to MediaManiac's code so that it will properly preserve the original file's naming and .flac extension, as well as update the wav and mp3 file names. Also, if you only want to create wav files, search the code for 3 sections marked with an asterisk and comment out the proper lines. Thanks to MediaManiac for a great script, which I never could have figured out on my own. (There are still some rare characters which will cause the script to fail, so if anyone knows how to use the Replace routine to replace filename characters outside the range accepted by VLC, please let us know!)
'--- Start Code ---
'CHECK YOUR VLC.EXE PATH AND UPDATE THE TWO SECTIONS BELOW!
'On Error Resume Next
Set objArgs = WScript.Arguments
Set objFSo = CreateObject("Scripting.FileSystemObject")
For Each strInputFileName in objArgs
'---------------------------------------------
'added these 2 lines to preserve filename for wav and mp3:
strOrigWavName = Left(strInputFileName,InstrRev(strInputFileName,".")) & "wav"
strOrigMP3Name = Left(strInputFileName,InstrRev(strInputFileName,".")) & "mp3"
'---------------------------------------------
strTempFileName = Left(strInputFileName,InstrRev(strInputFileName,".")) & "tmp"
'Removing special characters from filename (VLC fails id ' or , in filename)
strTempFileName = Replace(strTempFileName,",","-")
strTempFileName = Replace(strTempFileName,"'","^")
strWaveFileName = Left(strTempFileName,InstrRev(strTempFileName,".")) & "wav"
strOutputFileName = Left(strTempFileName,InstrRev(strTempFileName,".")) & "mp3"
objFSO.MoveFile strInputFileName ,strTempFileName
Set objShell = CreateObject("WScript.Shell")
'Stage 1: convert to wav
CommandLine = ""
'CHECK YOUR VLC.EXE PATH AND UPDATE THE LINE BELOW!
CommandLine = CommandLine & """C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"" "
CommandLine = CommandLine & """" & strTempFileName & """ "
'CommandLine = CommandLine & " --intf dummy --aout=audiofile --audiofile-format=s16 --audiofile-channels=2"
CommandLine = CommandLine & " --aout=audiofile --audiofile-format=s16 --audiofile-channels=2"
CommandLine = CommandLine & " --audiofile-file="""
CommandLine = CommandLine & strWaveFileName
CommandLine = CommandLine & """ vlc://quit"
objShell.Run CommandLine,,True
'----------------------------------------------
'Stage 2: Convert to MP3.
'*Comment out Stage 2 to skip mp3 creation:
CommandLine = ""
'CHECK YOUR VLC.EXE PATH AND UPDATE THE LINE BELOW!
CommandLine = CommandLine & """C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"" "
CommandLine = CommandLine & """" & strWaveFileName & """ "
CommandLine = CommandLine & " --sout=#transcode{acodec=mp3,ab=192,vcodec=dummy}:standard"
CommandLine = CommandLine & "{access=file,mux=raw,dst="""
CommandLine = CommandLine & strOutputFileName
CommandLine = CommandLine & """} vlc://quit"
objShell.Run CommandLine,,True
'End of Stage 2.
'----------------------------------------------
'*Must choose between wav and mp3:
'--------------------------------------
'uncomment when creating mp3 file/comment out when creating only wav:
Set Outfile = objFSO.GetFile(strOutputFileName)
'--------------------------------------
'uncomment when creating only wav file/comment out when creating mp3:
'Set Outfile = objFSO.GetFile(strWaveFileName)
'--------------------------------------
'msgbox("File Size: " & Outfile.size )
If Outfile.size <> 0 Then
'Remove below comment marks to auto delete .flac and/or .wav file after .mp3 creation:
'uncomment to delete flac file:
'objFSO.DeleteFile strTempFileName
'uncomment to delete wav file:
'objFSO.DeleteFile strWaveFileName
'--------------------------------------
'This section restores the filename formatting and flac extension.
'If the mp3 section above is commented out, also comment out the mp3 section below
'Restores "'" and "," in tmp filename, changes back to flac:
objFSO.MoveFile strTempFileName, strInputFileName
'Restores "'" and "," in wav filename:
objFSO.MoveFile strWaveFileName, strOrigWavName
'Restores "'" and "," in mp3 filename (*comment out if creating only wav files):
objFSO.MoveFile strOutputFileName, strOrigMP3Name
'--------------------------------------
Else
objFSO.MoveFile strTempFileName, strInputFileName
End If
Next
'--- End Code ---