Streaming in ffmpeg using RTP
Assume that the IP of the client is 10.0.0.2
Code to run on server side
ffmpeg -re -thread_queue_size 4 -i source_video_file.mp4 -strict 2 -vcodec copy -an -f rtp rtp://10.0.0.2:6005 -acodec copy -vn -sdp_file saved_sdp_file -f rtp rtp://10.0.0.2:7005
After running this code, an SDP file should be generated named saved_sdp_file
. This should be transferred to the client, which needs it to receive the stream
Code to run on client side
ffmpeg -protocol_whitelist "file,rtp,udp" -i saved_sdp_file -strict 2 saved_video_file.mp4