1

I make http live streaming (hls) server with NodeJS. Now i have two variants: ffmpeg and VLC. With ffmpeg I know command -re (Read input at native frame rate. Mainly used to simulate a grab device or live input stream (e.g. when reading from a file)). I need this for real time streaming (pseudo-live channel) from file.

As result I expected sign "Live" on the video player in browser, and not be able to make rewind over video (video.js player or hls.js library)

But how I can do this with VLC? Maybe you know some commands?

Optio
  • 7,244
  • 2
  • 22
  • 30

1 Answers1

1

But how I can do this with VLC? Maybe you know some commands?

Step 1: Use the livehttp module with VLC to restream your file source

vlc -vvv -I dummy <SOURCEADDRESS> --sout='#transcode{width=1280,height=720,fps=25,vcodec=h264,vb=4096,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=10,delsegs=false,numsegs=10,index=/path/to/your/index/prog_index.m3u8,index-url=YourUrl/fileSequence######.ts},mux=ts{use-key-frames},dst=/path/to/your/ts/files/fileSequence######.ts}'

Step 2: Publish your HTTP Live streaming playlist (m3u8) via HTML 5

<video>
 <source src="/path/to/your/index/prog_index.m3u8" />
</video>

This will produce a video player in HTML 5 without the possibility to rewind in your video, hence being "live" or "pseudo-live", whatever you want to call it.

See the following question details on general architecture and a longer explanation on the environment involved

Community
  • 1
  • 1
Mike F
  • 1,224
  • 4
  • 26
  • 44
  • Thank you! It is exactly what I expected, also in good quality. But don't know why .ts files produced without sound. I think I can fix it. What part of your command responsible for reading input at native frame rate? – Optio Apr 02 '16 at 16:32