How to live stream a local video using FFmpeg

param trivedi picture param trivedi · May 7, 2017 · Viewed 28.3k times · Source

I am trying to get used to the FFmpeg library, and currently, I have been trying to stream local video on VLC using FFmpeg.

The command I have been using is:

$ 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.

Any help is appreciated.

Answer

Omy picture Omy · Nov 8, 2017

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