Stop recording in vlc pugin - vlc

I use VLC plugin to show live stream and then record from my server and save it into a file.
when i start record, i choose the time of record and i use it into "--run-time" and the record still to this time, it's ok.
but if i choose a time for record, i can't stop it till it finish the time.
so please, do you have any solution how i can Stop recording in vlc pugin and stop the execution of the command before the finish of the run-time if i need this ?
regards,

Mr Hassan, you can do that via TELNET interface.
Basically you set the option -I telnet and --telnet-password in the command you are using to start the VLC (supposing you are using command line). When you want to stop the connection you make a TELNET connection to port 4212 and you are able to stop recording.

Related

VLC How to clear playlist on windows / play local music from streamdeck with VLC

I have found the answer myself but I am documenting this for myself in the future or for other fellow content creators in case if I would ever forget it.
What I would like to achieve in the grand scheme of things is to play music that is locally stored on my computer on stream. I want the ability to change moods based on a button that is configured on my stream deck. Currently no plugins in the stream deck allow this (I do not count Spotify) so I am going custom.
The best tool for the job is VLC. They have a command line that can be used. I have considered things like media player or groove music but there is no support.
What I need to do is:
Open VLC
Add my specific playlist to the player
Whenever I click another button on my stream deck, clear the playlist, add that specific playlist.
VLC command line is documented here: https://wiki.videolan.org/VLC_command-line_help/
Do a CTRL+F on that page for the word: "Clear" and you will find there is no command for clearing a playlist that is currently playing.
How did I solve this? --> Powershell. (see answer below)
THE ANSWER:
You need to configure a global key that can be pressed anywhere to clear the playlist. This enables you to clear a playlist without being focused in the VLC window. This setting is configured during the startup of VLC. Then send a key stroke of the key you just configured. This is done by adding the following attribute:
--global-key-clear-playlist='CTRL+W' You can choose your own keys to your liking by changing CTRL+W to what you desire.
Example command:
Powershell.exe cd 'C:\Program Files\VideoLAN\VLC\';./vlc.exe --loop -Z --global-key-clear-playlist='CTRL+W' --one-instance --directx-device="DISPLAY1" --directx-volume=1.00 '"Path\To\Your\Playlist\playlist.m3u'"
Once VLC has started this way, send over a key stroke for example, through PowerShell, to press the key.
Example command:
powershell.exe $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{w}');
If you want to send over other kind of keys, check out the following stack overflow article: How to send CTRL or ALT + any other key? OR the official documentation: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ff731008(v=technet.10)?redirectedfrom=MSDN
The ';' means end the current code line and start a new line. Then read that line and execute what is written. This can be used to write down multiple commands that have to be executed in PowerShell even though you can only write down one line of text in your solution. (mine being the stream deck)
If you are a streamer or youtuber using the stream deck, keep reading. Otherwise above is the answer and you can adapt it to your needs with the above logic.
STEP BY STEP GUIDE IF YOU ARE A STREAM DECK USER:
I have my stream deck configured with the following commands:
a multi action button. Inside the multi action button I have 2 tasks:
Clear Playlist --> Open program action. (the rocket)
Add playlist. --> Open program action. (the rocket)
For the first action I have the following command in the App / file section:
powershell.exe $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{w}');
--> This will send over the key stroke CTRL + W. In case you don't have anything open or you have not started VLC yet because this is your first press, this has no effect.
The second action is adding the playlist to VLC. This is done with the following command:
Powershell.exe cd 'C:\Program Files\VideoLAN\VLC\';./vlc.exe --loop -Z --global-key-clear-playlist='CTRL+W' --one-instance --directx-device="DISPLAY1" --directx-volume=1.00 '"Path\To\Your\Playlist\playlist.m3u'"
--> This command will navigate to the directory where VLC is installed. It will then open vlc with the attributes:
--loop --> Loop all music without stopping
-Z --> Randomize every play and next play
--global-key-clear-playlist --> The key stroke that can be pressed, no matter what window you are focused in
--one-instance --> Only one instance of VLC can run at a time, forcing every vlc.exe command to go to the same instance
--directx-device="DISPLAY1" --> My display where I want VLC to appear. You can find this under the settings: Tools > Preferences > Video > Full screen
-volume=1.00 --> The volume that will be used.
HOW TO ROUTE AUDIO TO A SPECIFIC AUDIO DEVICE IN VLC
For some people that have a GO-XLR or any special device they want to route their music to, open up the GUI of VLC first, navigate to: Tools > Preferences > Audio
Change the device you want VLC to output to. I have tried forcing it through windows 10 settings but it did not seem to work every time I restarted the computer.
If you are a stream deck user:
First of all, enable remote control of VLC. You do this by doing the following:
Activating the Web Interface
To activate the web interface, click the
Tools menu in VLC and select Preferences. Click the All option under
Show settings to view VLC’s advanced settings. Scroll down in the list
of advanced settings and select Main interfaces under the Interface
header. Click the Web checkbox to enable the HTTP interface. Click on
LUA under the Main interfaces. Set a password under the LUA-HTTP
settings. Save your settings and restart VLC. Each time you start VLC,
the web server will be started in the background – Windows will prompt
you to allow VLC firewall access when you restart it, indicating that
the web server is running.
Configuring Stream Deck VLC Control In your stream deck configuration
manager, add a VLC Control button. Click on this button, and set the
following parameters, replacing password with the password you
previously set. Host: localhost Port: 8080 Password: {PASSWORD SET IN
VLC}
This is to have an extra plugin installed https://github.com/RGPaul/streamdeck-vlc --> This will enable you to stop and start your music on the stream deck. (you can find it on the product page inside of the stream deck application) However it is not necessary for clearing the playlist.

The capture file appears to have been cut short in the middle of a packet - how to prevent this error?

in my application i am open Tshark process and start capturing, when i want to finish to capturing i am kill the Tshark process so sometimes the capture file is corrupted and when i am trying to open this file i received the error the capture file appears to have been cut short in the middle of a packet - how to prevent this error
there is a batter way to close the Tshark process to avoid this error ?
Try stopping the capture process with ctrl+c instead of killing the process.
Also, you can try using pcapfix to fix your corrupted packets, it may help making your existing files readable again.
If this is on UN*X, if you kill the process with kill -INTpid, then that will look just like a Ctrl+C. I'm not sure there's an equivalent on Windows.
I know this post is old, but in case anyone else runs across this:
The OP is probably running something like this:
tshark > capture.cap
And then killing it with CTRL+C. This will corrupt the file.
Instead of redirecting the output, use the -w option:
tshark -w capture.cap
Then you can kill it with CTRL+C and shouldn't have any corruption issues.

How can I stop executing .wlua files?

Is it possible to force stop a .wlua file? I figured that I would have to use the Lua Command Line to do this, but I can't seem to find out how to stop them.
If it's possible, how can it be done?
Because wlua.exe doesn't open the console window (that's the purpose) and you can't send Ctrl-C, the only way to terminate such application is to use Processes window in Task Manager. Note, however, that the process name will be wlua.exe for every file opened that way.
Of course, it's meant only to be used when the application isn't responding. Your GUI application should provide a way to close it, such as close button, listening for ESC key etc.

Unpause a rails server that was paused in a different terminal window

I'm on mac osx using zsh. If I start a rails server with "rails s" I can put it in the background by hitting "ctrl-z" in my terminal (zsh).
If I open up a different terminal window then I don't see the rails server if I do "jobs". However, I can see it when I do "ps".
Is there a way I can somehow "unpause" the rails server in this new terminal window?
You can not easily move a process to a new tty. The easiest solution would be to start it in a screen session, detach screen and then resume in the new terminal.
The job is "stopped" by sending it a SIGSTOP.Your C-z doesn't send the job into the background. It "stops" it. You can then move it into the background using the bg shell builtin. However, if you send this process a SIGCONT (kill -CONT <pid>), it should bring the process back to the foreground. This can be done from a different shell.
You will not see it if you type jobs because it is a job controlled by a different shell (the other terminal window and not the one where you typed jobs). Processes however are "global" and can be seen from anywhere using the ps command (as you rightly pointed out).
Update: Looks like I spoke too soon. Apparently, the signal alone isn't enough to bring it back to the foreground. Probably something to do with the shell.

ffmpeg, vlc - Unable to find input stream

Good day to all... I have some "little" problems with ffserver and ffmpeg...
What I need to do is to broadcast a live video. So I got the cam... used vlc and used send stream option. I sent it to 192.168.1.9:64555, which is a virtual machine on the same computer, running centos.
On the virtual machine I run the command ffmpeg -i 192.168.1.9:64555 output.mpg.
The response is "unable to find file whatever".
Can any1 tell me what I did wrong?
Thank you and have a great day.
Print-screen with error:
Seems that ffmpeg don't realize that it asked to open a network stream. So, it try to open the file with name "192.168.1.9:65444", not to connect a network on this address.
I suggest you consult the manual of ffmpeg. The network stream should have some prefix like udp:// or rtp:// or anything (the vlc itself uses such prefix)
Good day. I found the answer at the question. The problem was that ffmpeg can't manage live streams. It should be created a pipe.

Resources