Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to live stream a local video using FFmpeg

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.

like image 567
param trivedi Avatar asked May 07 '17 00:05

param trivedi


People also ask

How do I livestream with FFmpeg?

To start live streaming with FFmpeg, you have to download and install the software on your computer. You can choose the right installation method for your operating system from the three options above in this FFmpeg tutorial. At this point, you can also create a streaming channel on your video hosting platform.

How do I stream HLS with FFmpeg?

Basic Steps to HLS Packaging using FFmpegread an input video from disk. scale/resize the video to the multiple resolutions required. transcode the audio to the required bitrates. combine the video and audio, package each combination, and create the individual TS segments and the playlists.


1 Answers

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
like image 58
Omy Avatar answered Oct 14 '22 16:10

Omy