Scenario
I'm trying to stream a video between 2 hosts using RTP. I have previously solved this problem using VLC using the following 2 commands
Server Side
cvlc video_file.mp4 --sout "#transcode{vcodec=h264, acodec=mpga, ab=128, channels=2, samplerate=44100}: duplicate{dst=rtp{dst=10.X.X.X, port=5004, mux=ts}}" --run-time 40 vlc://quit
Client Side
cvlc rtp://@:5004 --sout "#transcode{vcodec=h264, acodec=mpga, ab=128, channels=2, samplerate=44100}: std{access=file, mux=mp4, dst=downloaded.mp4}" --run-time 40 vlc://quit
Requirement
Now I want to achieve the same but with FFMPEG. What would be the equivalent command?
Work done till now
Server Side
ffmpeg -re -i video_file.mp4 -vcodec libx264 -an -f rtp rtp://10.X.X.X:5004 -vn -acodec libtwolame -f rtp rtp://10.X.X.X:5005
Client Side
ffmpeg -i rtp://10.X.X.X:5004 -vcodec libx264 -an -i rtp://10.5.19.244:5005 -acodec libtwolame -vn -t 00:00:35 downloaded.mp4
However, I cannot record the received stream this way.