smplayer-dev / smplayer

Free Media Player for Windows, Linux and Mac OS with YouTube support.
https://smplayer.info
GNU General Public License v2.0
681 stars 94 forks source link

LUT support #1068

Open efati opened 1 month ago

efati commented 1 month ago

I would love to have direct support for LUT-s (3D lookup tables) in SMPlayer. Currently it is possible to load them by modifying Preferences –> Advanced –> MPlayer/mpv –> Options:

--lut=/path/to/my.cube

However, you cannot assign a keyboard shortcut to dynamically activate a given LUT.

On the other side: it would be very convenient to have also a command line switch to activate a specific LUT.

mrfragger commented 2 weeks ago

I have 550 LUTs in mpv..here's a small sample of LUTs to give you an idea.

input.conf Ctrl+Alt+1 script-message cycle-profiles 'abigailgonzalez blade runner' 'abigailgonzalez blue house' 'abigailgonzalez blue ice' 'abigailgonzalez caribe' 'abigailgonzalez cinema 02' 'abigailgonzalez cinema 03' 'abigailgonzalez cinema 04' 'abigailgonzalez cinema 05' 'abigailgonzalez cinema noir' 'abigailgonzalez cinema' 'abigailgonzalez cinematic for flog' 'abigailgonzalez day 4nite' 'abigailgonzalez eterna for flog' 'abigailgonzalez filmic' 'abigailgonzalez fuji hdr' 'abigailgonzalez goldengate' 'abigailgonzalez matrix' 'abigailgonzalez monochrome 01' 'abigailgonzalez monochrome 02' 'abigailgonzalez old west' 'abigailgonzalez science fiction' 'LUT NONE' #! [Video/Image] > [LUTs 1] > Abigail Gonzalez

c-A script-message-to encodelut set-timestamp ENCODE_mp4_softsubsx265 #! [Editing] > [ENCODE LUT no rescaling] > soft subs mp4 x265 opus32k c-B script-message-to encodelut set-timestamp ENCODE_mp4_softsubsx264 #! [Editing] > [ENCODE LUT no rescaling] > soft subs mp4 x264 aac128k c-C script-message-to encodelut set-timestamp ENCODE_mkv_softsubsx265 #! [Editing] > [ENCODE LUT no rescaling] > soft subs mkv x265 opus32k c-D script-message-to encodelut set-timestamp ENCODE_mkv_softsubsx264 #! [Editing] > [ENCODE LUT no rescaling] > soft subs mkv x264 aac128k c-E script-message-to encodelut set-timestamp ENCODE_mp4_softsubsx265videotoolbox #! [Editing] > [ENCODE LUT no rescaling] > soft subs mp4 x265 passthru audio c-F script-message-to encodelut set-timestamp ENCODE_mkv_softsubsx264videotoolbox #! [Editing] > [ENCODE LUT no rescaling] > soft subs mkv x264 passthru audio

mpv.conf

[LUT NONE]
lut=''
#LUT Lookup Tables video/images GMIC
[abigailgonzalez blade runner]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez blade runner.cube' 
[abigailgonzalez blue house]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez blue house.cube' 
[abigailgonzalez blue ice]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez blue ice.cube' 
[abigailgonzalez caribe]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez caribe.cube' 
[abigailgonzalez cinema 02]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema 02.cube' 
[abigailgonzalez cinema 03]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema 03.cube' 
[abigailgonzalez cinema 04]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema 04.cube' 
[abigailgonzalez cinema 05]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema 05.cube' 
[abigailgonzalez cinema noir]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema noir.cube' 
[abigailgonzalez cinema]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinema.cube' 
[abigailgonzalez cinematic for flog]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez cinematic for flog.cube' 
[abigailgonzalez day 4nite]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez day 4nite.cube' 
[abigailgonzalez eterna for flog]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez eterna for flog.cube' 
[abigailgonzalez filmic]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez filmic.cube' 
[abigailgonzalez fuji hdr]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez fuji hdr.cube' 
[abigailgonzalez goldengate]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez goldengate.cube' 
[abigailgonzalez matrix]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez matrix.cube' 
[abigailgonzalez monochrome 01]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez monochrome 01.cube' 
[abigailgonzalez monochrome 02]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez monochrome 02.cube' 
[abigailgonzalez old west]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez old west.cube' 
[abigailgonzalez science fiction]
profile-restore=copy-equal
lut='~/.config/mpv/lut/abigailgonzalez/abigailgonzalez science fiction.cube'

then for encoding LUTs into video use encodelut.lua (just part of it)

  -- LUT3D cube filter
        local homedir = os.getenv("HOME")
        local lut = string.format("%s", mp.get_property_osd("lut"))
        local lutnew = string.gsub(lut, "~", "")
        local lutuserpath = "lut3d=" .. homedir .. lutnew
        local settings = {
            detached = true,
            container = "",
            only_active_tracks = false,
            preserve_filters = true,
            append_filter = lutuserpath,
            codec = "",
            output_format = "$f_$n.mp4",
            output_directory = "",
            ffmpeg_command = "ffmpeg",
            print = true,
        }
mrfragger commented 2 weeks ago
image
mrfragger commented 2 weeks ago
image