11

I have been trying to stream local video on VLC using the FFmpeg library like this:

$ ffmpeg -i sample.mp4 -v 0 -vcodec mpeg4 -f mpegts udp://127.0.0.1:23000

I have not been able to stream the file on VLC.

Dharman
  • 30,962
  • 25
  • 85
  • 135
param trivedi
  • 161
  • 1
  • 2
  • 10

4 Answers4

26

In the first terminal:

$ ffmpeg -i sample.mp4 -v 0 -vcodec mpeg4 -f mpegts udp://127.0.0.1:23000

Open a second terminal and use:

$ ffplay udp://127.0.0.1:23000
Jeankowkow
  • 814
  • 13
  • 33
Omy
  • 255
  • 3
  • 4
8

My guess is that you are trying to play in VLC using the URL udp://127.0.0.1:23000 as you have it in the FFmpeg command. In VLC, try using udp://@:23000 instead.

Jeankowkow
  • 814
  • 13
  • 33
GroovyDotCom
  • 1,304
  • 2
  • 15
  • 29
0

It works, but it's ugly on VLC.

On MacOS Catalina with:

ffmpeg -f avfoundation -framerate 30 -i "0" -f mpeg1video -b 200k -r 30 -vf scale=640:360 udp://127.0.0.1:5555

and it works well with:

ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental   udp://127.0.0.1:5555
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

Along with @Omy's answer be sure to add -re before the input to ensure realtime (normal) livestreaming than sending too many UDP payloads at once. For instance,

ffmpeg -re -i sample.mp4 -v 0 -vcodec mpeg4 -f mpegts udp://127.0.0.1:23000
xsb
  • 11
  • 3