# HG changeset patch # User Yaroslav Zhuravlev # Date 1393938141 0 # Node ID 028f6a4d8046282c18f8451d45cd6c524a91819c # Parent 1fcf8c840dbe99d4c8f3aa13d889cc935dc15aac Corrected punctuation, grammar, style, rephrased some sentences. diff -r 1fcf8c840dbe -r 028f6a4d8046 xml/en/docs/http/ngx_http_mp4_module.xml --- a/xml/en/docs/http/ngx_http_mp4_module.xml Tue Mar 04 13:02:21 2014 +0000 +++ b/xml/en/docs/http/ngx_http_mp4_module.xml Tue Mar 04 13:02:21 2014 +0000 @@ -9,7 +9,7 @@ + rev="4">
@@ -21,8 +21,8 @@ -The pseudo-streaming works in alliance with a compatible Flash players. -A player sends an HTTP request to the server with a start time +Pseudo-streaming works in alliance with a compatible Flash player. +The player sends an HTTP request to the server with the start time specified in the query string argument (named simply start and specified in seconds), and the server responds with the stream @@ -36,31 +36,30 @@ -To support seeking, H.264-based formats store the metadata -in the so-called “moov atom.” +To support seeking, H.264-based formats store metadata +in a so-called “moov atom”. It is a part of the file that holds the index information for the whole file. -To start playback, a player first needs to read metadata. +To start playback, the player first needs to read metadata. This is done by sending a special request with the start=0 argument. -Much of encoding software will insert the metadata at +A lot of encoding software insert the metadata at the end of the file. -This is bad for pseudo-streaming: -the metadata should be located at the beginning of the file, -or else the entire file will have to be downloaded to -start playing. -If a file is well-formed (with metadata at the -beginning of a file), nginx just sends back the file contents. -Otherwise, it has to read the file and prepare a new stream so that -the metadata comes before the media data. +This is suboptimal for pseudo-streaming, because the player +has to download the entire file before starting playback. +If the metadata are located at the beginning of the file, +it is enough for nginx to simply start sending back the file contents. +If the metadata are located at the end of the file, +nginx must read the entire file and prepare a new stream so that +the metadata come before the media data. This involves some CPU, memory, and disk I/O overhead, so it is a good idea to -prepare an original file for pseudo-streaming, +prepare an original file for pseudo-streaming in advance, rather than having nginx do this on every such request. @@ -68,16 +67,17 @@ For a matching request with a non-zero start argument, nginx will read the metadata from the file, prepare the -stream starting from the requested offset, and send it to a client. +stream starting from the requested offset, and send it to the client. This has the same overhead as described above. If a matching request does not include the start -argument, there is no overhead, and the file is just sent as a static resource. +argument, there is no overhead, and the file is sent simply as a static +resource. Some players also support byte-range requests, and thus do not require -this module at all. +this module. diff -r 1fcf8c840dbe -r 028f6a4d8046 xml/ru/docs/http/ngx_http_mp4_module.xml --- a/xml/ru/docs/http/ngx_http_mp4_module.xml Tue Mar 04 13:02:21 2014 +0000 +++ b/xml/ru/docs/http/ngx_http_mp4_module.xml Tue Mar 04 13:02:21 2014 +0000 @@ -9,7 +9,7 @@ + rev="4">
@@ -38,7 +38,7 @@ В форматах, основанных на H.264, метаданные, необходимые для поддержки -позиционирования, хранятся в так называемом “moov атоме.” +позиционирования, хранятся в так называемом “moov-атоме”. Это часть файла, которая содержит индексную информацию для всего файла. @@ -47,39 +47,37 @@ Для этого он отсылает специальный запрос с аргументом start=0. Многие кодирующие программы добавляют метаданные в конец файла. -Для псевдо-стриминга это плохо: метаданные должны быть расположены -в начале файла, иначе потребуется загрузить файл целиком, прежде -чем начать воспроизведение. -Если файл отформатирован хорошо, с метаданными в начале файла, -nginx просто посылает в ответ -содержимое файла. -В противном случае, он вынужден будет прочитать +Это неоптимально для псевдо-стриминга, поскольку плееру +потребуется загрузить файл целиком прежде чем начать воспроизведение. +Если метаданные находятся в начале файла, +nginx’у достаточно начать отправлять в ответ содержимое файла. +Если же метаданные находятся в конце файла, +потребуется прочитать весь файл и подготовить новый поток, в котором метаданные предшествуют медийным данным. Это требует дополнительного процессорного времени, памяти и дискового ввода/вывода, поэтому лучше - подготовить исходный файл для псевдо-стриминга, -нежели чем заставлять nginx делать это для каждого запроса. +нежели делать это для каждого запроса. Для запроса с ненулевым аргументом start nginx считывает из файла метаданные, готовит поток с запрошенного -смещения, и отправляет его клиенту. +смещения и отправляет его клиенту. Это тоже требует дополнительных ресурсов, как указано выше. Если запрос, обрабатываемый этим модулем, не содержит аргумента start, -дополнительные ресурсы не тратятся, а файл отсылается просто как +дополнительные ресурсы не тратятся, а файл отсылается непосредственно как статический ресурс. Некоторые плееры также поддерживают запросы с указанием диапазона -запрашиваемых байт (byte-range requests), для них вообще не -требуется этот модуль. +запрашиваемых байт (byte-range requests), для них этот модуль не требуется.