amazon-elastic-transcoder

Convert MP4 to HLS with AWS Elastic transcoder.


I am planning to convert MP4(1920x1080, bitrate may vary from mp4 to mp4) to HLS(different type of resolution).

different type of resolution, I am looking for

To achieve the above, I have written a Lambda functin in NodeJS and I have used below "System Presets". HLS O/P file is creating but the RESOLUTIONs are not as per my expectation. It's some time coming correct for few cases. But in generic the value(WxH) is not constant.

I tried but not getting any solution. I need the help of anyone to resolve my problems.


Solution

  • Thanks, your question is very clear. Recently I had experience same kind of issue. Please find the below solutions.

    Here what I understand, you want specific resolution output files.

    You have to create new custom presets.I am mentioning one custom preset for 1080p, you have follow for the rest.

    1080p = 1920x1080

    Create new presets : -

    First of all you have to choose one existing System Presets. For example - System preset: HLS Video - 1.5M and change the configuration value in the video section only as per below settings

    Name - Custom HLS Video Auto - 1080p
    Container - ts
    Codec - H.264
    Codec Options - InterlacedMode:Progressive,MaxReferenceFrames:3,Level:3.1,ColorSpaceConversionMode:None,Profile:main
    Max Bit Rate - left blank (optional)
    Buffer Size - left blank (optional)
    Maximum Number of Frames Between Keyframes - 90
    Fixed Number of Frames Between Keyframes - true
    Bit Rate - auto
    Frame Rate -  auto
    Video Max Frame Rate - 30
    Max Width - 1920
    Max Height - 1080
    Sizing Policy - Fit
    Padding Policy - NoPad
    Display Aspect Ratio -   auto
    

    These 3 settings are important

    For other resolution, you have to create new custom presets by changing the Max Width & Max Height.Everything will remain same as it is.