Premise:
First of all, you should have FFmpeg.
Moreover, push stream you have to have a streaming media service, such as build NGINx, SRS, ZLMediakit and other streaming media services, here do not repeat.
I. Camera information collection and recording push stream
Get the Camera name with this command, then replace the name “Integrated Camera” below to stream or record a file
ffmpeg -list_devices true -f dshow -i dummy
ffmpeg -f dshow -i video="Integrated Camera" -vcodec libx264 -acodec copy -preset:v ultrafast -tune:v zerolatency -f flv rtmp://eguid.cc:1935/rtmp/eguid
Second, desktop screen recording
1, screen recording and save as a file
ffmpeg -f gdigrab -i desktop eguid.mp4
2. Screen recording and streaming
ffmpeg -f gdigrab -i desktop -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -f flv rtmp://eguid.cc:1935/rtmp/destop
3. Video file push stream
ffmpeg -re -i eguid.flv -vcodec copy -acodec copy -f flv -y rtmp://eguid.cc:1935/rtmp/eguid
4. Flow transfer (RTSP to RTMP as an example)
Ffmpeg -i RTSP: / / 184.72.239.149 / vod/mp4: / / BigBuckBunny_175k. Mov - rtsp_transport TCP - vcodec h264 - acodec aac -f FLV rtmp://eguid.cc:1935/rtmp/eguid
Five, the flow
ffmpeg -i rtmp://eguid.cc:1935/rtmp/eguid -vcodec h264 -f flv -acodec aac -ac 2 eguid.flv