Activity › Forums › Compression Techniques › Calculate Transcoded files size
-
Calculate Transcoded files size
Posted by Venkatesh Guptha on March 3, 2011 at 8:57 amHi,
I my application, we are using 3ivx for transcoding the video into MPEG-2 TS format. I want to calculate the transcoded file length before transcode starts. Is there any way to find this?
Thanks in Advance
Venkatesh. KVenkatesh Guptha replied 15 years, 5 months ago 2 Members · 4 Replies -
4 Replies
-
Michael Rampe
March 3, 2011 at 10:04 pm[Venkatesh Guptha] ” I want to calculate the transcoded file length before transcode starts.”
ffmpeg -i [inputfile]
This will give you the duration of the input.
Also have a look at FFprobe.
Michael
-
Venkatesh Guptha
March 4, 2011 at 6:50 amHi,
i dont want duration, instead i need size of the output file (trancoded file) before transcode starts. Is there any formula to calculate it?
Thanks in advance,
Venkatesh. K -
Michael Rampe
March 4, 2011 at 8:42 pm[Venkatesh Guptha] ”
i dont want duration, instead i need size of the output file (trancoded file) before transcode starts.”I interpreted “file length” as time. “file size” would have been clearer.
[Venkatesh Guptha] “Is there any formula to calculate it?”
Fairly straightforward.
bitrate/8*length(seconds)=size (in Bytes). Divide by 1024 for KB. Divide by 1024 again for MB. etc.
Of course, with most codecs, this will be approximate. Don’t forget to include the audio bitrate in your calculations, a common mistake.
Michael
-
Venkatesh Guptha
March 6, 2011 at 7:25 amHi,
I tried this formula also, but i didn’t get the exact output file size.
For your reference, i am providing the file details,
Input File Details:
File Size: 212,536
File Extension: WMV
Audio Bitrate: 238
Video Bitrate: 180
Duration: 5Secs
Audio Codec: WMA
Video Codec: WMV
Video Height: 240
Video Width: 320
Sample Frquency:32000
Audio Channel: 2Output File Details:
File Extension: TS
Audio Bitrate: 192000
Video Bitrate: 1024000
Duration: 5Secs
Audio Codec: A52
Video Codec: mpgv
Video Height: 240
Video Width: 320
Audio Channel: 2
after transcode completes output file size is 1,047,912 BytesAs per your formula,
((192000 + 1024000) / 8) * 5 = 760000 Bytes
Here 760,000 is not equal to 1,047,912 rite. So i need to find exact transcoded file size before transcode starts.
Thanks in advance
Venkatesh. K
Reply to this Discussion! Login or Sign Up