MPEG-DASH Video Segment
|Developer||Moving Picture Experts Group|
3.8 | 10 Votes
What is an M4S file?
An M4S file is a segment of a video streamed using the MPEG-DASH video streaming technique. It contains binary data that represents a video segment. M4S files that are the first segment of a video also contain initialization data, which allows media players to recognize and begin playing the video.
MPEG-DASH is an adaptive bitrate streaming technique that allows users to stream high-quality video over the Internet using HTTP. Videos streamed using MPEG-DASH are divided into segments, which are made available at a variety of different bit rates. By dividing videos into segments and making those segments available at different bit rates, web clients can stream long videos smoothly without stalling or re-buffering.
When a user downloads a video streamed using MPEG-DASH, that video is saved as a series of M4S files. Each M4S file contains a specific segment of the streamed video. For example, a user who downloads a streamed YouTube video using youtube-dl may see the video saved as a series of M4S files.
NOTE: M4S files often do not contain audio data.
How to open an M4S file
M4S files cannot be opened and played individually. To play the video an M4S file contains, you must:
- Combine all the M4S files that comprise a single streamed video into one M4S file.
- Convert the combined M4S file into an .MP4 file.
Then, you'll be able to play the resulting MP4 file in a media player, such as VideoLAN VLC media player (multiplatform).
In Linux and macOS terminals, you can use the cat command to combine multiple M4S files into a single file. In Windows command prompt, you can use the type or copy commands. When you combine your M4S files, be sure to combine them in the correct order. For example, if you have files named 000000.m4s, 000001.m4s, and 000002.m4s, combine them in that order. If you combine M4S files in the wrong order, the resulting video won't play in media players.
After you combine your M4S files into a single file, you can use FFmpeg (multiplatform) to convert that file into an MP4 file.
How to convert an M4S file
You can use FFmpeg to convert M4S videos to the MP4 format. Before doing so, be sure to combine all the segments of your video into a single video file, using the instructions in the How to open an M4S file section.
To convert your M4S file, open a terminal window, navigate to the directory that contains your M4S file, and enter ffmpeg -i YourFile.m4s YourFile.mp4.