"Save as" TS file vs MP4 file (H264)

jmc

Active member
Is there just extra stuff in a TS file that is not in a MP4 file?

I recorded in TS and then changed it to MP4 in VRD5. (fast frame copy...mostly)
(you don't lose the .TS file if there is a crash while recording, A .mp4 is lost)

It is around 12% smaller as a MP4 file and VRD says same bitrate and number of frames.
MP4 3542 KB vs TS 4015 KB

Why 12% waste of space in TS format? I know it is better for streaming then mp4.
(there is some variation in how much they shrink)

thanks
jmc
 
Last edited:

DrP

Member
Yes, there is extra stuff. For a start there are the transport stream packets carrying information about what programs are in the stream but the likely difference is null packets, ie padding, to make the transport stream a constant packet rate suitable for feeding to a modulator. If you take your output ts file and run it through say, tsreader lite, it will give you a simple display of what a PID's (transport packets contain a Packet IDentifier) bit rate is.

The bitrate being reported would likely be (not checked myself) the content bitrate not the container bitrate.

tsreader lite
 

jmc

Active member
Yes, there is extra stuff. For a start there are the transport stream packets carrying information about what programs are in the stream but the likely difference is null packets, ie padding, to make the transport stream a constant packet rate suitable for feeding to a modulator. If you take your output ts file and run it through say, tsreader lite, it will give you a simple display of what a PID's (transport packets contain a Packet IDentifier) bit rate is.

The bitrate being reported would likely be (not checked myself) the content bitrate not the container bitrate.

tsreader lite
Good to know, thank you!

I had no idea that MP4s saved so much space before this test.
Can't ignore that much space saving.
 

Dan203

Senior Developer
Staff member
The biggest difference, from the lay perspective, is that with TS the information about the audio/video is inserted into the stream every 1/2 second or so. So the stream can be dynamic and change midstream. (i.e. resolution, audio channels, etc...) With MP4 all the information about the streams is stored in a single header so the stream has to stay consistent throughout. Not an issue if you're doing a full recode, but when you're fast editing a file you recorded from cable that has resolution or audio changes due to commercial insertion it can be an issue. We do some stuff in MP4 to make those this less of an issue, but they're not 100%.
 

Dave B

Member
Hi jmc,

Registered to add a further consideration, and possible alternative reason for observed file size variances.

When saving a TS file as MP4, If not mistaken, subtitles (if present) are removed.
Performed some tests for you with VideoReDo TVSuite versions 4, and 5.
 

Dan203

Senior Developer
Staff member
Yes. Subtitles are removed. Also in some cases, depending on the format, a lot of the headers in each frame are also removed. One of the big features of MP4 is that, provided the audio/video are consistent throughout, it can strip the headers from the audio and video frames and store them just once in the global header. Then re-apply them to each frame at playback. The main purpose of that feature is to reduce file size.
 
Top Bottom