Douyin open platform, upload video to file server, response: 413 Request Entity Too Large investigation and analysis

抖音开放平台,上传视频到文件服务器,文件大小:2.10 GB。响应:413 Request Entity Too Large。
1. Douyin open platform, upload video to file server, file size: 2.10 GB. Response: 413 Request Entity Too Large. as shown in Figure 1
抖音开放平台,上传视频到文件服务器,文件大小:2.10 GB。响应:413 Request Entity Too Large。
Figure 1


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>

<head>
	<title>413 Request Entity Too Large</title>
</head>

<body bgcolor="white">
	<h1>413 Request Entity Too Large</h1>
	<P>The requested resource does not allow request data with the requested method or the amount of data provided in
		the request exceeds the capacity limit.
		<hr />Powered by Tengine
</body>

</html>


2. View the documentation, Douyin open platform – Open API – Video Management – Douyin – Create Video – Upload video: https://open.douyin.com/platform/doc/6848798087398295555 . Video file requirements: The size of the video file should not exceed 128M, and the duration is less than 15 minutes. 3. Douyin open platform, upload video to file server, file size: 136 MB. Response: 502 Bad Gateway. as shown in Figure 2
抖音开放平台,上传视频到文件服务器,文件大小:136 MB。响应:502 Bad Gateway。
Figure 2
4. Douyin open platform, upload video to file server, file size: 117 MB. Response: 200. Upload was successful. Time-consuming: 1 m 7.02 s. as shown in Figure 3
抖音开放平台,上传视频到文件服务器,文件大小:117 MB。响应:200。上传成功。耗时:1 m 7.02 s。
Figure 3
5. Note for the official document: It is recommended to use sharding upload for videos over 50M, which can reduce the failure caused by the gateway timeout. Videos over 128M must be uploaded in shards. The total size of the video is within 4GB. A single shard is recommended to 20MB, the smallest is 5MB. The implementation logic of subsequent uploaded videos: No matter the size, the video is uploaded in shards, and the size of a single shard is 100 MB.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.