Closed Manvendra-div closed 2 years ago
Hi, you can add them like this.
mpv.MPV(ytdl=True, script_opts=('force-window image-display-duration=inf vid=1 song_name.mp3')"
I thing... check the scrip_opts
is the same option as mpv in command line.
and what about
--external-file=image.jpg
I guess you can add this as well ... I am not sure of the syntax but this is the way.
Hi there,
an earlier commenter was confused by the issue title and suggested script-opts
. This is not what you need. script-opts
is only for options passed to e.g. lua scripts run inside mpv, and is not used for normal mpv command-line options.
All of the options you listed are mpv built-in options and can be passed as parameters to the constructor. Just replace the dashes ("-") with underscores ("_") like this: player = mpv.MPV(force_window=True, image_display_duration="inf", ...)
.
external-file
is a bit special: the doc says that external-file
is a cli/config only alias for external-files
(note the plural "s" at the end), so in your script you will have to use external_files=["...", ...]
instead. Also, since this option only makes sense for a single playlist item, you might want to pass it to loadfile
instead of the constructor, as in player.loadfile(..., external_files=["..."])
. This way it will only affect that one file.
My mistake sorry i miss understood.
So the syntax will be player.loadfile(external_files='image.jpg')
I thing this is correct syntax, i do not know what are you trying to do though.
i was using mpv to play songs, and i use command like
mpv --external-file=image.jpg --force-window --image-display-duration=inf --vid=1 song_name.mp3
and i wanted to automate this commands by using python and i decided to use python-mpv so how to do that