Skip to content

Instantly share code, notes, and snippets.

@sleebapaul
Last active March 16, 2023 06:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sleebapaul/2c24a1ad5279e099e8c2ac43f0701147 to your computer and use it in GitHub Desktop.
Save sleebapaul/2c24a1ad5279e099e8c2ac43f0701147 to your computer and use it in GitHub Desktop.
FFMPEG commandline tool for video streaming and format conversion
// To start ffserver
ffserver -f /etc/ffserver.conf
// re stream incoming to ffsever
ffmpeg -rtsp_transport tcp -i "rtsp://admin:admin@65.254.18.55:7314/live/N4NXL/1/2" http://localhost:8090/camera.ffm
// configuration file
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 200
MaxClients 100
MaxBandWidth 500000
CustomLog -
<Feed camera.ffm>
File /tmp/camera.ffm
FileMaxSize 20M
ACL allow 127.0.0.1
ACL allow localhost
</Feed>
#<Stream camera.mjpeg>
#Feed camera.ffm
#Format mpjpeg
#VideoFrameRate 15
#VideoIntraOnly
#VideoBitRate 4096
#VideoBufferSize 4096
#VideoSize 640x480
#VideoQMin 5
#VideoQMax 51
#NoAudio
#Strict -1
#</Stream>
<Stream live.mp4>
Feed camera.ffm
Format mp4
VideoCodec libx264
VideoFrameRate 25
VideoBitRate 900
VideoSize 480x272
AVPresetVideo default
AVPresetVideo baseline
AVOptionVideo flags +global_header
NoAudio
</Stream>
<Stream live.webm>
Format webm
Feed camera.ffm
VideoCodec libvpx
VideoSize 320x240
VideoFrameRate 15
VideoBitRate 512
VideoBufferSize 512
NoAudio
AVOptionVideo flags +global_header
StartSendOnKey
</Stream>
<Stream stat.html>
Format status
ACL allow localhost
</Stream>
ffmpeg -re -i elon.mp4 -rtsp_transport tcp -c:v copy -an -f rtsp rtsp://localhost:5554/test
ffmpeg -rtsp_transport tcp -i "rtsp://52.90.155.121:5554/test" -rtsp_transport tcp -c:v copy -an -f rtsp rtsp://localhost:8554/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment