Posted By

dnaranjo on 12/18/13


Tagged

streaming


Versions (?)

Streaming with VLC code


 / Published in: C#
 

URL: google.es

Streaming with VLC code

  1. private void button3_Click(object sender, EventArgs e)
  2. {
  3. if (!string.IsNullOrEmpty(textBox1.Text))
  4. {
  5. string output = @":sout=#transcode{vcodec=h264,scale=0,acodec=mp3,ab=128,channels=2,samplerate=44100}:udp{dst=127.0.0.1:9000} :sout-keep ";
  6.  
  7. IMedia media = m_factory.CreateMedia<IMedia>(textBox1.Text, output);
  8. IPlayer player = m_factory.CreatePlayer<IPlayer>();
  9. m_player.Open(media);
  10. m_player.Play();
  11.  
  12.  
  13. /* m_media = m_factory.CreateMedia<IMediaFromFile>(textBox1.Text);
  14.   m_media.Events.DurationChanged += new EventHandler<MediaDurationChange>(Events_DurationChanged);
  15.   m_media.Events.StateChanged += new EventHandler<MediaStateChange>(Events_StateChanged);
  16.   m_media.Events.ParsedChanged += new EventHandler<MediaParseChange>(Events_ParsedChanged);
  17.  
  18.   m_player.Open(m_media);
  19.   m_media.Parse(true);
  20.  
  21.   m_player.Play();*/
  22. }
  23. else
  24. {
  25. errorProvider1.SetError(textBox1, "Please select media path first !");
  26. }
  27. }

Report this snippet  

You need to login to post a comment.