VLC streaming output a MMS

Mar 18, 2014 at 1:59 AM
Edited Mar 18, 2014 at 3:34 AM
I want to use libvlc to streaming output a MMS streaming.

My code is as follows.But it does not work when I use windows media player 11 to play that url is mms://192.168.10.181:8080

////////////////////////////////////////////////////////////////////////////////
//
// Program.cs - This file is part of LibVLC.NET.
//
// Copyright (C) 2011 Boris Richter himself@boris-richter.net
//
// ==========================================================================
//
// LibVLC.NET is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or (at
// your option) any later version.
//
// LibVLC.NET is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with LibVLC.NET; if not, see http://www.gnu.org/licenses/.
//
// ==========================================================================
//
// $LastChangedRevision$
// $LastChangedDate$
// $LastChangedBy$
//
////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LibVLC.NET;
using System.Threading;

namespace Tutorial
{

//****************************************************************************
class Program
{
//==========================================================================
static void Main(string[] args)
{
  // The original tutorial code can be found at
  // http://wiki.videolan.org/LibVLC_Tutorial#Sample_LibVLC_Code

  LibVLCLibrary library = LibVLCLibrary.Load(@"C:\Program Files\VideoLAN\VLC");
  try
  {
    IntPtr inst, mp, m;

    /* Load the VLC engine */
    inst = library.libvlc_new();

    /* Create a new item */
    m = library.libvlc_media_new_location(inst, @"rtsp://admin:admin@192.168.10.20:554/1/720p");


    /* Streaming output a MMS */
    string op = "--sout '#transcode{vcodec=DIV3,vb=256,scale=1,acodec=mp3,ab=32,channels=2}:std{access=mmsh,mux=asfh,dst=192.168.10.181:8080}'";
    library.libvlc_media_add_option(m, op);


    /* Create a media player playing environement */
    mp = library.libvlc_media_player_new_from_media(m);

    /* No need to keep the media now */
    library.libvlc_media_release(m);



    /* play the media_player */
    library.libvlc_media_player_play(mp);

    Thread.Sleep(100000); /* Let it play a bit */

    /* Stop playing */
    library.libvlc_media_player_stop(mp);

    /* Free the media_player */
    library.libvlc_media_player_release(mp);

    library.libvlc_release(inst);


  }
  finally 
  {
    LibVLCLibrary.Free(library);
  }

}
} // class Program
}