Here’s the ffmpeg command to generate the variants and the master playlist: ffmpeg -y -i sintel_trailer-1080p.mp4 \ (The stream references are highlighted, which we’ll need shortly.) We’ll need to encode the video stream for each variant but we can just copy the audio as is because it’s already encoded as AAC and the bit rate lies within the recommended range (32 to 160 kb/s). We can see there are two available streams: a video and an audio stream. Ignore the warning about the missing output file. Stream #0:1(und): Audio: aac (LC) (mp4a / 0圆134706D), 48000 Hz, stereo, fltp, 126 kb/s (default)Īt least one output file must be specified Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sintel_trailer-1080p.mp4':Ĭopyright : (c) copyright Blender Foundation | ĭescription : Trailer for the Sintel open movie projectĭuration: 00:00:52.21, start: 0.000000, bitrate: 2240 kb/s The first thing to do is determine what streams are in the video, which we can do with the following command: $ ffmpeg -i sintel_trailer-1080p.mp4 -hide_banner The bit rates will be 2 kB/s and 365 kb/s respectively (as per Apple’s guidelines). We’ll create two variants: a 540p and a 360p version. Apple publishes guidelines for authoring HLS video streams that includes – among other things – recommended video and audio bit rates. The examples below use the 1080p version of the Sintel trailer which you can download here. ![]() It allows a client device to choose the most appropriate stream based on factors such as the capabilities of the device, available bandwidth, and so on. ![]() In this post you’ll see how to create an HLS master playlist with ffmpeg for video on-demand.Ī master playlist contains references to different variant streams (typically encoded at different bit rates) and can also include links to alternative audio tracks and audio-only renditions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |