You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#EXTM3U: Indicates the file is an extended M3U playlist.
#EXT-X-TARGETDURATION: The maximum duration (in seconds) of each segment.
#EXTINF: The duration of each segment.
segment0.ts, segment1.ts, etc.: References to the .ts files.
.ts Files
What They Are 🤔:
.ts files are video segments in the MPEG-TS (Transport Stream) format.
Each .ts file contains a small chunk of the video, typically 10 seconds long (or the duration specified in the FFmpeg options).
Purpose 🤨:
These files are streamed sequentially to the video player.
The player downloads and plays one segment at a time, allowing for adaptive streaming and reduced buffering.
Why .ts Format? 🤔:
The MPEG-TS format is designed for streaming and can handle errors better than other formats.
It allows for seamless playback even if some packets are lost during transmission.
How They Work Together🤔 ?
The .m3u8 file is loaded by the video player.
The player reads the .m3u8 file to determine the order and location of the .ts files.
The player downloads and plays the .ts files one by one, ensuring smooth playback.
How to run this programme
Prerequisites :
Nodejs
Code Editor
Get the project .
git clone https://github.com/Adityasinghvats/Node-HLS-Example.git
cd Node-HLS-Example
npm install
Add video of your choice with name video.mp4 to new folder videos under src folder .
Run conversion operation .
cd src
node ffmpeg.js
After running this you will find many .ts files under videos folder .
Run the app .
node app.js
Access the playback at http://localhost:8000/ .
For any queries contact me 🫡
About
This repo contains a simple HTTP live streaming server example built using ffmpeg and express packages.