Media Styles
Media Styles
This note explains the usage of the stream
, image
, and video
functions in Larupload.
The stream
function is used to create an HTTP Live Streaming (HLS) stream, which is a video streaming protocol that breaks the video into smaller segments and delivers them over HTTP. The image
and video
functions are used to manipulate images and videos, respectively.
When you want to create an HLS stream for a video, you can use the stream
function available in the Attachment
class of the attachments
method within their model. This function takes some arguments that specify the stream's resolution, bitrate, and other properties.
On the other hand, if you want to manipulate images or videos, you should use the image
and video
functions, respectively. These functions provide a set of options for resizing, cropping, and modifying the image or video.
Image Style
name
string
–
style name. examples: thumbnail, small, ...
width
?int
null
width of the manipulated image
height
?int
null
height of the manipulated image
mode
LaruploadMediaStyle
AUTO
this argument specifies how Larupload should manipulate the uploaded image and can take on any of the following values: FIT
, AUTO
, SCALE_WIDTH
, SCALE_HEIGHT
, CROP
Video Style
name
string
–
style name. examples: thumbnail, small, ...
width
?int
null
width of the manipulated video
height
?int
null
height of the manipulated video
mode
LaruploadMediaStyle
SCALE_HEIGHT
this argument specifies how Larupload should manipulate the uploaded video and can take on any of the following values: FIT
, AUTO
, SCALE_WIDTH
, SCALE_HEIGHT
, CROP
format
X264
new X264
by default, the encoding format for video is X264
. However, users can specify additional options for this format, including adjusting the kilobitrate
for both audio
and video
. This allows for more precise configuration and optimization of the user's encoding preferences.
padding
bool
false
If set to true
, padding will be applied to the video using a black color in order to fit the given dimensions.
Stream Style
name
string
–
label for stream quality. highly recommended to use string labels like 720p
width
int
–
height
int
–
format
X264
–
by default, the encoding format for video is X264
. However, users can specify additional options for this format, including adjusting the kilobitrate
for both audio
and video
. This allows for more precise configuration and optimization of the user's encoding preferences.
padding
bool
false
If set to true
, padding will be applied to the video using a black color in order to fit the given dimensions.
Last updated