Changes between Version 19 and Version 20 of StreamingGuide

Jul 26, 2012, 7:04:32 PM (4 years ago)

another wowza demo


  • StreamingGuide

    v19 v20  
    8383FFmpeg supports splitting files (using "-f segment" for the output, see [ segment muxer]) into time based chunks, useful for [ HTTP live streaming] style file output. 
     85== Transcoding/repeating == 
     87Ffmpeg can also receive from "some source" (for instance live or udp) and then transcode and re-broadcast the stream. 
     89One mailing list user wrote this, quote: 
     91 In my application, I have a server running vlc sucking streams from some cameras, encoding them as MPEG2 streams and sending them to ports 5000 through 5003 on my intermediary server (I'll have to let someone else explain how to set that up, as that was someone else's part of the project). I have another server running Wowza, with an instance named "live". And I've got an intermediate server that sucks in MPEG2 streams coming in on ports 5000 to 5003, transcoding them into mp4 streams with H.264 and AAC codecs, and pushing the transcoded streams on to Wowza. 
     93 The command line I use to pull the stream from port 5000, transcode it, and push it is: 
     94 ffmpeg -i 'udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1' -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 500k -f flv 'rtmp://<wowza server IP>/live/cam0' 
     96 -i 'udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1' tells ffmpeg where to pull the input stream from. The parts after the ? are probably not needed most of the time, but I did need it after all. 
     98 -crf 30 sets the Content Rate Factor. That's an x264 argument that tries to keep reasonably consistent video quality. A value of 30 allows somewhat lower quality and bit rate. 
     100 -preset ultrafast as the name implies provides for the fastest possible encoding. If some tradeoff between quality and encode speed, go for the speed. This might be needed if you are going to be transcoding multiple streams on one machine. 
     102 -acodec aac  sets the audio codec (internal AAC encoder) 
     104 -strict experimental  allows use of some experimental codecs (the internal AAC encoder is experimental) 
     106 -ar 44100 set the audio sample rate 
     108 -ac 2 specifies two channels of audio 
     110 -b:a 96k sets the audio bit rate 
     112 -vcodec libx264 sets the video codec 
     114 -r 25 set the frame rate 
     116 -b:v 500k set the video bit rate 
     118 -f flv says to deliver the output stream in an flv wrapper 
     120 'rtmp://<wowza server IP>/live/cam0' is where the transcoded video stream gets pushed to