Maybe 1 for fullscreen clips with a chromakey filter, a regular fullscreen clip fo speciual event clips, and maybe ones for subscriber "intro clips" they use when they join chat to announce their presence in style. The fact that you can title the player window allows a streamer to have a few different windows captures set up. if a streamer wants to rotate 8 different "Hug" clips when a viewer runs the "!hug command in chat, there should be a utility that can launch the clips when the commands are run, then rotate the clips so if 4 or 5 people use the "Hug" command to hug each other, it doesn't just play the same clip over and over. I am just doing this for fun, and to help streamers offer a little something extra. I take chat commands that create a text semaphore/trigger file, and when the script sees the trigger, it uses this Mplayer utility to play. I use it for some custom clip management and window capture for streamers to use when broadcasting using the OBS Studio streaming/broadcasting software on Twitch. SendCommand function will perform the task of sending commands to mplayer process.I needed a simple command-ling media player, and this was perfect! Extremely lightweight and very versatile. We can send commands to mplayer to control the file that is being played. CDP is declared as string for adding argument to play CD. timer2 interval will be 1s to 3s, otherwise if less, sometimes it will not work. timer2 for activating effect if pre-selected. For special purposes, timer1 is used and I will discuss later. So, ps.Kill in try catch used that if the process has already exited or not started, the error does not show. Ps.StartInfo.Arguments = args & " """ & OpenFileDialog1.FileName & " " " "Įnd Sub ' stp() procedure :- Public Sub stp()įirst, we want to make sure that any previous instance of mplayer started by us is closed. & TrackBar1.Value & " -nomouseinput -sub-fuzziness 1 -vo direct3d, -ao dsound -osdlevel _Ġ -wid " & CInt(32) & CDP If OpenFileDialog1.ShowDialog = ThenĮnd If ' mplay() procedure :- Public Sub mplay()Īrgs = " -nofs -noquiet -identify -slave -af-add equalizer=0:0:0:0:0:0:0:0:0:0 -volume " _ When user clicks on open file, a dialog will open and after a file is selected, mplayer will run that file. So that we do not need timer to read mplayer's each line after 1 ms continuously. We used BackgroundWorker1 because we want to run mplayer on a separate way. af-add equalizer=0 : 0 : 0 : 0 : 0 : 0 : 0 : 0 : 0 : 0 used for giving audio effects command. Here we want to display in Panel1, so we get its handle and pass it after -wid. wid option will tell the id of window where we want to display video output. nofs option for not to run in full screen mode. We will use " -slave" option because we want to run mplayer in 'slave' mode where it will read commands from another process and do actions accordingly. ps is the process object which will use it to keep a reference to the mplayer process. Here, args will hold the arguments that will be passed to process except file name. Ps.StartInfo.RedirectStandardOutput = True Ps.StartInfo.RedirectStandardInput = True ' To declare Variables :- Dim args, time_length, time_pos, buffer, CDP As String Dim posh, tdr As Longĭim ps As Process = Nothing ' To initialize process :. Here is the code that we use to declare variables and initialize process:ĭelegate Sub ChangeTextsSafe( ByVal percent As String) We'll redirect input & output so that we can send commands to mplayer and get information about the file. We will use Process class of System.Diagnostics namespace to launch an instance of mplayer to play files. Process object, Window handle control, Input and Output redirection. C++ examples that were found to control mplayer but it is more easy and reliable if we use VB.NET program. There were no previous examples of how to use mplayer to play audio or video in VB.NET winform application. It can play audio or video file using several different output drivers. Mplayer is a command line audio & video player. At first, we need mplayer.exe in our main application's start path. Downloaded source code is sample part of Veron Media Player 1.9. This article will demonstrate how we can use mplayer to easily control in VB.NET WinForm application without using any COM/ActiveX control.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |