Skip to content

Instantly share code, notes, and snippets.

@godspeed1989
Last active September 13, 2020 16:38
Show Gist options
  • Save godspeed1989/bedc96b3807aceb365d5 to your computer and use it in GitHub Desktop.
Save godspeed1989/bedc96b3807aceb365d5 to your computer and use it in GitHub Desktop.
raspberry pi ffmepg streaming video
/opt/vc/bin/raspivid -o - -t 0 -n -w 600 -h 400 -fps 12 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264 -no-audio --clock-jitter=0 --sout-transcode-hurry-up --drop-late-frames --avcodec-hw=any
rtsp://###.###.###.###:8554/

/etc/ffserver.conf

Port 80
BindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 50000
NoDaemon

<Feed webcam.ffm>
file /tmp/webcam.ffm
FileMaxSize 16M
</Feed>

<Stream a.flv>
Feed webcam.ffm
Format swf
VideoSize 960x540
VideoFrameRate 10
VideoBitRate 2000
VideoQMin 1
VideoQMax 10
NoAudio
</Stream>

run

killall ffserver
killall ffmpeg

ffserver -f /etc/ffserver.conf &

/opt/vc/bin/raspivid -w 960 -h 540 -fps 25 -t -1 -o - | ffmpeg -v verbose -i - -vcodec copy -an http://localhost/webcam.ffm

view

open http://host_address/a.flv in browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment