0

I have my video in the following locaton with spaces on Windows.

"c:\GoogleDrive\CMD Scripts_video\test.mp4"

MPV function in Lua script returns cut path with special characters ~1

video_path = mp.get_property("path")

"c:\GOOGLE~1\CMDSCR~1_video\test.mp4"

How can I get on Windows full path to use it as input for FFMPEG in my LUA script?

Thank you Peter

user2432166
  • 151
  • 1
  • 8
  • Your 8.3-style path `c:\GOOGLE~1\CMDSCR~1_video\test.mp4` is absolutely valid and can be passed to any program. Windows guarantees 8.3-style path is equivalent to "normal" path. There is no reason to convert it. – Egor Skriptunoff Aug 14 '18 at 16:53
  • But FFMPEG throws following error with this 8.3 style path as input: (Paused) AV: 00:00:02 / 00:00:09 (28%) A-V: 0.000 [slicing] "C:\GoogleDrive\CMD Scripts_video\files\FFmpegAviSynthPlus64\ffmpeg.exe" -v warning -i "c:\GOOGLE~1\CMDSCR~1\test.mp4" out.avi 'C:\GoogleDrive\CMD' is not recognized as an internal or external command, operable program or batch file. – user2432166 Aug 15 '18 at 10:11

1 Answers1

1

8.3-style path is absolutely valid in Windows.
The error is raised by wrong quotation.

The correct way to invoke external command on Windows is the following:

""C:\GoogleDrive\CMD Scripts_video\files\FFmpegAviSynthPlus64\ffmpeg.exe" -v warning -i "c:\GOOGLE~1\CMDSCR~1\test.mp4" out.avi"

Please note quotes around argument, quotes around executable file path and quotes around the whole command (yes, Windows does need it).

os.execute([[""program" "arg1" "arg2""]])
Egor Skriptunoff
  • 906
  • 1
  • 8
  • 23