jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
543 stars 68 forks source link

Greyscale conversion support #163

Closed luisarandas closed 1 year ago

luisarandas commented 3 years ago

Hello!

I'm not really sure if this is an issue/request/doubt, and for that I'm sorry in advance.

Does python-mpv support video greyscale conversion? I'm trying to play all the videos in monochromatic without really going through cv2 frame by frame.

And if not is there any way around this? It doesn't seem very efficient in terms of computation doing something like that in the main thread.

Thanks in advance.

neinseg commented 3 years ago

Hey there!

python-mpv does not have anything built-in. However, the underlying libmpv has full support for ffmpeg filters, link to doc. This stackoverflow post has details on desaturating using ffmpeg. In python-mpv you can apply this by passing vf="hue=s=0" to the MPV constructor.

I hope that helps!

luisarandas commented 3 years ago

Thank you very much @neinseg. Worked perfectly