Sunday, January 12, 2014

How to publish a live stream (MPEG-TS based encoder)

The procedure I followed is mentioned in details here
http://www.wowza.com/forums/content.php?37
I am using , Linux Mint-13 and wowza media server-3.


The basic steps for setting up an application for live streaming and configuring Application.xml :
     1. Create application folder [install-dir]/applications/live. [ I have this application already available ]  
     2. Create configuration folder [install-dir]/conf/live [ I have this application already available ]  
     3. Copy/Overwrite Pre-configured version of Application.xml to [install-dir]/conf/live  
     4. From Application.xml, changes the followings if they are not already configured  
         1. Set the Streams/StreamType property to:  
                <StreamType>live</StreamType>  
         2. Set the HTTPStreamers property to:  
 <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>  
         3. Set the Streams/LiveStreamPacketizers property to:  
 <LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer</LiveStreamPacketizers>  
         4. Set the RTP/Authentication/PlayMethod property to:  
 <PlayMethod>none</PlayMethod>  

Publishing the stream :
    1. Create .stream file:  
        a. Use a text editor to create the file [install-dir]/content/mpegts.stream and set the contents of this file to udp://[myip]:10000. If you're receiving a multicast stream, change [myip] part of the URL to the multicast address of the stream.  

             
 b. Using a text editor, edit the [install-dir]/conf/admin.password file and add a username and password that will be used to start and stop the publishing of the MPEG-TS stream (below is an example of the file with the username myuser and password mypassword):   


     
   3. Start/Restart Wowza Media Server.     
    4. Use Stream Manager to start the MPEG-TS stream:          
             a. Enter the following URL in a web browser:   
                    URL: http://[wowza-ip-address]:8086/streammanager    
             b. In the Security dialog box, enter your admin username and password from above.     
           





        c. In the Stream Manager webpage, click the [start-receiving-stream] link just below the live application folder.         
        d. In the Start Receiving Stream dialog box, select the following MediaCaster Type option: rtp  
        e.In the Stream Name field, enter mpegts.stream and press ok.   







Publish stream using ffmpeg : 
 
  $ ffmpeg -re -i file.ts -acodec copy -vcodec copy -f mpegts udp://192.168.43.129:10000?pkt_size=1316 I played the stream using mplayer  


I played the stream using mplayer
 $ mplayer -msglevel all=6 rtmp://192.168.43.129:1935/live/mpegts.stream