I am new to the video editing realm, I wonder about the huge file size from video editing software like Shotcut and iMovie exporting. I googled around but didn't get a clear clue, so any information is welcome. Thanks.
I downloaded the video from Youtube with a command line tool called youtube-dl. The downloaded mkv file is 29:11 minutes long and 389MB on disk. VLC gives these details about the video file.
Then I import it to Shotcut, cut it into a few splits and delete some of them, so the resulting video is about 22 minutes long. After exporting it using default Shortcut settings I get a 805MB mp4 file, that is more than doubled in size, even disregarding the fact that this video is 7 minutes shorter now. I also tried to kind of "compress" the exported video with a software HandBreak as some had recommended online, but I still get a file of around 660MB.
So I want to know, what kind of "magic" algorithm does Youtube use to store/stream their contents with a small file size and good quality? If I want to provide streaming service on my own site, what settings do I need to change to get a similar result? Is there any software or app that offers such an algorithm?
Sorry for my bad English, thanks again.



Sites like YouTube actually provide multiple different bit rate versions of the video to allow for different devices and different network conditions - this use Adaptive Bit Rate Streaming. See here for an example and more info:
The general process to convert a high quality large bit rate video file to a (generally) lower quality lower bit rate video file is called transcoding - basically converting the video from one enclosing format to another: https://en.wikipedia.org/wiki/Transcoding