Lua error on macOS: '=' expected near 'continue'
tnychn opened this issue · comments
The following error message appears when I run mpv --script=360plugin.lua --script-opts=360plugin-enabled=yes myvideo.mp4
:
[360plugin]
[360plugin] stack traceback:
[360plugin] [C]: ?
[360plugin] [C]: ?
[360plugin] Lua error: [string "360plugin.lua"]:613: '=' expected near 'continue'
The script is fetched using wget https://raw.githubusercontent.com/dfaker/VR-reversal/master/360plugin.lua
and is left unmodified since then.
Perhaps this is a syntax error caused by mpv using an old version of lua?
Though I have lua 5.4.4
installed already through homebrew.
> mpv --version
mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
built on Sat Jan 8 16:50:23 CET 2022
FFmpeg library versions:
libavutil 56.70.100
libavcodec 58.134.100
libavformat 58.76.100
libswscale 5.9.100
libavfilter 7.110.100
libswresample 3.9.100
FFmpeg version: 4.4.1
OS: macOS 11.4 Big Sur
Machine: Macbook Pro 2016 (Intel)
mpv cask installed through homebrew
Seemingly the homebrew version is compiled with luajit-openresty 2.1-20220411 which most likely doesn't support goto, I'll see what refactors are possible.
The syntax error is now fixed but a new error appears when running the same command:
Passing more than 1 argument to vf-add is deprecated!
(+) Video --vid=1 (*) (h264 4096x2048 29.970fps)
(+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[lavfi] AVOption 'reset_rot' not found.
[user_filter_wrapper] Creating filter 'v360' failed.
Video: no video
Exiting... (Errors when loading file)
That's caused by a breaking change in the way libav implements the v360 filter, this repo only supports the current calling conventions.
Since homebrew seems to be a little old, I'd suggest using a binary from here: https://laboratory.stolendata.net/~djinn/mpv_osx/