Game Development Reference
In-Depth Information
{allowFullScreen: "true", wmode: "opaque"},
{name: "StrobeMediaPlayback"});
</script>
<h1>RTMP</h1>
<div id="StrobeMediaPlayback"></div>
</body>
</html>
You should now browse with a browser that has flash installed, and you should see
a live stream. (Technically, it is delayed by about 0.5 seconds, but this is as fast as it
gets for now.)
MPEG streams
You can use FFmpeg to send MPEG frames, and we will configure FFmpeg to
transmit UDP packets to a remote computer, that is, running the VLC player and
listening for these packets. UDP is a popular way to send live video and audio
because the protocol just sends data and does not care if it got there or not. This
saves on bandwidth but receivers can sometimes miss a frame every now and again,
resulting in freezing frames or garbled image or audio. It gets corrected as soon as
the next set of correct UDP packets is received.
We need to use a PSIPS filter with this method and also wrap everything in a script
file. Create a file called udp.sh in /home/pi and copy the following code into it.
Replace the IP with the machine that will run VLC to receive the UDP frames.
#!/bin/bash
fifo="live.fifo.h264"
rm -f "$fifo"
mkfifo "$fifo"
raspivid -w 1280 -h 720 -fps 25 -g 100 -t 99999 -b 1000000 -o -
| /home/pi/psips > "$fifo" &
ffmpeg -y -f h264 -i "$fifo" -c:v copy -map 0:0 -f mpegts "$url"
On the command line, perform a chmod +x udp.sh command and run the file by
typing ./udp.sh .
 
Search WWH ::




Custom Search