5

I need to stream a video to a Multicast address. I heard using FFMPEG we can stream the content. I used the following command to stream to the multicast address

ffmpeg.exe -i input -vcodec copy -acodec copy -f mpegts -re "udp://239.101.101.1:1234?ttl=1&pkt_size=1316".

But i am not able to view the video in vlc nor in ffmpeg from another system. I need to view the contents from another machine. What mistake am i doing... Please help me with this.

0

5 Answers 5

3

First you should verify that the UDP packets are reaching you player system.

Is the the player system directly accessible from the transmitter system? UDP packets will be blocked by NAT routers if they are not specifically forwarded to the right machine by adding UDP port 1234 to the forward list.

You can next verify that the player machine receives the packets by listening to the UDP port with (supposing your physical interface is eth0, if not use the one used by your system.)

sudo tcpdump -i eth0 dst port 1234

If the packets are received ok then try to read the log from the player software the check if decoding problems can be identified.

1
  • maybe check if VLC can stream it to multicast first, too?
    – rogerdpack
    Jun 19, 2012 at 15:18
3

Full range of multicast addresses is from 224.0.0.0 to 239.255.255.255 After running the FFmpeg command goto any PC in the same network use this in VLC

udp://@[IP]:[port]
3
  • the '-re' flag is applied to input not output, your command won't work as you have it listed.

  • you have your ttl set to 1, that will stop you at the first router, bump it up and see what happens.

This is the simplest way I know to do it.

    ffmpeg -i Plan_9_from_Outer_Space_1959.mp4 -c copy -f mpegts  'udp://239.0.0.1:1234?ttl=13'

Play with mplayer.

    mplayer udp://239.0.0.1:1234
1

Keep in mind that a lot of that range is restricted. If you want to use multicast for something private, better use 239.0.0.0-239.255.255.255.

0

On video server host:

ffmpeg -re -i test.mp4 -f mpegts  'udp://239.1.2.3:4567?ttl=8'

ffmpeg will transmit the video file test.mp4 to multicast (at the correct output rate because of the -re flags). The output will be streamed to multicast address 239.1.2.3 on UDP port 4567. The multicast stream will be able to traverse up to 8 routers because the TTL is set to 8.

Then, on the video client hosts:

ffplay udp://239.1.2.3:4567

The client hosts will play the video received on the multicast stream. Note that ffplay can be started before the stream is being transmitted. But with mplayer, you have to set the ffmpeg transmission running first before starting mplayer with:

mplayer udp://239.1.2.3:4567

If you try to start mplayer first, it will fail with:

Timeout! No data from host 239.1.2.3
udp_streaming_start failed
No stream found to handle url udp://239.1.2.3:4567
2
  • You could improve your answer by explaining what the options do. Nov 26, 2023 at 21:31
  • @Rohit - Did I add enough detail?
    – Katoomba
    Nov 27, 2023 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .