Changes between Version 42 and Version 43 of StreamingGuide
- Timestamp:
- 11/04/2012 03:32:23 AM (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StreamingGuide
v42 v43 101 101 }}} 102 102 103 Note that rtp by default uses UDP, which, for large streams, can cause packet loss. See the "point to point" section in this document for hints if this ever happens to you. 104 103 105 == Codecs == 104 106 105 107 The most popular streaming codec is probably [http://www.videolan.org/developers/x264.html libx264], though if you're streaming to a device which requires a "crippled" baseline h264 implementation, some have argued that the mp4 video codec is [http://forums.macrumors.com/showthread.php?t=398016 better]. You can also use mpeg2video, or really any other video codec you want, typically, as long as your receiver can decode it, and it suits your needs. 108 109 mpeg4 (the video codec) sometimes comes "within a few percentage" of the compression of x264, but using much less cpu to do the encoding. 106 110 107 111 == HTTP Live Streaming and Streaming with multiple bitrates == … … 167 171 168 172 ffmpeg -i INPUT -acodec libmp3lame -ar 11025 --f rtp rtp://host:port 169 where host is the receiving IP. Then receive the stream using VLC or ffmpeg from that port (since rtp uses UDP, itcan start up any time).173 where host is the receiving IP. Then receive the stream using VLC or ffmpeg from that port (since rtp uses UDP, the receiver can start up any time). 170 174 171 175 or … … 173 177 ffmpeg -i INPUT -f mpegts udp://host:port 174 178 175 or possibly 179 If you run into packet loss (since UDP is not guaranteed delivery, this might occur) first make sure your FFmpeg is compiled with pthreads support enabled (if it is, then it uses a separate thread to receive from the UDP port, which can cause less packet loss). 180 181 Another option is to use some transmission type that uses TCP for your transport. (The rtmp protocol, popular in streaming to servers, uses TCP probably for this reason--you just can't use that for point to point streaming). 182 183 One option to use tcp is like this: 176 184 177 185 ffmpeg -i INPUT -f mpegts tcp://host:port 178 186 179 which I would guess will try and (as a client) establish a connection with that host and port. 180 181 With tcp you may be able to use any formatting/muxer, but with the others you need to be careful and only use a format that supports 'connecting anytime' like mpegts. 187 which I would guess will try and (as a client) establish a connection do that host on that port (assuming it has a server waiting for the incoming connection). 188 189 Another option is to use rtp (which by default uses udp) but specify tcp: 190 191 ffmpeg... -rtsp_transport tcp [http://ffmpeg.org/ffmpeg.html#rtsp see here] 192 193 Then you may be able to receive it like this: 194 195 ffplay rtsp://blabla/file?tcp 196 197 or possibly like 198 199 ffmpeg... -rtsp_flags listen [http://ffmpeg.org/ffmpeg.html#rtsp see here] 200 201 ffmpeg also has a "listen" option for rtmp to it may be able to receive "straight" rtmp streams from a single client. 202 203 With tcp based streams you can probably use any formatting/muxer, but with udp you need to be careful and use a muxer that supports 'connecting anytime' like mpegts. 182 204 183 205 == External links ==


