# TS Transport Stream Stream length vs. filesize

1. Hi,

Is it posible to just to multiply filesize with video length?

I.e. I have recorded a clip from the tv.
The current clip is 14.260 seconds long, and the filesize is 24051712 bytes
Will this say, that if I record a clip that is 2 hours long, the filesize will be: 2*60*60*24051712/14.260 => 12143921907 bytes => 12 GB...?

Just to use as an estimate... I.e. 500 MB more or less is not relevant....

- Allan
2. Yep. It works for constant bitrate sources like a ATSC/DVB ts stream.

If you now are just recording the raw stream and not capturing and shrinking it in realtime.
3. Filesize = Playtime * Bitrate
4. Great info...

Info from TS file says Average bitrate 12,87 Mbps.

I.e. length * bitrate = 14.260 * 12,87 = 183,5262 Mb (that must then be Mega bits and not Mega bytes)

So 183,5262 / 8 (bit to byte) = 22,940775 (not equal to but close to the filesize 24,051712)

1 MB diff... for 14 sec. - hmmm.. that becomes 514 MB for 2 hours ( - just around my limit)...

- Allan
5. Those figures do not add up. Even SD mpeg-2 would consume 4 GB or more for 2 hours. HD will be much much more.

Post the mediainfo report for the TS file.
6. Originally Posted by DB83
Those figures do not add up. Even SD mpeg-2 would consume 4 GB or more for 2 hours. HD will be much much more.

Post the mediainfo report for the TS file.
I think you got off in my calc then... ok.. the original post was that it becomes 12 GB, so you are absolutely right...
My last calculation was just to show the variation in calucalation...
I.e. the diff for using Length * Avg. Bitrate was 1 mb per sec...

Summarized that gives me 514 MB diff in an 2 hour recording...
I.e. using same calc for 2 hours in length give me a total of 11583 MB (11,5 GB)...

- Allan
7. OK. But 'average' is just that - a figure between the maximum and the minimum. The quoted average for that particular recording is the result of the video size = bitrate*length calculation or bitrate=videosize/length.

Your next recording will have a different result. The maximum could be the same but the minimum will change according to the complexity of the encode.

There is another currect topic on here where the OP stated that 15 minutes of recording consumed 2 gig.
8. Ups! Don't hope my recording comes to that before I get all my stuff...

Currently I only have a 16 GB usb flash disk (that was why I was asking)...

Offcause, I planning on getting a larger disk, but was just wondering if a 2 hour recording would fit on this (very small) flash drive...
9. F.Y.I - Nice tool - was looking for that...

Format : BDAV
Format/Info : Blu-ray Video
File size : 22.9 MiB
Duration : 13s 794ms
Overall bit rate mode : Variable
Overall bit rate : 13.5 Mbps
Video
ID : 2900 (0xB54)
Format : AVC
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=8, N=48
Codec ID : 27
Duration : 13s 140ms
Bit rate : 12.3 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.267
Stream size : 19.3 MiB (84%)

Statistics