Play a .flv via rtmp stream in a winform - c#

The only way way I figured out to play this kind of stream with existing tools is piping it through rtmpdump into vlc.
The command line for it looks like:
rtmpdump.exe -v -r rtmp://cp108475.live.edgefcs.net/live/ard_1_800#15782 --swfsize 927444 --swfhash 6c1be1765187eae0bc9af07d858fae59a0effd3c5b803d08db261ced2c5512bb -q | vlc.exe -
I just figured out how to play a .flv from local disk in a winform by using VlcDotNet library
But now I'm also looking for a method of playing such a .flv rtmp stream in a c# winform.

Related

How to properly redirect StdIn/StdOut to control VLC?

I´m writing a platform independend C# Application (My targets are Windows and Raspbian). I want to use VLC for Audio Playback.
I tried to start VLC using the remote control interface vlc -I rc and redirecting StdIn/StdOut that I can send commands and receive information of the VLC process:
vlcproc = new Process();
vlcproc.StartInfo = new ProcessStartInfo(VLCPath, "-I rc");
vlcproc.StartInfo.UseShellExecute = false;
vlcproc.StartInfo.RedirectStandardInput = true;
vlcproc.StartInfo.RedirectStandardOutput = true;
bool res = vlcproc.Start();
vlcproc.OutputDataReceived += vlcproc_OutputDataReceived;
But it does not work as expected. VLC seems not to get anything if I write some commands using vlcproc.StandardInput.WriteLine(). I tried to use add ... on local files and streams. Using C#, no playback - entered manually, playback. I do not get any StdOut information as well (printed by Console.Write() in the Event Handler).
What I´m doing wrong?
PS: A reliable, cross-plattform audio/video-player that supports files as wells as network-streams and can be integrated in a Mono/.NET-supported GUI Framework would be even better than this attempt.
The problem is that VLC doesn't act on stdout/stin. I was able to solve the stdout problem by running it through script -c "<vlc command with parameters>".

Stream rtsp video using axvlcplugin to a file

I am using VLC plugin to run an rtsp stream. The stream works good. But I want to store these videos to a file destination. I use this code but does not work.
axVLCPlugin21.playlist.add("rtsp://192.168.10.222:554/h264", null, ":sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\\123.ogg,no-overwrite} :sout-keep");
axVLCPlugin21.playlist.play();
This code only plays the rtsp stream but does not store. However, the same options can be used to stream directly on the VLC player.
Try using this Option for Storing Videos and displaying videos simultaneously
original commad to play in vlc
%vlc path% vlc.exe -vvv rtsp://192.168.10.22:554/h264 :sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=C:\\\\123.mp4},dst=display}:sout-keep
if this works try to use
:sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=C:\\\\123.mp4},dst=display}:sout-keep
":sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\123.ogg,no-overwrite} :sout-keep
also try to work in VLC gui by using streaming option+displaylocally+dst=file
Refrence:HowTo Receive and Save a Stream
VLC does not support recording of streams via plugin. Check this Link
I got a work around for it. I record the stream by calling the VLC directly. However, the player is hidden. I use this code:
Process.Start("C://Program Files//Videolan//VLC//VLC.exe","\"rtsp://xxx.xxx.xxx.xxx:554/h264\" --qt-start-minimized --sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\\123.ogg,no-overwrite}");

Recording Video from IP camera using VLC?

i am try VLC media player to record a video from IP camera. i found this command line to record video from ip camera.
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 :demux=dump :demuxdump-file=C:\output_test.avi vlc://quit
The command line is working, i can get video with sound from IP camera. The only problems is the recorded video only can be played using VLC itself, the video also only have information which is only size(KB,MB), the windows cannot get the other information such as video length, size(Width*Height), etc. And the most important is video cannot be played using Window Media Player.
**EDIT
"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 --sout "#std{access=file,mux=avi,dst="c:\test.avi"}" vlc://quit
using this command, now i got all the video's info and playable using window media player and other players as well, but this time the there is no sound in video.
I'm implementing this in web app. I got the code running fine.
Does anyone here can provide me the correct command line to get working video with sound and also video's information.
i tried searching but cannot find the correct command line(if any). Tried VLC forum but got Error 403.
**note: i am using windows 7 OS.
try transcoding & mux
vlc.exe -I dummy --dummy-quiet http://user:password#ipAddress.com:port/videostream.asf --run-time=120 :sout=#transcode{vcodec=h264,vb=1024,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=avi,dst="c:\test.avi"}

How to stream audio from Nao robot?

I would like to create a streaming audio from a Nao to my WPF form.
The only way that i have found is that we can download a recorded sound on Nao over SSH.
But its not a real streaming ...
If anyone has an idea !
Thanks
run this command on your NAO (login via ssh) gst-launch-0.10 pulsesrc ! audioconvert ! vorbisenc ! oggmux ! tcpserversink port=1234
list via VLC: vlc tcp://IP:1234/
You should look at gstreamer that is embedded in the robot. It would be a bit slow, but it'll be real streaming...
For windows:
Download the latest pulseaudio (not the official one) and creat a config.pa file with these two lines:
load-module module-native-protocol-tcp listen=0.0.0.0 auth-anonymous=1
load-module module-waveout
Run pulseaudio on your windows machine first with pulseaudio -F config.pa
On your NAO:
pacmd load-module module-tunnel-sink sink_name=nao server=192.168.1.152
(change this address to your windows one. Also make sure pulseaudio is running on windows otherwise this wont work)
qicli call ALAudioDevice._listOutputs
The previous command will show you the index number of the pulseaudio device you just created. Use this number in the next commands
pacmd set-default-sink 1
qicli call ALAudioDevice._setDefaultOutput 1
Thats it. Now everything comes through your pc speakers. index 0 is NAO's soundcard
For Linux:
Run this on terminal:
pactl load-module module-rtp-recv
On NAO:
pactl load-module module-null-sink sink_name=nao (creates the sink)
qicli call ALAudioDevice._listOutputs (checks the index on sink)
qicli call ALAudioDevice._setDefaultOutput 1
pactl load-module module-rtp-send source=nao.monitor
I find the Linux approach more stable. The TCP one on windows might break after some time.

Play audio url on windows mobile

I'm going to write a function to play a mp3 file from an URL on Windows Mobile 6.0 without downloading all the stream to mobile. I read some documentation and faced some problem that.
Using NAudio.dll
: The dll is not compatible for Windows Mobile
Using DirectShowLib.dll : have not found way to get from audio stream.
Is it true that we can't get an audio Url Stream in Windows Mobile 6.0? Is there any way or any dll else to help me?
Which windows mobile? 6.5 or 7?
7 uses Silverlight so it should be really easy to do smooth streaming (never tried it).
6+ I'm not so sure, maybe use a WCF filestream to get the stream?
I find out Bass library work well on my specific issue - play mp3 audio from url on windows mobile 6.
Add bass_cp.dll to your solution. And make sure to copy the bass.dll to your execute directory.
And what you need to do is very simple:
int stream = Bass.BASS_StreamCreateURL(strUrl, 0, 0, null, IntPtr.Zero);
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
Bass.BASS_ChannelPlay(stream, false);
Of course after you register for the dll. Then add this code line at first:
BassNet.Registration(string email, activated key);

Categories

Resources