Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Convert Flash Vids to mp3

Reply
 
Old 04-24-2008   #1 (permalink)
stephenodonoghue


 
 

Convert Flash Vids to mp3

I've been trying to hack together a Powershell script to use VLC media
player to extract an mp3 from a downloaded flash video. The problem
I've been having is with supplying the command line arguments to
vlc.exe. No matter how I teak it, nothing seems to work. I've posted
the latest error at the end of the post.

$VlcPath = "& 'C:\Program Files\VideoLAN\VLC\VLC.exe' "
cd "F:\Music\Ripping"
$flashvids = Get-ChildItem * -Include *.flv -Recurse
foreach ($flashvid in $flashvids)
{
$newFileName = ($flashvid -replace "\.flv", "\.mp3")
$cmdline = ("'" + $flashvid.FullName +
'":sout=#transcode{acodec=mp3,ab=320,channels=2}' + '"')
Invoke-Expression "C:\Program Files\VideoLAN\VLC\vlc.exe F:\Music
\Ripping\
$flashvid.flv :sout=#transcode{acodec=mp3,ab=320,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=
$flashvid.Fullname.mp3}} vlc:quit)"
}


ERROR MSG...

Invoke-Expression : Unexpected token ')' in expression or statement.
At C:\scripts\Powershell\Com\ConvertFlashVidsToMp3.ps1:17 char:19
+ Invoke-Expression <<<< "C:\Program Files\VideoLAN\VLC\vlc.exe F:
\Music\Ripping\$flashvid.flv :sout=#transcode{ac
odec=mp3,ab=320,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=export.mp3}}
vlc:quit)"

My System SpecsSystem Spec
Old 04-24-2008   #2 (permalink)
stephenodonoghue


 
 

Re: Convert Flash Vids to mp3

The original idea was taken from this blog post:

How to extract audio from FLV files using VLC
http://blog.hartwork.org/?p=58
My System SpecsSystem Spec
Old 04-24-2008   #3 (permalink)
Marco Shaw [MVP]


 
 

Re: Convert Flash Vids to mp3

stephenodonoghue@xxxxxx wrote:
Quote:

> I've been trying to hack together a Powershell script to use VLC media
> player to extract an mp3 from a downloaded flash video. The problem
> I've been having is with supplying the command line arguments to
> vlc.exe. No matter how I teak it, nothing seems to work. I've posted
> the latest error at the end of the post.
>
> $VlcPath = "& 'C:\Program Files\VideoLAN\VLC\VLC.exe' "
> cd "F:\Music\Ripping"
> $flashvids = Get-ChildItem * -Include *.flv -Recurse
> foreach ($flashvid in $flashvids)
> {
> $newFileName = ($flashvid -replace "\.flv", "\.mp3")
> $cmdline = ("'" + $flashvid.FullName +
> '":sout=#transcode{acodec=mp3,ab=320,channels=2}' + '"')
> Invoke-Expression "C:\Program Files\VideoLAN\VLC\vlc.exe F:\Music
> \Ripping\
> $flashvid.flv :sout=#transcode{acodec=mp3,ab=320,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=
> $flashvid.Fullname.mp3}} vlc:quit)"
With PSCX (www.codeplex.com/powershellcx), there's an echoargs.exe
utility that can help you determine how PowerShell will parse stuff.

Just one question... Are you sure there's a closing ")" at the end of
that command? I don't see an opening one, which seems odd.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 04-24-2008   #4 (permalink)
stephenodonoghue


 
 

Re: Convert Flash Vids to mp3

On the line with Invoke-Expression? It may have been that way
originally. But I've done so much mucking around with it, that I can't
say for certain.
My System SpecsSystem Spec
Old 04-24-2008   #5 (permalink)
Marco Shaw [MVP]


 
 

Re: Convert Flash Vids to mp3

Quote:

> Invoke-Expression "C:\Program Files\VideoLAN\VLC\vlc.exe F:\Music
> \Ripping\
> $flashvid.flv :sout=#transcode{acodec=mp3,ab=320,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=
> $flashvid.Fullname.mp3}} vlc:quit)"
> }
How about simplifying this and providing us the DOS command string that
would actually work on a single file?

I'd get the program (if free or a demo is available), but I'm short on
free time these days to go that far.

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Convert flash files(*.swf) to mov on Vista?? Software
Video not available, cannot find 'vids:lv50' decompressor Vista music pictures video
convert avi to flash Software
save youTube vids ? Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46