[FFmpeg-user] Subtitle filter and filename with quotes and spaces
Ramit Bhalla
ramitbhalla at gmail.com
Mon Jan 20 21:57:13 CET 2014
Thanks James, you're a genius. It worked! I was really losing my mind
trying to figure this one out.
You're right, it's kinda stupid but that what it is, you need to escape the
\ : and ' and the those slashes need to be reescaped!
I wonder if there's are any other special characters that ffmpeg requires
to be escaped apart from \ : and '
On Mon, Jan 20, 2014 at 3:25 PM, Pavel Koshevoy <pkoshevoy at gmail.com> wrote:
>
> On 1/20/2014 12:28 PM, James Darnley wrote:
>
>> On 2014-01-20 19:39, Ramit Bhalla wrote:
>>
>>> Okay will try it. But then help me understand a simple quotes around the
>>> path and file works fine for the -i parameter. No escaping etc.
>>>
>> Sorry to invalidate everyone's previous work here but this problem is is
>> the fault of ffmpeg and libavfilter's escaping hell!
>>
>> Windows correctly passes your command line to ffmpeg. The problem comes
>> when ffmpeg tries to parse the filename. ':' separates options
>> for filters so you need to escape that. '\' (backslash) in the filename
>> also need to be escaped. ffmpeg's escape character is '\' (backslash).
>> This means that the filename for the subtitle filter needs to be, with
>> the quotes:
>>
>>> "D\\:\\\\MCEBuddy\\\\MCEBuddy 2.x\\\\MCEBuddy.ServiceCMD\\\\
>>> bin\\\\x86\\\\Debug\\\\working0\\\\HD Small\\\'.srt"
>>>
>> And the full command line:
>>
>>> C:\Users\James>ffmpeg.exe -loglevel verbose -probesize 100M
>>> -analyzeduration 300M -threads 0 -drc_scale 0.8 -y -i "D:\MCEBuddy\MCEBuddy
>>> 2.x\MCEBuddy.ServiceCMD\bin\x86\Debug\working0\HD Small'.ts" -ss 3 -vf
>>> yadif=0:-1:1,hqdn3d,crop=1920:1072:0:4,scale=720:400,
>>> subtitles="D\\:\\\\MCEBuddy\\\\MCEBuddy 2.x\\\\MCEBuddy.ServiceCMD\\\\
>>> bin\\\\x86\\\\Debug\\\\working0\\\\HD Small\\\'.srt" -vcodec libx264 -b
>>> 1400000 -x264opts me=hex:trellis=1:subq=8:partitions=all:8x8dct=1:ref=3:
>>> rc-lookahead=50:keyint=25:min-keyint=20:bframes=1:weightb=1:
>>> level=4.0:b-pyramid=normal:direct=auto:mixed-refs=1:
>>> deblock=-1,-1:no-fast-pskip=1:no-dct-decimate=1:b-adapt=0:threads=auto
>>> -sn -acodec libfdk_aac -ab 256k -cutoff 18000 -ac 2 "D:\MCEBuddy\MCEBuddy
>>> 2.x\MCEBuddy.ServiceCMD\bin\x86\Debug\working0\HD Small'-converted.mp4"
>>>
>>
>
> I am sorry to have mislead Ramit earlier. I've used the ^ escape sequence
> myself in a batch file (not with ffmpeg), so I know it works for me.
>
> However, I tried dir C:\Program^ Files\ and it didn't work, so my
> suggestion was wrong.
> Still, I've googled this up just now, maybe it will help:
> http://www.robvanderwoude.com/escapechars.php
>
> Sorry for causing the confusion,
> Pavel
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
More information about the ffmpeg-user
mailing list