georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
842 stars 108 forks source link

How to set result/input to an absolute file path? #66

Closed Selur closed 5 years ago

Selur commented 5 years ago

when calling:

"I:\Hybrid\64bit\ffmpeg.exe" -y -threads 8 -i "F:\TestClips&Co\files\test.avi" -map 0:0 -c:v rawvideo -vf vidstabdetect=result="E:/Temp/18_11_50_9710_01.trf":shakiness=5:accuracy=15:stepsize=6:mincontrast=0.3 -f null NUL

I get:

[vidstabdetect @ 000001ffd65476c0] [Eval @ 000000f3b79fd9c0] Undefined constant or missing '(' in '/Temp/18_11_50_9710_01.trf'
[vidstabdetect @ 000001ffd65476c0] Unable to parse option value "/Temp/18_11_50_9710_01.trf"
[vidstabdetect @ 000000f3b79fe158] Multithreading: use 12 threads
[vidstabdetect @ 000000f3b79fe0c8] Fieldsize: 48, Maximal translation: 50 pixel
[vidstabdetect @ 000000f3b79fe0c8] Number of used measurement fields: 40 out of 40
[vidstabdetect @ 000000f3b79fe0c8] Fieldsize: 16, Maximal translation: 16 pixel
[vidstabdetect @ 000000f3b79fe0c8] Number of used measurement fields: 162 out of 162
[Parsed_vidstabdetect_0 @ 000001ffd652cf80] Video stabilization settings (pass 1/2):
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]      shakiness = 5
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]       accuracy = 15
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]       stepsize = 6
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]    mincontrast = 0.300000
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]         tripod = 0
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]           show = 0
[Parsed_vidstabdetect_0 @ 000001ffd652cf80]         result = E

and the '18_11_50_9710_01.trf' file won't be created.

So how should one set the file path for 'result' (same for 'input')?

georgmartius commented 5 years ago

Hi, it seems ffmpeg gets confused by the ":" in the file path. I never tried it on Windows. Try a relative path first. Then try to escape the : maybe with E\:/Temp...

Selur commented 5 years ago

Using slashes instead of backslashes and escaping doesn't work either. Relative paths work, but cages me to a drive. I could mount another drive to a folder relative to the current working directory, but that definitely isn't the proper way to handle this. -> would be nice if you could adjust your code to handle Windows path syntax.

georgmartius commented 5 years ago

this is not part of the vidstab code, but ffmpeg's option handling. The : is used to separate the options not sure any escaping is supported there. Can you go and ask at the ffmpeg mailing list and report back. Also take a look at windows command line escaping with "" (double quotation marks), see https://ss64.com/nt/syntax-esc.html

Selur commented 5 years ago

Sadly adding additional double quotes doesn't help. -> In case I'll figure this out I'll report back so others don't have to look for this too long.

Selur commented 5 years ago

Got it:

"I:\Hybrid\64bit\ffmpeg.exe" -y -threads 8 -i "F:\TestClips&Co\files\test.avi" -map 0:0 -c:v rawvideo -vf vidstabdetect=result='E\:/Temp/18_11_50_9710_01.trf':shakiness=5:accuracy=15:stepsize=6:mincontrast=0.3 -f null NUL

-> single ticks + escaping the colon with a backslash and using slashes works

thinrope commented 5 years ago

Yup! @Selur, please consider closing this issue.