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
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.
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.
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.
The size difference is usually about 5% with the . mp4 having a slight advantage.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With