[FFmpeg-user] Subtitle filter and filename with quotes and spaces

James Darnley james.darnley at gmail.com
Mon Jan 20 20:28:55 CET 2014


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"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 683 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140120/bb08ba79/attachment.asc>


More information about the ffmpeg-user mailing list