Methods and systems for improved content encoding
Methods and systems for improved content encoding are described herein. An encoder may allocate a time budget for encoding each frame of a content item. When the encoder takes longer than the allocated time budget to encode at least a portion of a given frame(s) of the content item at a first resolution, the encoder may take a number of actions in order to allow the encoder to “catch up,” such as encoding frames at a second resolution. Once the encoder catches up and the allocated time budget is not being exceeded, the encoder may resume encoding frames of the content item at the first resolution.
1 . One or more non-transitory computer-readable media storing processor-executable instructions that, when executed by at least one processor of a computing device, cause the computing device to:
determine, based on at least one frame of a plurality of frames, for a first representation of a content item, at least one encoding parameter for encoding at least a portion of the at least one frame for the first representation at a first resolution;
encode the at least one frame for the first representation using the at least one encoding parameter, wherein the first representation is associated with the first resolution;
determine that an amount of time associated with encoding at least the portion of the at least one frame for the first representation is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution; and
based on the amount of time being greater than the expected amount of time, encode at least one frame, of the plurality of frames, for a second representation of the content item using the at least one encoding parameter, wherein the second representation is associated with a second resolution that differs from the first resolution.
2 . The one or more non-transitory computer-readable media of claim 1 , wherein at least one of:
the first resolution is lower than the second resolution; or
the plurality of frames comprises a group of pictures structure.
3 . The one or more non-transitory computer-readable media of claim 1 , wherein the first representation is associated with a first bit rate, wherein the second representation is associated with a second bit rate, and wherein the first bit rate is less than the second bit rate.
4 . The one or more non-transitory computer-readable media of claim 1 , wherein the expected amount of time comprises an allocated time budget associated with at least one of: a computing device or an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
5 . The one or more non-transitory computer-readable media of claim 1 , wherein the processor-executable instructions that cause the computing device to encode the at least one frame for the second representation further cause the computing device to:
determine, based on a frame type associated with the at least one frame for the first representation, and based on a weight associated with the frame type, that the at least one frame for the second representation is to be encoded for the second representation based on the at least one encoding parameter.
6 . The one or more non-transitory computer-readable media of claim 1 , wherein the at least one encoding parameter comprises an intra-prediction parameter, a motion estimation parameter, or a partitioning parameter.
7 . One or more non-transitory computer-readable media storing processor-executable instructions that, when executed by at least one processor of a computing device, cause the computing device to:
encode, using at least one encoding parameter, at least one frame of a plurality of frames of a content item, at a first resolution;
determine that a first amount of time associated with encoding at least a portion of the at least one frame at the first resolution is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution;
encode, based on the first amount of time being greater than the expected amount of time, at least one additional frame of the plurality of frames at a second resolution using the at least one encoding parameter;
determine that a second amount of time associated with encoding at least a portion of the at least one additional frame at the second resolution is less than or equal to the expected amount of time; and
encode, based on the second amount of time being less than or equal to the expected amount of time, at least one further frame of the plurality of frames at the first resolution.
8 . The one or more non-transitory computer-readable media of claim 7 , wherein at least one of:
the first resolution comprises a higher bitrate than the second resolution; or
the plurality of frames comprises a group of pictures structure.
9 . The one or more non-transitory computer-readable media of claim 7 , wherein the expected amount of time comprises an allocated time budget associated with at least one of: a computing device or an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
10 . The one or more non-transitory computer-readable media of claim 7 , wherein the processor-executable instructions that cause the computing device to encode the at least one further frame at the first resolution further cause the computing device to encode, using the at least one encoding parameter, the at least one further frame at the first resolution.
11 . The one or more non-transitory computer-readable media of claim 7 , wherein the at least one encoding parameter comprises an intra-prediction parameter, a motion estimation parameter, or a partitioning parameter, and wherein the intra-prediction parameter, the motion estimation parameter, or the partitioning parameter is associated with the at least one frame or the at least one further frame.
12 . An apparatus comprising:
one or more processors; and
memory storing processor-executable instructions that, when executed by the one or more processors, cause the apparatus to:
determine, based on at least one frame of a plurality of frames, for a first representation of a content item, at least one encoding parameter for encoding at least a portion of the at least one frame for the first representation at a first resolution;
encode the at least one frame for the first representation using the at least one encoding parameter, wherein the first representation is associated with the first resolution;
determine that an amount of time associated with encoding at least the portion of the at least one frame for the first representation is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution; and
based on the amount of time being greater than the expected amount of time, encode at least one frame, of the plurality of frames, for a second representation of the content item using the at least one encoding parameter, wherein the second representation is associated with a second resolution that differs from the first resolution.
13 . The apparatus of claim 12 , wherein at least one of:
the first resolution is lower than the second resolution; or
the plurality of frames comprises a group of pictures structure.
14 . The apparatus of claim 12 , wherein the first representation is associated with a first bit rate, wherein the second representation is associated with a second bit rate, and wherein the first bit rate is less than the second bit rate.
15 . The apparatus of claim 12 , wherein the expected amount of time comprises an allocated time budget associated with at least one of: a computing device or an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
16 . The apparatus of claim 12 , wherein the processor-executable instructions that cause the apparatus to encode the at least one frame for the second representation further cause the apparatus to:
determine, based on a frame type associated with the at least one frame for the first representation, and based on a weight associated with the frame type, that the at least one frame for the second representation is to be encoded for the second representation based on the at least one encoding parameter.
17 . The apparatus of claim 12 , wherein the at least one encoding parameter comprises an intra-prediction parameter, a motion estimation parameter, or a partitioning parameter.
18 . A method comprising:
determining, by a computing device, based on at least one frame of a plurality of frames, for a first representation of a content item, at least one encoding parameter for encoding at least a portion of the at least one frame for the first representation at a first resolution;
causing the at least one frame for the first representation to be encoded using the at least one encoding parameter, wherein the first representation is associated with the first resolution;
determining that an amount of time associated with encoding at least the portion of the at least one frame for the first representation is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution; and
based on the amount of time being greater than the expected amount of time, causing at least one frame, of the plurality of frames, to be encoded for a second representation of the content item using the at least one encoding parameter, wherein the second representation is associated with a second resolution that differs from the first resolution.
19 . The method of claim 18 , wherein at least one of:
the first resolution is lower than the second resolution; or
the plurality of frames comprises a group of pictures structure.
20 . The method of claim 18 , wherein the first representation is associated with a first bit rate, wherein the second representation is associated with a second bit rate, and wherein the first bit rate is less than the second bit rate.
21 . The method of claim 18 , wherein the expected amount of time comprises an allocated time budget associated an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
22 . The method of claim 18 , wherein causing the at least one frame to be encoded for the second representation of the content item using the at least one encoding parameter comprises determining, based on a frame type associated with the at least one frame for the first representation, and based on a weight associated with the frame type, that the at least one frame for the second representation is to be encoded for the second representation based on the at least one encoding parameter.
23 . The method of claim 18 , wherein the at least one encoding parameter comprises an intra-prediction parameter, a motion estimation parameter, or a partitioning parameter.
24 . An apparatus comprising:
one or more processors; and
memory storing processor-executable instructions that, when executed by the one or more processors, cause the apparatus to:
encode, using at least one encoding parameter, at least one frame of a plurality of frames of a content item, at a first resolution;
determine that a first amount of time associated with encoding at least a portion of the at least one frame at the first resolution is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution;
encode, based on the first amount of time being greater than the expected amount of time, at least one additional frame of the plurality of frames at a second resolution using the at least one encoding parameter;
determine that a second amount of time associated with encoding at least a portion of the at least one additional frame at the second resolution is less than or equal to the expected amount of time; and
encode, based on the second amount of time being less than or equal to the expected amount of time, at least one further frame of the plurality of frames at the first resolution.
25 . The apparatus of claim 24 , wherein at least one of:
the first resolution comprises a higher bitrate than the second resolution; or
the plurality of frames comprises a group of pictures structure.
26 . The apparatus of claim 24 , wherein the expected amount of time comprises an allocated time budget associated with at least one of: a computing device or an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
27 . The apparatus of claim 24 , wherein the processor-executable instructions that cause the apparatus to encode the at least one further frame at the first resolution further cause the apparatus to encode, using the at least one encoding parameter, the at least one further frame at the first resolution.
28 . The apparatus of claim 24 , wherein the at least one encoding parameter comprises an intra-prediction parameter, a motion estimation parameter, or a partitioning parameter, and wherein the intra-prediction parameter, the motion estimation parameter, or the partitioning parameter is associated with the at least one frame or the at least one further frame.
29 . A method comprising:
causing, by a computing device, at least one frame of a plurality of frames of a content item to be encoded at a first resolution using at least one encoding parameter;
determining that a first amount of time associated with encoding at least a portion of the at least one frame at the first resolution is greater than an expected amount of time for encoding at least a portion of any frame, of the plurality of frames, at the first resolution;
causing, based on the first amount of time being greater than the expected amount of time, at least one additional frame of the plurality of frames to be encoded at a second resolution using the at least one encoding parameter;
determining that a second amount of time associated with encoding at least a portion of the at least one additional frame at the second resolution is less than or equal to the expected amount of time; and
causing, based on the second amount of time being less than or equal to the expected amount of time, at least one further frame of the plurality of frames to be encoded at the first resolution.
30 . The method of claim 29 , wherein at least one of:
the first resolution comprises a higher bitrate than the second resolution; or
the plurality of frames comprises a group of pictures structure.
31 . The method of claim 29 , wherein the expected amount of time comprises an allocated time budget associated an encoding device associated with encoding at least a portion of any frame, of the plurality of frames, at the first resolution.
32 . The method of claim 29 , wherein causing the at least one further frame to be encoded at the first resolution further comprises causing the at least one further frame to be encoded at the first resolution using the at least one encoding parameter.