How do bitrates, file sizes and upload speeds work together
Find out what video and audio bitrate is, how it works together to form file size affecting the upload speeds. You will also be able to see how to set things up.
Bitrates, file sizes, upload speeds and a magic trick
Uploading files as quickly as possible is what everyone prefers. After all as soon as the video is uploaded the person recording the video has finished with the step they were at. That makes it possible for them to go on and continue to the next step.
So how can we improve the speed, or the experience and how are bitrates and file sizes connected. You will be able to find out more about this in this article.
Did you know that file size can be different for a video that shows you the exact same content? This can be true even if you maintain same visual quality. Sometimes file sizes can be largely different as well.
The file size is determined by several factors and as a rule of thumb, the file size is always set by the operating system from which it is being uploaded.
For example there are some file systems that can attach a large amount of data to the video. This is called meta data and most commonly is not something you would see unless you have this set up. For example on Linux you can see all meta data from some image such as when the photo was made, the camera model, aperture, ISO and many other. Similar data can be associated with the videos that are taken.
Usually this data does not take a large amount of bytes, however it could.
Next to this type of meta data, videos can have additional data that can take large amounts of space, yet you can not see them.
One such example is audio track, where your video could have one track in English another in German and third in French. While you are looking at the video you can only see this one that is set as default. While you are uploading however you would be uploading all the tracks.
There is nothing we or you can do about either of these types of data. They will be present and we can only detect and remove them once they are on our server. It is good to keep in mind however so that you know what is happening if your customer is uploading files that do contain multiple media tracks.
What you could do is to use some of the file size related parameters. That can help you with the setups where you might want to add some limitations.
allowedextensions - To limit the videos that you would accept for uploads. Some file types like .mov are often much larger than .mp4 or .webm. With that said, be mindful that mov files for example are very common.
filesizelimit - To limit the files by file size. It is set in the bytes, so keep that in mind when limiting the video sizes. Keep in mind that 1 MB is equal to 1024 * 1024 bytes (1,048,576), so a limit of 20MB would be 2010241024 = 20,971,520, which would be written as filesizelimit="20971520".
<ziggeorecorder ziggeo-allowedextensions="mov,mp4,avi,webm,flv" ziggeo-filesizelimit="20971520"> </ziggeorecorder>
There is another type of data that can also affect the file size, and the upload size. Depending if it is upload or recording we could be able to do something about it. More about that in the next section.
Bitrates are one of the hidden things that can greatly affect your file size and upload times. If the file is uploaded with a large bitrate there is not really much you can do about it. Once it gets to our servers we will reduce the bitrate so that quality still looks the same, yet is reduced.
- We look to reduce the bitrate a bit (how much depends on the original bitrate) so that videos play back faster for you.
If you are using recording then there is some good news on the bitrate front. Our system is designed to automatically find the best bitrate. We recommend to keep it on the default value so that our system can pick this for you based on resolution and camera.
If you prefer however you can adjust this yourself as well. This is done through
videobitrate for bitrate of the video and
audiobitrate for bitrate of the audio. Both of them are set with kbs.
This is something you could use if you are familiar with both and know what would be the best ones for your setup. Generally as per above, we suggest keeping both on their defaults.
- The defaults are set when you do not set the value to anything. Please note that some parameters might by default use 'auto', false, null or any other value. So the best way to have it use default is to not set it at all.
The way you would set this would be as follows:
<ziggeorecorder ziggeo-videobitrate="3200" ziggeo-audiobitrate="120" ziggeo-recordingwidth="1028" ziggeo-recordingheight="720"> </ziggeorecorder>
Recommendations on bitrates:
|Common Name||Short label||Resolution||Aspect Ratio||Video bitrate range||Audio bitrate range|
|SD Low Quality||320x240||4:3||400 kbps||64 kbps|
|SD Good Quality||480x360||4:3||800-1.200 kbps||96 kbps|
|SD Great Quality||640x480||4:3||1.200-1.400 kbps||96 kbps|
|HD||960x720||4:3||1.400-3.800 kbps||128 kbps|
|HD||1440x1080||4:3||3.800-8.000 kbps||192 kbps|
|HD||1920x1440||4:3||6.000-10.000 kbps||192 kbps|
|HD||2880x2160||4:3||8.000-14.000 kbps||192 kbps|
|SD Low Quality||240p||426x240||16:9||400 kbps||64 kbps|
|SD Good Quality||360p||640x360||16:9||800-1.200 kbps||96 kbps|
|SD Great Quality||480p||854x480||16:9||1.200-1.500 kbps||96 kbps|
|HD Ready||720p||1280x720||16:9||1.500-4.000 kbps||128 kbps|
|Full HD||1080p||1920x1080||16:9||4.000-8.000 kbps||192 kbps|
|2K||1440p||2560x1440||16:9||6.000-10.000 kbps||192 kbps|
|Ultra HD or 4K||2160p||3840x2160||16:9||8.000-14.000 kbps||192 kbps|
|Your bitrate can be different for any resolution. Higher bitrate = higher the quality and file size.|
Upload speeds are quite complex to explain. As a rule of thumb people believe that they have the speed that they are paying for, however that is always lower than the same.
So for example if you are enjoying the 100 mbps download and 50 mbps upload the reality is that you are likely having around 80mbps download and 40mpbs upload where it can sometimes reach the maximum that you are paying for (100/50).
Another thing with the speed you have available for upload is that it often also depends on several things:
- If someone else is using the connection as well at the same time
- If there are limitations on the port being used
- If WiFi or wired connection is used
- If WiFi is used, devices connected to the same WiFi would also impact speed
- Port limitations
- QoS (Quality of Service)
- Connection quality
- Upload overhead
- File size
Let's quickly go through the points above to see more about them.
If someone else is using the connection as well at the same time
If you have upload speed of 50 mbps and you and someone else are both using the connection then you might have access to half, more or less of the connection. The few other points we just mentioned would play a role in decision how much of the connection you actually have.
If there are limitations on the port being used
Port limitations are quite common. If connection is made directly to the router then one or more ports could be disabled completely. On other routers there might be preference for different ports, so (for example) all connections over port 1 have higher speed than those on port 2.
Generally when someone connects to the switch and then to the router it does not matter what port they are using on the switch (however that can be set up as well).
If WiFi or wired connection is used
Wired connection is always best to use. Many people however prefer the ease provided by the WiFi. For this reason they might be limited in speed for several reasons. We will mention one of those in next point, however there is also signal strength, if the person is moving during upload, or if something gets between them and router during upload.
If WiFi is used, devices connected to the same WiFi would also impact speed
When purchasing the router you can often see numbers with some letters such as /n/g and others. These show the protocols that WiFi supports. What none of them tell however is that it is always the oldest protocol that is used for all devices and that depends on the protocols supported by the connected devices.
As they shake hands they also say what protocols they support, allowing the router to make this type of decision.
While ports can have default limits as we mentioned above, there are also port limitations that can be set by network admins. This is something you are much more likely to see in office environments where IT teams can pick and set the speed limitations for different people or devices.
QoS (Quality of Service)
The QoS is one of those hidden things that everyone has turned on. They help us with the connection however they can directly limit some of your speeds. The way they are most commonly set up is to prioritize some connections to other types of connections.
They are smart in a way to recognize that you are playing a game for example so your latency is very important. That is why it would prioritize that to the video being uploaded. Live calls are also often prioritized over file uploads for same reason.
So if one person is playing a game, another on a live call and you want to upload the file, QoS will be their friend and place your file upload at the very end of the list.
All uploads should be counted up for another 10 to 20 percent. So if you are uploading 100mb you should see that as 120mb. This is for various reasons. All uploads have to be broken up into tiny little containers or packets. To make it easy imagine them being in a row. Now each packet contains its meta data such as its position in the row being uploaded. It also contains data that tells if it got damaged or not.
Now all of these packets are being sent to the same end point however through many different routers, switches and other hardware devices. With the position being read, they are put into the right order.
Now because these are small bits of data, the position and integrity data actually take a large chunk of the size of that packet. If the connection is not that great (breaks up) then the same packets are asked for and then re-sent to the server.
The way you can tell this is happening is by seeing the file upload go to 100% real quick then it waits. Longer it waits more data it had to have re-uploaded.
Now the reality is that there is no code that can help with any of those points. These points are just information what can be the cause and what is the cause of how long it takes to upload the data. This is also true for all systems regardless of the service the data is uploaded to.
Here are Ziggeo we do not have any speed limitations on the uploads, so people uploading and recording are only limited by limitations on their own side.
You will not see any code here, however you will see something that can help you with your setup.
If you want to speed up the uploads and are not that concerned with the quality there are few things you could do. This is generally interesting to some forms of AI systems that require video to meet certain requirements yet do not require full HD video for it.
One of the things you can do is to lower the FPS. The Frames Per Seconds can be lowered by using the
framerate parameter. By default it is as 25. The 24 is the lowest you can go without noticing that some frames are missing as the eye will still continue to add the motion.
Basically if you set 10 fps what you are saying is to take 10 frames each second instead of 25 which is the default. This should make the uploaded file 2.5 times smaller in file size.
You can also use the
videobitrate parameter either alone or next to framerate which you can see as the amount of data that you are putting into each frame. Do note that lower the bitrate more video artifacts will be shown. As you go higher and higher, at some point you will just stop seeing any difference.
Another option you can set up is
noaudio. This will disable recording of audio. Generally this is another option that might be of use to you if you are collecting videos for AI processing.
Unlike the above, there are cases where you still want to keep the video looking good and gain some time with the person recording and uploading the file. What we would suggest is the
localplayback parameter. It will attempt to play back the video as it is being uploaded.
While this does not really change the speed of the upload it does a magic trick as the eyes and mind are no longer looking at the upload progress and instead are looking at the video they just made.
Things you can do
localplayback is what we would recommend adding to help with uploads as it makes them seem fly by. While we do not recommend changing bitrate unless you know what you are doing, you can and should change one other recording parameter. The
They will allow you to set the recording to be close to what you want to end up with. For example recording 1920x1080 when you are looking to utilize videos of 640x480 means you could lower your recording setup to match the 640x480 and have the videos uploaded faster.