Page 1 of 1

Problem with file paths using lavfi filter

Posted: Sun Apr 28, 2019 11:14 pm
by at2010
Hi. on windows 10 x64 command window.
using Zeranoe static ffmpeg 64 builds from version N-93506-g27c94c57dc (190331) and N-93649-gd0ca749adb (190424).

I am trying to extract Closed Captions EIA-608 from a video stream.
This works:

Code: Select all

ffmpeg.exe  -f lavfi -i movie="input.mkv"[out0+subcc] -map s output.srt
and this works:

Code: Select all

ffmpeg.exe  -f lavfi -i movie="/temp/input.mkv"[out0+subcc] -map s output.srt
However when I use a drive + path in the movie, it fails:

Code: Select all

ffmpeg.exe  -f lavfi -i movie="c:\temp\input.mkv"[out0+subcc] -map s output.srt
[Parsed_movie_0 @ 000001baa82fa580] Failed to avformat_open_input 'c'
[lavfi @ 000001baa82f8bc0] Error initializing filter 'movie' with args 'c:tempinput.mkv'
movie=c:\temp\input.mkv[out0+subcc]: No such file or directory

Code: Select all

ffmpeg.exe  -f lavfi -i movie="c:\\temp\\input.mkv"[out0+subcc] -map s output.srt
[Parsed_movie_0 @ 000002170bcda580] Failed to avformat_open_input 'c'
[lavfi @ 000002170bcd8bc0] Error initializing filter 'movie' with args 'c:\temp\input.mkv'
movie=c:\\temp\\input.mkv[out0+subcc]: No such file or directory

Code: Select all

ffmpeg.exe  -f lavfi -i movie="c:/temp/input.mkv"[out0+subcc] -map s output.srt
[Parsed_movie_0 @ 000002bf7731a580] Failed to avformat_open_input 'c'
[lavfi @ 000002bf77318bc0] Error initializing filter 'movie' with args 'c:/temp/input.mkv'
movie=c:/temp/input.mkv[out0+subcc]: No such file or directory

it doesn't seem to matter where the double quotes are. e.g.
movie="c:\temp\input.mkv[out0+subcc]"
"movie=c:\temp\input.mkv[out0+subcc]"

Have I done something wrong?
Any help appreciated.

Re: Problem with file paths using lavfi filter

Posted: Tue May 07, 2019 7:02 pm
by at2010
I found a solution. I wasn't using enough escape slashes.

At least 3 characters and maybe others need to be escaped with 3 backslashes. The colon, the backslash and the apostrophe
: -> \\\:
\ -> \\\\
' -> \\\'
BUT a comma is escaped with only 1 backslash
, -> \,

Sample line (won't work)
ffmpeg.exe -f lavfi -i movie="c:\temp\It's a test, part 1.mkv"[out0+subcc] -map s "c:\temp\It's a test, part 1.srt"

Escaped line should work (as of 2019-05-07):

Code: Select all

ffmpeg.exe  -f lavfi -i movie="c\\\:\\\\temp\\\\It\\\'s a test\, part 1.mkv"[out0+subcc] -map s "c:\temp\It's a test, part 1.srt"
This is really ugly. I would hope that the parameter hand-off to the lavfi filter is improved so the escape sequences can be avoided in the future.

Re: Problem with file paths using lavfi filter

Posted: Tue May 07, 2019 11:06 pm
by Reino
at2010 wrote:
Sun Apr 28, 2019 11:14 pm

Code: Select all

ffmpeg.exe  -f lavfi -i movie="c:\temp\input.mkv"[out0+subcc] -map s output.srt

Code: Select all

"c\:\\temp\\input.mkv"
or

Code: Select all

"c\:/temp/input.mkv"
is enough.