hudec117 / Mpv.NET-lib-

.NET embeddable video/media player based on mpv for WinForms and WPF
MIT License
138 stars 36 forks source link

cannot run --external-file,--lavfi-complex command #14

Closed leichenxu closed 5 years ago

leichenxu commented 5 years ago

hi, i am trying to display multiple video in one mpv, but i am not able to run --external-file,--lavfi-complex this two command, i try with SetPropertyString but no work, also tried with change path to the command line, but not work too, hope get some help, thanks

leichenxu commented 5 years ago

i have been trying to use other commands, use --external-files work, but --lavfi-complex still dont work

leichenxu commented 5 years ago

i am trying to run comman like this .\mpv.com video1.mp4 --external-file video1.mp4 --external-file video1.mp4 --external-files video1.mp4 --lavfi-complex '[vid1] [vid2] hstack [t1];[vid3] [vid4] hstack [t2];[t1] [t2] vstack [vo]'

hudec117 commented 5 years ago

Hello @leichenxu

Those are properties which can be set using the SetPropertyString method through the API property on the player.

Like this:

// Duplicate this line for each extra video to load, this is vid2
player.API.SetPropertyString("external-files", "video1.mp4");
//player.API.SetPropertyString("external-files", "video1.mp4"); vid 3
//player.API.SetPropertyString("external-files", "video1.mp4"); vid 4

// Set the filter (for some reason, your one doesn't work)
player.API.SetPropertyString("lavfi-complex", "[vid1] [vid2] vstack [vo]");

// Load first video, this is vid1
player.Load("video1.mp4");
player.Resume();

I'm unfamiliar with the formatting for the lavfi-complex property so I'm unable to help you fix your filter. The filter used in the code above does work which shows the property is set correctly.