简体   繁体   中英

Given the length of a video, how do I calculate how much how much space it will take after conversion?

OK so I am making a video converter and whenever user inputs a video, I want to be able to tell the user how much space on the disc it is going to take after conversion.

I am using Xuggler for the conversion task which is a wrapper around ffmpeg . It lets me access the the total length of the video in milliseconds as a long value.

Based on this, how can I calculate the size of the output video that will be generated ?

That's a tricky thing. Because any conversion involves doing a decode and encode. And if you observe any encoding algorithm, it uses transforms and many other steps, which give different o/p for different input streams. In plain words, the size depends on the complexity of raw video, so its not possible to predict the size effectively.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM