Streaming video

git clone --depth 1 git://git.videolan.org/x264
cd x264
#On Raspbian
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
#On ubuntu 17.04
./configure --enable-static --disable-opencl --disable-shared -fPIC -fPIE
make -j2
sudo make install
sudo apt-get install libmp3lame-dev -y
cd
git clone --depth=1 git://source.ffmpeg.org/ffmpeg.git
cd ffmpg
./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree
make -j2
sudo make install
#!/bin/bash
#!/bin/bash
ffserver -f ffserver.conf & ffmpeg -v quiet -r 25 -s 1280x720 -f video4linux2 -i /dev/video0 http://$IP:8090/feed1.ffm

ffserver.conf

HTTPPort 8090
# bind to all IPs aliased or not
HTTPBindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 10
# max bandwidth per-client (kb/s)
MaxBandwidth 1000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon
 
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 100M
</Feed>
 
<Stream test.mjpeg>
Feed feed1.ffm
Format mjpeg
# h264
VideoFrameRate 25
VideoSize 1280x720
VideoBitRate 80
# VideoQMin 1
# VideoQMax 100
VideoIntraOnly
NoAudio
Strict -1
</Stream>

Nyissad meg böngászőben a http://[IP-or-name]:8090/test.mjpeg

Stream cvlc-vel

#!/bin/bash
sudo v4l2-ctl --device=/dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=1
cvlc v4l2:///dev/video0:width=1280:height=720:fps=25 stream:///dev/video0 --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{sdp=rtsp://:8554}' -vvv

Nyissad meg VLC-vel a rtsp://[IP-or-name]:8554/ hálózati stream-et (fontos: a végéről ne vágd le a '/' karaktert!).

Kapcsolódó hivatkozások