Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is difference between mp4 and mpegts?

Tags:

Recently I had a task to convert the file format to mp4 and stream it. I have used ffmpeg as the transcoding tool. The MP4 file doesn't get streamed over the http protocol [have used php cgi wrapper], but then the output format is changed to mpegts the streaming occurs and works fine. A quick search on net http://wiki.videolan.org/MPEG relates and advises to use mpegts for streaming mp4 file. I need more insight on these two formats, their advantages and differences.

Thanks, Peter

like image 755
vinit sharma Avatar asked Aug 01 '12 15:08

vinit sharma


People also ask

Is TS better quality than MP4?

The video quality of MP4 and TS files are the same. The primary difference between TS and MP4 files is that TS files are flat while MP4 files have an index at the beginning of the MP4 file. Otherwise, the video bits inside the files are the same and therefore the video quality of TS, M2TS and MP4 files are the same.

What is TS and MP4?

The main difference between TS and MP4 files is that an MP4 is a container that holds audio and video data. In comparison, a TS file is a format used to stream video and broadcasts.

Which is better MP4 or MPEG-4?

MP4 is probably the most common filetype, as it's supported by the majority of devices. So, it's often best to convert MPEG4 to MP4. The best way to do this is to use a video converter program that can easily transform your file into the right format in minutes.

Is TS smaller than MP4?

The size difference is usually about 5% with the . mp4 having a slight advantage.


1 Answers

MPEG-TS is designed for live streaming of events over DVB, UDP multicast, but also over HTTP. It divides the stream in elementary streams, which are segmented in small chunks. System information is sent at regular intervals, so the receiver can start playing the stream any time.

MPEG-TS isn't good for streaming files, because it doesn't provide info about the duration of the movie or song, as well as the points you can seek to.

There are some new protocols that can use MPEG-TS for streaming over HTTP, that put additional metadata in files and fix the disadvantage I talked before. These are HTTP Live Streaming and DASH (Dynamic adaptive streaming over HTTP).

On the other hand MP4 has that info in part of the stream, called moov atom. The point is that the moov must be placed before the media content and downloaded from the server first.This way the video player knows the duration and can seek to any point without downloading the whole file (this is called HTTP pseudostreaming).

Sadly ffmpeg places the moov at the end of the file. You can fix that with software like Xmoov-PHP.

Here you can find more info about pseudostreaming.

like image 184
Yavor Atov Avatar answered Sep 24 '22 17:09

Yavor Atov