tronjae.blogg.se

Ffmpeg h264 input hls output
Ffmpeg h264 input hls output













ffmpeg h264 input hls output

  • -sc_threshold 0 – don’t create key frames on scene change – only according to -g.
  • -g 48 -keyint_min 48 – create key frame (I-frame) every 48 frames (~2 seconds) – will later affect correct slicing of segments and alignment of renditions.
  • -crf 20 – Constant Rate Factor, high level factor for overall quality.
  • -profile:v main – set H264 profile to main – this means support in modern devices.
  • -c:v h264 – set video codec to be H264 which is the standard codec of HLS segments.
  • ffmpeg h264 input hls output

    -c:a aac -ar 48000 -b:a 96k – set audio codec to AAC with sampling of 48kHz and bitrate of 128k.-vf "scale=w=1280:h=720:force_original_aspect_ratio=decrease" – scale video to maximum possible within 1280×720 while preserving aspect ratio.-i serenity.mp4 – set serenity.mkv as input file.The explanation for each of the parameters in the example are described in the following list: hls_segment_filename serenity/360p_%03d.ts \

    ffmpeg h264 input hls output

    vf scale=w=640:h=360:force_original_aspect_ratio=decrease \ # Create the directory to store the files HLS works with Transport Stream segments and has much tighter control over the characteristics of the streams (or renditions in HLS parlance).Įncoding a single rendition of your video looks like this for an H264 product. It provides a lot of tools and supports the creation of the necessary files out of the box. We will use FFMPEG command line tool to create the HLS video. HLS works differently than DASH with different formats and parameters. I’m also banking on the fact that H264 has better support in both Apple and non-Apple devices. The technologies to implement HEVC in HLS is significantly different than what we discuss here so I’ll probably do a separate post on it rather than confuse matters. At WWDC 2017, Apple announced support for HEVC (H265), letting you work with both types of streams in the same playlist.















    Ffmpeg h264 input hls output