Can't use paths with spaces in them?

For the developers that use FFmpeg in their software.
Post Reply
VidBits
Posts: 11
Joined: Sun Jul 29, 2012 9:15 pm

Can't use paths with spaces in them?

Post by VidBits » Thu Aug 02, 2012 11:53 pm

Is that true that I can't pass arguments with spaces in them? When I tried with spaces around it failed, when i try without spaces around the name it fails ?

ramiro
Posts: 157
Joined: Tue May 10, 2011 12:56 am

Re: Can't use paths with spaces in them?

Post by ramiro » Fri Aug 03, 2012 2:56 am

use quotes (' or ")

VidBits
Posts: 11
Joined: Sun Jul 29, 2012 9:15 pm

Re: Can't use paths with spaces in them?

Post by VidBits » Fri Aug 03, 2012 12:36 pm

Where I wrote spaces i meant "

Ie I have tried with " and that didn't work.
I'll try with ' now ...

VidBits
Posts: 11
Joined: Sun Jul 29, 2012 9:15 pm

Re: Can't use paths with spaces in them?

Post by VidBits » Fri Aug 03, 2012 1:20 pm

And ' doesn't work, it says invalid argument.


Line is:

Code: Select all

ffmpeg64  -i   "%1"  -vcodec copy -acodec copy "%~dpn1.mkv"
Say i drop a file called "a file name.avi" on the batch file, the output becomes:

"a: No such file or directory"

Its also worth nothing that the batch file echos the line as

Code: Select all

ffmpeg  -i   ""H:\Twit\flv\a file name.flv""  -vcodec copy -acodec copy "H:\Twit\flv\a file name.mkv"
Ie for some reason there are two " around the name in the first invocation.


However typing this up like has worked as a sort of troubling shooting list

Seems NOT using double quotes on the first invocation but on the second works, ie:

code]ffmpeg64 -i %1 -vcodec copy -acodec copy "%~dpn1.mkv"[/code]

Now works.


Guess the Win7 batch system is inconsistent about what it inserts

rogerdpack
Posts: 1878
Joined: Fri Aug 05, 2011 9:56 pm

Re: Can't use paths with spaces in them?

Post by rogerdpack » Fri Aug 03, 2012 3:35 pm

if you use %1 you shouldn't need quotes around it I don't believe...

Post Reply
'