0

I am using mplayer in slave mode (VB.NET).

I used "-fs -noquiet -identify -slave -nomouseinput -sub-fuzziness 1 -vo direct3d, -ao dsound ".

    ps = New Process()
    ps.StartInfo.FileName = "D:\Music\mplayer.exe "
    ps.StartInfo.UseShellExecute = False
    ps.StartInfo.RedirectStandardInput = True        
    args = "-fs  -noquiet -identify -slave " '
    args += "-nomouseinput -sub-fuzziness 1 "
    args += " -vo direct3d, -ao dsound "
    Try
        ps.Kill()
    Catch
    End Try
    Try
        ps.StartInfo.Arguments = args + " """ + Songfilelocation + """"
        ps.Start()

        SendCommand("set_property volume " + "80")
    Catch e As Exception
        MessageBox.Show(e.Message)
    End Try

I can send slave mode command as follow..

     Public Function SendCommand(ByVal cmd As String) As Boolean
     Try
        If ps IsNot Nothing AndAlso ps.HasExited = False Then
            ps.StandardInput.Write(cmd + vbLf)
            'MessageBox.Show(ps.StandardOutput.ReadToEndAsync.ToString())
            Return True
        Else
            Return False
        End If

     Catch ex As Exception
        Return False
     End Try
   End Function

Slave mode commands I used are

"stop"

"pause"

"quit"

"mute"

and much more.

But I don't know how to play series of jpg files like slide show. And mplayer need a delay time about 2s to play a video file. I want to play jpg file slide show in that 2s gap. I think I should create another process of mplayer and play image slide show. but dont know how to do it.

Another question is I would like to play mp3 file while playing image slide show. I am using Windows 8.1 and Visual Studio 2010. Please help me answer the questions.

Blue Phoenix
  • 153
  • 11
  • Are you passing a `-wid` param to MPlayer that has a handle to some control on that will display the video output...like a picturebox or panel? And if so, you can just use vb.net graphics functionality to paint your jpg slide show on that same control. – Chase Rocker Apr 07 '16 at 19:45
  • Wow, great tip Sir, Would you mind please show me some example since I am just a beginner in this field Sir. Actually I am not using -wid param now. I am showing mplayer as standalone process with full screen only. – Blue Phoenix Apr 09 '16 at 01:43
  • I'll give you a quick example of how I do it: Add a picturebox control to your form. Set its backcolor to (2,2,2). The reason for that is, you have to pass a color to mplayer so it knows which color to mask out on the control to display the video and you probably want something that's not used elsewhere so instead of black, I use (2,2,2). Then you need to pass two additional params to Mplayer: `"-colorkey 0x020202 -wid " & CInt(YourPictureBoxControlName.Handle.ToInt32)` – Chase Rocker Apr 09 '16 at 02:15
  • Thank you so much for your example Sir! I will try and report soon. – Blue Phoenix Apr 09 '16 at 02:36

0 Answers0