Making source files playable
In order to provide faster access to your uploaded files, HERAW allows you to view source files readily playable by web browsers.
For the safest option we advise encoding your files to mp4 (h.264, aac, yuv420p) before uploads. But a range of formats are assumed to be supported by most browsers, here is the chart of formats supported for direct play on HERAW:
Format | Video Codecs | Audio Codecs |
---|---|---|
mp4 | h.264, mpeg4 | aac, mp3 |
webm | vp8, vp9 | vorbis, opus |
ogg | theora | vorbis, opus |
mov | h.264, mpeg4 | aac, mp3 |
mkv | h.264, vp8, vp9 | aac, mp3, vorbis, opus |
In addition to these settings, HERAW will check other parameters to determine if a video file is directly playable:
The video's pixel format (pixfmt) should be one of the following: yuv420p, yuv444p, yuv420p10le
The video should not be interlaced ( (we analyse 60 to 600 frames of the video, if the video is longer than a minute, the check is offset by 20 seconds. If the amount of interlaced frames is greater than 9% the file is considered as not playable in a browser and transcoded by HERAW)
Avoiding proxy creation
Some files can be read by the browser but aren't ideal due to their size or bitrate, in this case we create proxies even if the files are playable.
Reasonable bitrates
Depending on the file's resolution we check if the bitrate seems appropriate, if it seems too high we will downsample the video, here are our thresholds, if the bitrate exceeds the threshold for the given resolution we will create a proxy:
Resolution | Average estimated bitrate | Threshold |
---|---|---|
240 | 235 000 | 352 500 |
360 | 560 000 | 840 000 |
480 | 1 050 000 | 1 575 000 |
720 | 3 000 000 | 4 500 000 |
1080 | 5 800 000 | 8 700 000 |
1440 | 8 000 000 | 12 000 000 |
2160 | 12 000 000 | 18 000 000 |
Moov atom positions
Moov atoms should be at the beginning of files to avoid the need to buffer the complete file to play it. If moov atoms aren't within the first 64kb of the file the file will be transcoded.