{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaLive.Types.Mpeg2Settings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.Mpeg2Settings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AfdSignaling
import Amazonka.MediaLive.Types.FixedAfd
import Amazonka.MediaLive.Types.Mpeg2AdaptiveQuantization
import Amazonka.MediaLive.Types.Mpeg2ColorMetadata
import Amazonka.MediaLive.Types.Mpeg2ColorSpace
import Amazonka.MediaLive.Types.Mpeg2DisplayRatio
import Amazonka.MediaLive.Types.Mpeg2FilterSettings
import Amazonka.MediaLive.Types.Mpeg2GopSizeUnits
import Amazonka.MediaLive.Types.Mpeg2ScanType
import Amazonka.MediaLive.Types.Mpeg2SubGopLength
import Amazonka.MediaLive.Types.Mpeg2TimecodeInsertionBehavior
import qualified Amazonka.Prelude as Prelude

-- | Mpeg2 Settings
--
-- /See:/ 'newMpeg2Settings' smart constructor.
data Mpeg2Settings = Mpeg2Settings'
  { -- | Set the scan type of the output to PROGRESSIVE or INTERLACED (top field
    -- first).
    Mpeg2Settings -> Maybe Mpeg2ScanType
scanType :: Prelude.Maybe Mpeg2ScanType,
    -- | Determines how MediaLive inserts timecodes in the output video. For
    -- detailed information about setting up the input and the output for a
    -- timecode, see the section on \\\"MediaLive Features - Timecode
    -- configuration\\\" in the MediaLive User Guide. DISABLED: do not include
    -- timecodes. GOP_TIMECODE: Include timecode metadata in the GOP header.
    Mpeg2Settings -> Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion :: Prelude.Maybe Mpeg2TimecodeInsertionBehavior,
    -- | Indicates the AFD values that MediaLive will write into the video
    -- encode. If you do not know what AFD signaling is, or if your downstream
    -- system has not given you guidance, choose AUTO. AUTO: MediaLive will try
    -- to preserve the input AFD value (in cases where multiple AFD values are
    -- valid). FIXED: MediaLive will use the value you specify in fixedAFD.
    Mpeg2Settings -> Maybe AfdSignaling
afdSignaling :: Prelude.Maybe AfdSignaling,
    -- | Relates to the GOP structure. The GOP size (keyframe interval) in the
    -- units specified in gopSizeUnits. If you do not know what GOP is, use the
    -- default. If gopSizeUnits is frames, then the gopSize must be an integer
    -- and must be greater than or equal to 1. If gopSizeUnits is seconds, the
    -- gopSize must be greater than 0, but does not need to be an integer.
    Mpeg2Settings -> Maybe Double
gopSize :: Prelude.Maybe Prelude.Double,
    -- | Relates to the GOP structure. Specifies whether the gopSize is specified
    -- in frames or seconds. If you do not plan to change the default gopSize,
    -- leave the default. If you specify SECONDS, MediaLive will internally
    -- convert the gop size to a frame count.
    Mpeg2Settings -> Maybe Mpeg2GopSizeUnits
gopSizeUnits :: Prelude.Maybe Mpeg2GopSizeUnits,
    -- | Relates to the GOP structure. If you do not know what GOP is, use the
    -- default. FIXED: Set the number of B-frames in each sub-GOP to the value
    -- in gopNumBFrames. DYNAMIC: Let MediaLive optimize the number of B-frames
    -- in each sub-GOP, to improve visual quality.
    Mpeg2Settings -> Maybe Mpeg2SubGopLength
subgopLength :: Prelude.Maybe Mpeg2SubGopLength,
    -- | Sets the pixel aspect ratio for the encode.
    Mpeg2Settings -> Maybe Mpeg2DisplayRatio
displayAspectRatio :: Prelude.Maybe Mpeg2DisplayRatio,
    -- | Relates to the GOP structure. The number of B-frames between reference
    -- frames. If you do not know what a B-frame is, use the default.
    Mpeg2Settings -> Maybe Natural
gopNumBFrames :: Prelude.Maybe Prelude.Natural,
    -- | Complete this field only when afdSignaling is set to FIXED. Enter the
    -- AFD value (4 bits) to write on all frames of the video encode.
    Mpeg2Settings -> Maybe FixedAfd
fixedAfd :: Prelude.Maybe FixedAfd,
    -- | Optionally specify a noise reduction filter, which can improve quality
    -- of compressed content. If you do not choose a filter, no filter will be
    -- applied. TEMPORAL: This filter is useful for both source content that is
    -- noisy (when it has excessive digital artifacts) and source content that
    -- is clean. When the content is noisy, the filter cleans up the source
    -- content before the encoding phase, with these two effects: First, it
    -- improves the output video quality because the content has been cleaned
    -- up. Secondly, it decreases the bandwidth because MediaLive does not
    -- waste bits on encoding noise. When the content is reasonably clean, the
    -- filter tends to decrease the bitrate.
    Mpeg2Settings -> Maybe Mpeg2FilterSettings
filterSettings :: Prelude.Maybe Mpeg2FilterSettings,
    -- | Specifies whether to include the color space metadata. The metadata
    -- describes the color space that applies to the video (the colorSpace
    -- field). We recommend that you insert the metadata.
    Mpeg2Settings -> Maybe Mpeg2ColorMetadata
colorMetadata :: Prelude.Maybe Mpeg2ColorMetadata,
    -- | Choose Off to disable adaptive quantization. Or choose another value to
    -- enable the quantizer and set its strength. The strengths are: Auto, Off,
    -- Low, Medium, High. When you enable this field, MediaLive allows
    -- intra-frame quantizers to vary, which might improve visual quality.
    Mpeg2Settings -> Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization :: Prelude.Maybe Mpeg2AdaptiveQuantization,
    -- | MPEG2: default is open GOP.
    Mpeg2Settings -> Maybe Natural
gopClosedCadence :: Prelude.Maybe Prelude.Natural,
    -- | Choose the type of color space conversion to apply to the output. For
    -- detailed information on setting up both the input and the output to
    -- obtain the desired color space in the output, see the section on
    -- \\\"MediaLive Features - Video - color space\\\" in the MediaLive User
    -- Guide. PASSTHROUGH: Keep the color space of the input content - do not
    -- convert it. AUTO:Convert all content that is SD to rec 601, and convert
    -- all content that is HD to rec 709.
    Mpeg2Settings -> Maybe Mpeg2ColorSpace
colorSpace :: Prelude.Maybe Mpeg2ColorSpace,
    -- | The framerate numerator. For example, 24000. The framerate is the
    -- numerator divided by the denominator. For example, 24000 \/ 1001 =
    -- 23.976 FPS.
    Mpeg2Settings -> Natural
framerateNumerator :: Prelude.Natural,
    -- | description\": \"The framerate denominator. For example, 1001. The
    -- framerate is the numerator divided by the denominator. For example,
    -- 24000 \/ 1001 = 23.976 FPS.
    Mpeg2Settings -> Natural
framerateDenominator :: Prelude.Natural
  }
  deriving (Mpeg2Settings -> Mpeg2Settings -> Bool
(Mpeg2Settings -> Mpeg2Settings -> Bool)
-> (Mpeg2Settings -> Mpeg2Settings -> Bool) -> Eq Mpeg2Settings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Mpeg2Settings -> Mpeg2Settings -> Bool
$c/= :: Mpeg2Settings -> Mpeg2Settings -> Bool
== :: Mpeg2Settings -> Mpeg2Settings -> Bool
$c== :: Mpeg2Settings -> Mpeg2Settings -> Bool
Prelude.Eq, ReadPrec [Mpeg2Settings]
ReadPrec Mpeg2Settings
Int -> ReadS Mpeg2Settings
ReadS [Mpeg2Settings]
(Int -> ReadS Mpeg2Settings)
-> ReadS [Mpeg2Settings]
-> ReadPrec Mpeg2Settings
-> ReadPrec [Mpeg2Settings]
-> Read Mpeg2Settings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Mpeg2Settings]
$creadListPrec :: ReadPrec [Mpeg2Settings]
readPrec :: ReadPrec Mpeg2Settings
$creadPrec :: ReadPrec Mpeg2Settings
readList :: ReadS [Mpeg2Settings]
$creadList :: ReadS [Mpeg2Settings]
readsPrec :: Int -> ReadS Mpeg2Settings
$creadsPrec :: Int -> ReadS Mpeg2Settings
Prelude.Read, Int -> Mpeg2Settings -> ShowS
[Mpeg2Settings] -> ShowS
Mpeg2Settings -> String
(Int -> Mpeg2Settings -> ShowS)
-> (Mpeg2Settings -> String)
-> ([Mpeg2Settings] -> ShowS)
-> Show Mpeg2Settings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Mpeg2Settings] -> ShowS
$cshowList :: [Mpeg2Settings] -> ShowS
show :: Mpeg2Settings -> String
$cshow :: Mpeg2Settings -> String
showsPrec :: Int -> Mpeg2Settings -> ShowS
$cshowsPrec :: Int -> Mpeg2Settings -> ShowS
Prelude.Show, (forall x. Mpeg2Settings -> Rep Mpeg2Settings x)
-> (forall x. Rep Mpeg2Settings x -> Mpeg2Settings)
-> Generic Mpeg2Settings
forall x. Rep Mpeg2Settings x -> Mpeg2Settings
forall x. Mpeg2Settings -> Rep Mpeg2Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Mpeg2Settings x -> Mpeg2Settings
$cfrom :: forall x. Mpeg2Settings -> Rep Mpeg2Settings x
Prelude.Generic)

-- |
-- Create a value of 'Mpeg2Settings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'scanType', 'mpeg2Settings_scanType' - Set the scan type of the output to PROGRESSIVE or INTERLACED (top field
-- first).
--
-- 'timecodeInsertion', 'mpeg2Settings_timecodeInsertion' - Determines how MediaLive inserts timecodes in the output video. For
-- detailed information about setting up the input and the output for a
-- timecode, see the section on \\\"MediaLive Features - Timecode
-- configuration\\\" in the MediaLive User Guide. DISABLED: do not include
-- timecodes. GOP_TIMECODE: Include timecode metadata in the GOP header.
--
-- 'afdSignaling', 'mpeg2Settings_afdSignaling' - Indicates the AFD values that MediaLive will write into the video
-- encode. If you do not know what AFD signaling is, or if your downstream
-- system has not given you guidance, choose AUTO. AUTO: MediaLive will try
-- to preserve the input AFD value (in cases where multiple AFD values are
-- valid). FIXED: MediaLive will use the value you specify in fixedAFD.
--
-- 'gopSize', 'mpeg2Settings_gopSize' - Relates to the GOP structure. The GOP size (keyframe interval) in the
-- units specified in gopSizeUnits. If you do not know what GOP is, use the
-- default. If gopSizeUnits is frames, then the gopSize must be an integer
-- and must be greater than or equal to 1. If gopSizeUnits is seconds, the
-- gopSize must be greater than 0, but does not need to be an integer.
--
-- 'gopSizeUnits', 'mpeg2Settings_gopSizeUnits' - Relates to the GOP structure. Specifies whether the gopSize is specified
-- in frames or seconds. If you do not plan to change the default gopSize,
-- leave the default. If you specify SECONDS, MediaLive will internally
-- convert the gop size to a frame count.
--
-- 'subgopLength', 'mpeg2Settings_subgopLength' - Relates to the GOP structure. If you do not know what GOP is, use the
-- default. FIXED: Set the number of B-frames in each sub-GOP to the value
-- in gopNumBFrames. DYNAMIC: Let MediaLive optimize the number of B-frames
-- in each sub-GOP, to improve visual quality.
--
-- 'displayAspectRatio', 'mpeg2Settings_displayAspectRatio' - Sets the pixel aspect ratio for the encode.
--
-- 'gopNumBFrames', 'mpeg2Settings_gopNumBFrames' - Relates to the GOP structure. The number of B-frames between reference
-- frames. If you do not know what a B-frame is, use the default.
--
-- 'fixedAfd', 'mpeg2Settings_fixedAfd' - Complete this field only when afdSignaling is set to FIXED. Enter the
-- AFD value (4 bits) to write on all frames of the video encode.
--
-- 'filterSettings', 'mpeg2Settings_filterSettings' - Optionally specify a noise reduction filter, which can improve quality
-- of compressed content. If you do not choose a filter, no filter will be
-- applied. TEMPORAL: This filter is useful for both source content that is
-- noisy (when it has excessive digital artifacts) and source content that
-- is clean. When the content is noisy, the filter cleans up the source
-- content before the encoding phase, with these two effects: First, it
-- improves the output video quality because the content has been cleaned
-- up. Secondly, it decreases the bandwidth because MediaLive does not
-- waste bits on encoding noise. When the content is reasonably clean, the
-- filter tends to decrease the bitrate.
--
-- 'colorMetadata', 'mpeg2Settings_colorMetadata' - Specifies whether to include the color space metadata. The metadata
-- describes the color space that applies to the video (the colorSpace
-- field). We recommend that you insert the metadata.
--
-- 'adaptiveQuantization', 'mpeg2Settings_adaptiveQuantization' - Choose Off to disable adaptive quantization. Or choose another value to
-- enable the quantizer and set its strength. The strengths are: Auto, Off,
-- Low, Medium, High. When you enable this field, MediaLive allows
-- intra-frame quantizers to vary, which might improve visual quality.
--
-- 'gopClosedCadence', 'mpeg2Settings_gopClosedCadence' - MPEG2: default is open GOP.
--
-- 'colorSpace', 'mpeg2Settings_colorSpace' - Choose the type of color space conversion to apply to the output. For
-- detailed information on setting up both the input and the output to
-- obtain the desired color space in the output, see the section on
-- \\\"MediaLive Features - Video - color space\\\" in the MediaLive User
-- Guide. PASSTHROUGH: Keep the color space of the input content - do not
-- convert it. AUTO:Convert all content that is SD to rec 601, and convert
-- all content that is HD to rec 709.
--
-- 'framerateNumerator', 'mpeg2Settings_framerateNumerator' - The framerate numerator. For example, 24000. The framerate is the
-- numerator divided by the denominator. For example, 24000 \/ 1001 =
-- 23.976 FPS.
--
-- 'framerateDenominator', 'mpeg2Settings_framerateDenominator' - description\": \"The framerate denominator. For example, 1001. The
-- framerate is the numerator divided by the denominator. For example,
-- 24000 \/ 1001 = 23.976 FPS.
newMpeg2Settings ::
  -- | 'framerateNumerator'
  Prelude.Natural ->
  -- | 'framerateDenominator'
  Prelude.Natural ->
  Mpeg2Settings
newMpeg2Settings :: Natural -> Natural -> Mpeg2Settings
newMpeg2Settings
  Natural
pFramerateNumerator_
  Natural
pFramerateDenominator_ =
    Mpeg2Settings' :: Maybe Mpeg2ScanType
-> Maybe Mpeg2TimecodeInsertionBehavior
-> Maybe AfdSignaling
-> Maybe Double
-> Maybe Mpeg2GopSizeUnits
-> Maybe Mpeg2SubGopLength
-> Maybe Mpeg2DisplayRatio
-> Maybe Natural
-> Maybe FixedAfd
-> Maybe Mpeg2FilterSettings
-> Maybe Mpeg2ColorMetadata
-> Maybe Mpeg2AdaptiveQuantization
-> Maybe Natural
-> Maybe Mpeg2ColorSpace
-> Natural
-> Natural
-> Mpeg2Settings
Mpeg2Settings'
      { $sel:scanType:Mpeg2Settings' :: Maybe Mpeg2ScanType
scanType = Maybe Mpeg2ScanType
forall a. Maybe a
Prelude.Nothing,
        $sel:timecodeInsertion:Mpeg2Settings' :: Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion = Maybe Mpeg2TimecodeInsertionBehavior
forall a. Maybe a
Prelude.Nothing,
        $sel:afdSignaling:Mpeg2Settings' :: Maybe AfdSignaling
afdSignaling = Maybe AfdSignaling
forall a. Maybe a
Prelude.Nothing,
        $sel:gopSize:Mpeg2Settings' :: Maybe Double
gopSize = Maybe Double
forall a. Maybe a
Prelude.Nothing,
        $sel:gopSizeUnits:Mpeg2Settings' :: Maybe Mpeg2GopSizeUnits
gopSizeUnits = Maybe Mpeg2GopSizeUnits
forall a. Maybe a
Prelude.Nothing,
        $sel:subgopLength:Mpeg2Settings' :: Maybe Mpeg2SubGopLength
subgopLength = Maybe Mpeg2SubGopLength
forall a. Maybe a
Prelude.Nothing,
        $sel:displayAspectRatio:Mpeg2Settings' :: Maybe Mpeg2DisplayRatio
displayAspectRatio = Maybe Mpeg2DisplayRatio
forall a. Maybe a
Prelude.Nothing,
        $sel:gopNumBFrames:Mpeg2Settings' :: Maybe Natural
gopNumBFrames = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:fixedAfd:Mpeg2Settings' :: Maybe FixedAfd
fixedAfd = Maybe FixedAfd
forall a. Maybe a
Prelude.Nothing,
        $sel:filterSettings:Mpeg2Settings' :: Maybe Mpeg2FilterSettings
filterSettings = Maybe Mpeg2FilterSettings
forall a. Maybe a
Prelude.Nothing,
        $sel:colorMetadata:Mpeg2Settings' :: Maybe Mpeg2ColorMetadata
colorMetadata = Maybe Mpeg2ColorMetadata
forall a. Maybe a
Prelude.Nothing,
        $sel:adaptiveQuantization:Mpeg2Settings' :: Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization = Maybe Mpeg2AdaptiveQuantization
forall a. Maybe a
Prelude.Nothing,
        $sel:gopClosedCadence:Mpeg2Settings' :: Maybe Natural
gopClosedCadence = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:colorSpace:Mpeg2Settings' :: Maybe Mpeg2ColorSpace
colorSpace = Maybe Mpeg2ColorSpace
forall a. Maybe a
Prelude.Nothing,
        $sel:framerateNumerator:Mpeg2Settings' :: Natural
framerateNumerator = Natural
pFramerateNumerator_,
        $sel:framerateDenominator:Mpeg2Settings' :: Natural
framerateDenominator = Natural
pFramerateDenominator_
      }

-- | Set the scan type of the output to PROGRESSIVE or INTERLACED (top field
-- first).
mpeg2Settings_scanType :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2ScanType)
mpeg2Settings_scanType :: (Maybe Mpeg2ScanType -> f (Maybe Mpeg2ScanType))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_scanType = (Mpeg2Settings -> Maybe Mpeg2ScanType)
-> (Mpeg2Settings -> Maybe Mpeg2ScanType -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2ScanType)
     (Maybe Mpeg2ScanType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2ScanType
scanType :: Maybe Mpeg2ScanType
$sel:scanType:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ScanType
scanType} -> Maybe Mpeg2ScanType
scanType) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2ScanType
a -> Mpeg2Settings
s {$sel:scanType:Mpeg2Settings' :: Maybe Mpeg2ScanType
scanType = Maybe Mpeg2ScanType
a} :: Mpeg2Settings)

-- | Determines how MediaLive inserts timecodes in the output video. For
-- detailed information about setting up the input and the output for a
-- timecode, see the section on \\\"MediaLive Features - Timecode
-- configuration\\\" in the MediaLive User Guide. DISABLED: do not include
-- timecodes. GOP_TIMECODE: Include timecode metadata in the GOP header.
mpeg2Settings_timecodeInsertion :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2TimecodeInsertionBehavior)
mpeg2Settings_timecodeInsertion :: (Maybe Mpeg2TimecodeInsertionBehavior
 -> f (Maybe Mpeg2TimecodeInsertionBehavior))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_timecodeInsertion = (Mpeg2Settings -> Maybe Mpeg2TimecodeInsertionBehavior)
-> (Mpeg2Settings
    -> Maybe Mpeg2TimecodeInsertionBehavior -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2TimecodeInsertionBehavior)
     (Maybe Mpeg2TimecodeInsertionBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion :: Maybe Mpeg2TimecodeInsertionBehavior
$sel:timecodeInsertion:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion} -> Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2TimecodeInsertionBehavior
a -> Mpeg2Settings
s {$sel:timecodeInsertion:Mpeg2Settings' :: Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion = Maybe Mpeg2TimecodeInsertionBehavior
a} :: Mpeg2Settings)

-- | Indicates the AFD values that MediaLive will write into the video
-- encode. If you do not know what AFD signaling is, or if your downstream
-- system has not given you guidance, choose AUTO. AUTO: MediaLive will try
-- to preserve the input AFD value (in cases where multiple AFD values are
-- valid). FIXED: MediaLive will use the value you specify in fixedAFD.
mpeg2Settings_afdSignaling :: Lens.Lens' Mpeg2Settings (Prelude.Maybe AfdSignaling)
mpeg2Settings_afdSignaling :: (Maybe AfdSignaling -> f (Maybe AfdSignaling))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_afdSignaling = (Mpeg2Settings -> Maybe AfdSignaling)
-> (Mpeg2Settings -> Maybe AfdSignaling -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe AfdSignaling)
     (Maybe AfdSignaling)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe AfdSignaling
afdSignaling :: Maybe AfdSignaling
$sel:afdSignaling:Mpeg2Settings' :: Mpeg2Settings -> Maybe AfdSignaling
afdSignaling} -> Maybe AfdSignaling
afdSignaling) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe AfdSignaling
a -> Mpeg2Settings
s {$sel:afdSignaling:Mpeg2Settings' :: Maybe AfdSignaling
afdSignaling = Maybe AfdSignaling
a} :: Mpeg2Settings)

-- | Relates to the GOP structure. The GOP size (keyframe interval) in the
-- units specified in gopSizeUnits. If you do not know what GOP is, use the
-- default. If gopSizeUnits is frames, then the gopSize must be an integer
-- and must be greater than or equal to 1. If gopSizeUnits is seconds, the
-- gopSize must be greater than 0, but does not need to be an integer.
mpeg2Settings_gopSize :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Prelude.Double)
mpeg2Settings_gopSize :: (Maybe Double -> f (Maybe Double))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_gopSize = (Mpeg2Settings -> Maybe Double)
-> (Mpeg2Settings -> Maybe Double -> Mpeg2Settings)
-> Lens Mpeg2Settings Mpeg2Settings (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Double
gopSize :: Maybe Double
$sel:gopSize:Mpeg2Settings' :: Mpeg2Settings -> Maybe Double
gopSize} -> Maybe Double
gopSize) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Double
a -> Mpeg2Settings
s {$sel:gopSize:Mpeg2Settings' :: Maybe Double
gopSize = Maybe Double
a} :: Mpeg2Settings)

-- | Relates to the GOP structure. Specifies whether the gopSize is specified
-- in frames or seconds. If you do not plan to change the default gopSize,
-- leave the default. If you specify SECONDS, MediaLive will internally
-- convert the gop size to a frame count.
mpeg2Settings_gopSizeUnits :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2GopSizeUnits)
mpeg2Settings_gopSizeUnits :: (Maybe Mpeg2GopSizeUnits -> f (Maybe Mpeg2GopSizeUnits))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_gopSizeUnits = (Mpeg2Settings -> Maybe Mpeg2GopSizeUnits)
-> (Mpeg2Settings -> Maybe Mpeg2GopSizeUnits -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2GopSizeUnits)
     (Maybe Mpeg2GopSizeUnits)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2GopSizeUnits
gopSizeUnits :: Maybe Mpeg2GopSizeUnits
$sel:gopSizeUnits:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2GopSizeUnits
gopSizeUnits} -> Maybe Mpeg2GopSizeUnits
gopSizeUnits) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2GopSizeUnits
a -> Mpeg2Settings
s {$sel:gopSizeUnits:Mpeg2Settings' :: Maybe Mpeg2GopSizeUnits
gopSizeUnits = Maybe Mpeg2GopSizeUnits
a} :: Mpeg2Settings)

-- | Relates to the GOP structure. If you do not know what GOP is, use the
-- default. FIXED: Set the number of B-frames in each sub-GOP to the value
-- in gopNumBFrames. DYNAMIC: Let MediaLive optimize the number of B-frames
-- in each sub-GOP, to improve visual quality.
mpeg2Settings_subgopLength :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2SubGopLength)
mpeg2Settings_subgopLength :: (Maybe Mpeg2SubGopLength -> f (Maybe Mpeg2SubGopLength))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_subgopLength = (Mpeg2Settings -> Maybe Mpeg2SubGopLength)
-> (Mpeg2Settings -> Maybe Mpeg2SubGopLength -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2SubGopLength)
     (Maybe Mpeg2SubGopLength)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2SubGopLength
subgopLength :: Maybe Mpeg2SubGopLength
$sel:subgopLength:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2SubGopLength
subgopLength} -> Maybe Mpeg2SubGopLength
subgopLength) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2SubGopLength
a -> Mpeg2Settings
s {$sel:subgopLength:Mpeg2Settings' :: Maybe Mpeg2SubGopLength
subgopLength = Maybe Mpeg2SubGopLength
a} :: Mpeg2Settings)

-- | Sets the pixel aspect ratio for the encode.
mpeg2Settings_displayAspectRatio :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2DisplayRatio)
mpeg2Settings_displayAspectRatio :: (Maybe Mpeg2DisplayRatio -> f (Maybe Mpeg2DisplayRatio))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_displayAspectRatio = (Mpeg2Settings -> Maybe Mpeg2DisplayRatio)
-> (Mpeg2Settings -> Maybe Mpeg2DisplayRatio -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2DisplayRatio)
     (Maybe Mpeg2DisplayRatio)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2DisplayRatio
displayAspectRatio :: Maybe Mpeg2DisplayRatio
$sel:displayAspectRatio:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2DisplayRatio
displayAspectRatio} -> Maybe Mpeg2DisplayRatio
displayAspectRatio) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2DisplayRatio
a -> Mpeg2Settings
s {$sel:displayAspectRatio:Mpeg2Settings' :: Maybe Mpeg2DisplayRatio
displayAspectRatio = Maybe Mpeg2DisplayRatio
a} :: Mpeg2Settings)

-- | Relates to the GOP structure. The number of B-frames between reference
-- frames. If you do not know what a B-frame is, use the default.
mpeg2Settings_gopNumBFrames :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Prelude.Natural)
mpeg2Settings_gopNumBFrames :: (Maybe Natural -> f (Maybe Natural))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_gopNumBFrames = (Mpeg2Settings -> Maybe Natural)
-> (Mpeg2Settings -> Maybe Natural -> Mpeg2Settings)
-> Lens Mpeg2Settings Mpeg2Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Natural
gopNumBFrames :: Maybe Natural
$sel:gopNumBFrames:Mpeg2Settings' :: Mpeg2Settings -> Maybe Natural
gopNumBFrames} -> Maybe Natural
gopNumBFrames) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Natural
a -> Mpeg2Settings
s {$sel:gopNumBFrames:Mpeg2Settings' :: Maybe Natural
gopNumBFrames = Maybe Natural
a} :: Mpeg2Settings)

-- | Complete this field only when afdSignaling is set to FIXED. Enter the
-- AFD value (4 bits) to write on all frames of the video encode.
mpeg2Settings_fixedAfd :: Lens.Lens' Mpeg2Settings (Prelude.Maybe FixedAfd)
mpeg2Settings_fixedAfd :: (Maybe FixedAfd -> f (Maybe FixedAfd))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_fixedAfd = (Mpeg2Settings -> Maybe FixedAfd)
-> (Mpeg2Settings -> Maybe FixedAfd -> Mpeg2Settings)
-> Lens
     Mpeg2Settings Mpeg2Settings (Maybe FixedAfd) (Maybe FixedAfd)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe FixedAfd
fixedAfd :: Maybe FixedAfd
$sel:fixedAfd:Mpeg2Settings' :: Mpeg2Settings -> Maybe FixedAfd
fixedAfd} -> Maybe FixedAfd
fixedAfd) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe FixedAfd
a -> Mpeg2Settings
s {$sel:fixedAfd:Mpeg2Settings' :: Maybe FixedAfd
fixedAfd = Maybe FixedAfd
a} :: Mpeg2Settings)

-- | Optionally specify a noise reduction filter, which can improve quality
-- of compressed content. If you do not choose a filter, no filter will be
-- applied. TEMPORAL: This filter is useful for both source content that is
-- noisy (when it has excessive digital artifacts) and source content that
-- is clean. When the content is noisy, the filter cleans up the source
-- content before the encoding phase, with these two effects: First, it
-- improves the output video quality because the content has been cleaned
-- up. Secondly, it decreases the bandwidth because MediaLive does not
-- waste bits on encoding noise. When the content is reasonably clean, the
-- filter tends to decrease the bitrate.
mpeg2Settings_filterSettings :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2FilterSettings)
mpeg2Settings_filterSettings :: (Maybe Mpeg2FilterSettings -> f (Maybe Mpeg2FilterSettings))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_filterSettings = (Mpeg2Settings -> Maybe Mpeg2FilterSettings)
-> (Mpeg2Settings -> Maybe Mpeg2FilterSettings -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2FilterSettings)
     (Maybe Mpeg2FilterSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2FilterSettings
filterSettings :: Maybe Mpeg2FilterSettings
$sel:filterSettings:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2FilterSettings
filterSettings} -> Maybe Mpeg2FilterSettings
filterSettings) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2FilterSettings
a -> Mpeg2Settings
s {$sel:filterSettings:Mpeg2Settings' :: Maybe Mpeg2FilterSettings
filterSettings = Maybe Mpeg2FilterSettings
a} :: Mpeg2Settings)

-- | Specifies whether to include the color space metadata. The metadata
-- describes the color space that applies to the video (the colorSpace
-- field). We recommend that you insert the metadata.
mpeg2Settings_colorMetadata :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2ColorMetadata)
mpeg2Settings_colorMetadata :: (Maybe Mpeg2ColorMetadata -> f (Maybe Mpeg2ColorMetadata))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_colorMetadata = (Mpeg2Settings -> Maybe Mpeg2ColorMetadata)
-> (Mpeg2Settings -> Maybe Mpeg2ColorMetadata -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2ColorMetadata)
     (Maybe Mpeg2ColorMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2ColorMetadata
colorMetadata :: Maybe Mpeg2ColorMetadata
$sel:colorMetadata:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ColorMetadata
colorMetadata} -> Maybe Mpeg2ColorMetadata
colorMetadata) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2ColorMetadata
a -> Mpeg2Settings
s {$sel:colorMetadata:Mpeg2Settings' :: Maybe Mpeg2ColorMetadata
colorMetadata = Maybe Mpeg2ColorMetadata
a} :: Mpeg2Settings)

-- | Choose Off to disable adaptive quantization. Or choose another value to
-- enable the quantizer and set its strength. The strengths are: Auto, Off,
-- Low, Medium, High. When you enable this field, MediaLive allows
-- intra-frame quantizers to vary, which might improve visual quality.
mpeg2Settings_adaptiveQuantization :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2AdaptiveQuantization)
mpeg2Settings_adaptiveQuantization :: (Maybe Mpeg2AdaptiveQuantization
 -> f (Maybe Mpeg2AdaptiveQuantization))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_adaptiveQuantization = (Mpeg2Settings -> Maybe Mpeg2AdaptiveQuantization)
-> (Mpeg2Settings
    -> Maybe Mpeg2AdaptiveQuantization -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2AdaptiveQuantization)
     (Maybe Mpeg2AdaptiveQuantization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization :: Maybe Mpeg2AdaptiveQuantization
$sel:adaptiveQuantization:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization} -> Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2AdaptiveQuantization
a -> Mpeg2Settings
s {$sel:adaptiveQuantization:Mpeg2Settings' :: Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization = Maybe Mpeg2AdaptiveQuantization
a} :: Mpeg2Settings)

-- | MPEG2: default is open GOP.
mpeg2Settings_gopClosedCadence :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Prelude.Natural)
mpeg2Settings_gopClosedCadence :: (Maybe Natural -> f (Maybe Natural))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_gopClosedCadence = (Mpeg2Settings -> Maybe Natural)
-> (Mpeg2Settings -> Maybe Natural -> Mpeg2Settings)
-> Lens Mpeg2Settings Mpeg2Settings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Natural
gopClosedCadence :: Maybe Natural
$sel:gopClosedCadence:Mpeg2Settings' :: Mpeg2Settings -> Maybe Natural
gopClosedCadence} -> Maybe Natural
gopClosedCadence) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Natural
a -> Mpeg2Settings
s {$sel:gopClosedCadence:Mpeg2Settings' :: Maybe Natural
gopClosedCadence = Maybe Natural
a} :: Mpeg2Settings)

-- | Choose the type of color space conversion to apply to the output. For
-- detailed information on setting up both the input and the output to
-- obtain the desired color space in the output, see the section on
-- \\\"MediaLive Features - Video - color space\\\" in the MediaLive User
-- Guide. PASSTHROUGH: Keep the color space of the input content - do not
-- convert it. AUTO:Convert all content that is SD to rec 601, and convert
-- all content that is HD to rec 709.
mpeg2Settings_colorSpace :: Lens.Lens' Mpeg2Settings (Prelude.Maybe Mpeg2ColorSpace)
mpeg2Settings_colorSpace :: (Maybe Mpeg2ColorSpace -> f (Maybe Mpeg2ColorSpace))
-> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_colorSpace = (Mpeg2Settings -> Maybe Mpeg2ColorSpace)
-> (Mpeg2Settings -> Maybe Mpeg2ColorSpace -> Mpeg2Settings)
-> Lens
     Mpeg2Settings
     Mpeg2Settings
     (Maybe Mpeg2ColorSpace)
     (Maybe Mpeg2ColorSpace)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Maybe Mpeg2ColorSpace
colorSpace :: Maybe Mpeg2ColorSpace
$sel:colorSpace:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ColorSpace
colorSpace} -> Maybe Mpeg2ColorSpace
colorSpace) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Maybe Mpeg2ColorSpace
a -> Mpeg2Settings
s {$sel:colorSpace:Mpeg2Settings' :: Maybe Mpeg2ColorSpace
colorSpace = Maybe Mpeg2ColorSpace
a} :: Mpeg2Settings)

-- | The framerate numerator. For example, 24000. The framerate is the
-- numerator divided by the denominator. For example, 24000 \/ 1001 =
-- 23.976 FPS.
mpeg2Settings_framerateNumerator :: Lens.Lens' Mpeg2Settings Prelude.Natural
mpeg2Settings_framerateNumerator :: (Natural -> f Natural) -> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_framerateNumerator = (Mpeg2Settings -> Natural)
-> (Mpeg2Settings -> Natural -> Mpeg2Settings)
-> Lens Mpeg2Settings Mpeg2Settings Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Natural
framerateNumerator :: Natural
$sel:framerateNumerator:Mpeg2Settings' :: Mpeg2Settings -> Natural
framerateNumerator} -> Natural
framerateNumerator) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Natural
a -> Mpeg2Settings
s {$sel:framerateNumerator:Mpeg2Settings' :: Natural
framerateNumerator = Natural
a} :: Mpeg2Settings)

-- | description\": \"The framerate denominator. For example, 1001. The
-- framerate is the numerator divided by the denominator. For example,
-- 24000 \/ 1001 = 23.976 FPS.
mpeg2Settings_framerateDenominator :: Lens.Lens' Mpeg2Settings Prelude.Natural
mpeg2Settings_framerateDenominator :: (Natural -> f Natural) -> Mpeg2Settings -> f Mpeg2Settings
mpeg2Settings_framerateDenominator = (Mpeg2Settings -> Natural)
-> (Mpeg2Settings -> Natural -> Mpeg2Settings)
-> Lens Mpeg2Settings Mpeg2Settings Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Mpeg2Settings' {Natural
framerateDenominator :: Natural
$sel:framerateDenominator:Mpeg2Settings' :: Mpeg2Settings -> Natural
framerateDenominator} -> Natural
framerateDenominator) (\s :: Mpeg2Settings
s@Mpeg2Settings' {} Natural
a -> Mpeg2Settings
s {$sel:framerateDenominator:Mpeg2Settings' :: Natural
framerateDenominator = Natural
a} :: Mpeg2Settings)

instance Core.FromJSON Mpeg2Settings where
  parseJSON :: Value -> Parser Mpeg2Settings
parseJSON =
    String
-> (Object -> Parser Mpeg2Settings)
-> Value
-> Parser Mpeg2Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Mpeg2Settings"
      ( \Object
x ->
          Maybe Mpeg2ScanType
-> Maybe Mpeg2TimecodeInsertionBehavior
-> Maybe AfdSignaling
-> Maybe Double
-> Maybe Mpeg2GopSizeUnits
-> Maybe Mpeg2SubGopLength
-> Maybe Mpeg2DisplayRatio
-> Maybe Natural
-> Maybe FixedAfd
-> Maybe Mpeg2FilterSettings
-> Maybe Mpeg2ColorMetadata
-> Maybe Mpeg2AdaptiveQuantization
-> Maybe Natural
-> Maybe Mpeg2ColorSpace
-> Natural
-> Natural
-> Mpeg2Settings
Mpeg2Settings'
            (Maybe Mpeg2ScanType
 -> Maybe Mpeg2TimecodeInsertionBehavior
 -> Maybe AfdSignaling
 -> Maybe Double
 -> Maybe Mpeg2GopSizeUnits
 -> Maybe Mpeg2SubGopLength
 -> Maybe Mpeg2DisplayRatio
 -> Maybe Natural
 -> Maybe FixedAfd
 -> Maybe Mpeg2FilterSettings
 -> Maybe Mpeg2ColorMetadata
 -> Maybe Mpeg2AdaptiveQuantization
 -> Maybe Natural
 -> Maybe Mpeg2ColorSpace
 -> Natural
 -> Natural
 -> Mpeg2Settings)
-> Parser (Maybe Mpeg2ScanType)
-> Parser
     (Maybe Mpeg2TimecodeInsertionBehavior
      -> Maybe AfdSignaling
      -> Maybe Double
      -> Maybe Mpeg2GopSizeUnits
      -> Maybe Mpeg2SubGopLength
      -> Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Mpeg2ScanType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scanType")
            Parser
  (Maybe Mpeg2TimecodeInsertionBehavior
   -> Maybe AfdSignaling
   -> Maybe Double
   -> Maybe Mpeg2GopSizeUnits
   -> Maybe Mpeg2SubGopLength
   -> Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2TimecodeInsertionBehavior)
-> Parser
     (Maybe AfdSignaling
      -> Maybe Double
      -> Maybe Mpeg2GopSizeUnits
      -> Maybe Mpeg2SubGopLength
      -> Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2TimecodeInsertionBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timecodeInsertion")
            Parser
  (Maybe AfdSignaling
   -> Maybe Double
   -> Maybe Mpeg2GopSizeUnits
   -> Maybe Mpeg2SubGopLength
   -> Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe AfdSignaling)
-> Parser
     (Maybe Double
      -> Maybe Mpeg2GopSizeUnits
      -> Maybe Mpeg2SubGopLength
      -> Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AfdSignaling)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"afdSignaling")
            Parser
  (Maybe Double
   -> Maybe Mpeg2GopSizeUnits
   -> Maybe Mpeg2SubGopLength
   -> Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Double)
-> Parser
     (Maybe Mpeg2GopSizeUnits
      -> Maybe Mpeg2SubGopLength
      -> Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gopSize")
            Parser
  (Maybe Mpeg2GopSizeUnits
   -> Maybe Mpeg2SubGopLength
   -> Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2GopSizeUnits)
-> Parser
     (Maybe Mpeg2SubGopLength
      -> Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2GopSizeUnits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gopSizeUnits")
            Parser
  (Maybe Mpeg2SubGopLength
   -> Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2SubGopLength)
-> Parser
     (Maybe Mpeg2DisplayRatio
      -> Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2SubGopLength)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"subgopLength")
            Parser
  (Maybe Mpeg2DisplayRatio
   -> Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2DisplayRatio)
-> Parser
     (Maybe Natural
      -> Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2DisplayRatio)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"displayAspectRatio")
            Parser
  (Maybe Natural
   -> Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe FixedAfd
      -> Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gopNumBFrames")
            Parser
  (Maybe FixedAfd
   -> Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe FixedAfd)
-> Parser
     (Maybe Mpeg2FilterSettings
      -> Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FixedAfd)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fixedAfd")
            Parser
  (Maybe Mpeg2FilterSettings
   -> Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2FilterSettings)
-> Parser
     (Maybe Mpeg2ColorMetadata
      -> Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2FilterSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"filterSettings")
            Parser
  (Maybe Mpeg2ColorMetadata
   -> Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2ColorMetadata)
-> Parser
     (Maybe Mpeg2AdaptiveQuantization
      -> Maybe Natural
      -> Maybe Mpeg2ColorSpace
      -> Natural
      -> Natural
      -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2ColorMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"colorMetadata")
            Parser
  (Maybe Mpeg2AdaptiveQuantization
   -> Maybe Natural
   -> Maybe Mpeg2ColorSpace
   -> Natural
   -> Natural
   -> Mpeg2Settings)
-> Parser (Maybe Mpeg2AdaptiveQuantization)
-> Parser
     (Maybe Natural
      -> Maybe Mpeg2ColorSpace -> Natural -> Natural -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2AdaptiveQuantization)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"adaptiveQuantization")
            Parser
  (Maybe Natural
   -> Maybe Mpeg2ColorSpace -> Natural -> Natural -> Mpeg2Settings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Mpeg2ColorSpace -> Natural -> Natural -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gopClosedCadence")
            Parser
  (Maybe Mpeg2ColorSpace -> Natural -> Natural -> Mpeg2Settings)
-> Parser (Maybe Mpeg2ColorSpace)
-> Parser (Natural -> Natural -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mpeg2ColorSpace)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"colorSpace")
            Parser (Natural -> Natural -> Mpeg2Settings)
-> Parser Natural -> Parser (Natural -> Mpeg2Settings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"framerateNumerator")
            Parser (Natural -> Mpeg2Settings)
-> Parser Natural -> Parser Mpeg2Settings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"framerateDenominator")
      )

instance Prelude.Hashable Mpeg2Settings

instance Prelude.NFData Mpeg2Settings

instance Core.ToJSON Mpeg2Settings where
  toJSON :: Mpeg2Settings -> Value
toJSON Mpeg2Settings' {Natural
Maybe Double
Maybe Natural
Maybe AfdSignaling
Maybe FixedAfd
Maybe Mpeg2AdaptiveQuantization
Maybe Mpeg2ColorMetadata
Maybe Mpeg2ColorSpace
Maybe Mpeg2DisplayRatio
Maybe Mpeg2GopSizeUnits
Maybe Mpeg2ScanType
Maybe Mpeg2SubGopLength
Maybe Mpeg2TimecodeInsertionBehavior
Maybe Mpeg2FilterSettings
framerateDenominator :: Natural
framerateNumerator :: Natural
colorSpace :: Maybe Mpeg2ColorSpace
gopClosedCadence :: Maybe Natural
adaptiveQuantization :: Maybe Mpeg2AdaptiveQuantization
colorMetadata :: Maybe Mpeg2ColorMetadata
filterSettings :: Maybe Mpeg2FilterSettings
fixedAfd :: Maybe FixedAfd
gopNumBFrames :: Maybe Natural
displayAspectRatio :: Maybe Mpeg2DisplayRatio
subgopLength :: Maybe Mpeg2SubGopLength
gopSizeUnits :: Maybe Mpeg2GopSizeUnits
gopSize :: Maybe Double
afdSignaling :: Maybe AfdSignaling
timecodeInsertion :: Maybe Mpeg2TimecodeInsertionBehavior
scanType :: Maybe Mpeg2ScanType
$sel:framerateDenominator:Mpeg2Settings' :: Mpeg2Settings -> Natural
$sel:framerateNumerator:Mpeg2Settings' :: Mpeg2Settings -> Natural
$sel:colorSpace:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ColorSpace
$sel:gopClosedCadence:Mpeg2Settings' :: Mpeg2Settings -> Maybe Natural
$sel:adaptiveQuantization:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2AdaptiveQuantization
$sel:colorMetadata:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ColorMetadata
$sel:filterSettings:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2FilterSettings
$sel:fixedAfd:Mpeg2Settings' :: Mpeg2Settings -> Maybe FixedAfd
$sel:gopNumBFrames:Mpeg2Settings' :: Mpeg2Settings -> Maybe Natural
$sel:displayAspectRatio:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2DisplayRatio
$sel:subgopLength:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2SubGopLength
$sel:gopSizeUnits:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2GopSizeUnits
$sel:gopSize:Mpeg2Settings' :: Mpeg2Settings -> Maybe Double
$sel:afdSignaling:Mpeg2Settings' :: Mpeg2Settings -> Maybe AfdSignaling
$sel:timecodeInsertion:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2TimecodeInsertionBehavior
$sel:scanType:Mpeg2Settings' :: Mpeg2Settings -> Maybe Mpeg2ScanType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"scanType" Text -> Mpeg2ScanType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mpeg2ScanType -> Pair) -> Maybe Mpeg2ScanType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2ScanType
scanType,
            (Text
"timecodeInsertion" Text -> Mpeg2TimecodeInsertionBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Mpeg2TimecodeInsertionBehavior -> Pair)
-> Maybe Mpeg2TimecodeInsertionBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2TimecodeInsertionBehavior
timecodeInsertion,
            (Text
"afdSignaling" Text -> AfdSignaling -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AfdSignaling -> Pair) -> Maybe AfdSignaling -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AfdSignaling
afdSignaling,
            (Text
"gopSize" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
gopSize,
            (Text
"gopSizeUnits" Text -> Mpeg2GopSizeUnits -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mpeg2GopSizeUnits -> Pair)
-> Maybe Mpeg2GopSizeUnits -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2GopSizeUnits
gopSizeUnits,
            (Text
"subgopLength" Text -> Mpeg2SubGopLength -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mpeg2SubGopLength -> Pair)
-> Maybe Mpeg2SubGopLength -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2SubGopLength
subgopLength,
            (Text
"displayAspectRatio" Text -> Mpeg2DisplayRatio -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Mpeg2DisplayRatio -> Pair)
-> Maybe Mpeg2DisplayRatio -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2DisplayRatio
displayAspectRatio,
            (Text
"gopNumBFrames" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
gopNumBFrames,
            (Text
"fixedAfd" Text -> FixedAfd -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FixedAfd -> Pair) -> Maybe FixedAfd -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FixedAfd
fixedAfd,
            (Text
"filterSettings" Text -> Mpeg2FilterSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Mpeg2FilterSettings -> Pair)
-> Maybe Mpeg2FilterSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2FilterSettings
filterSettings,
            (Text
"colorMetadata" Text -> Mpeg2ColorMetadata -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mpeg2ColorMetadata -> Pair)
-> Maybe Mpeg2ColorMetadata -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2ColorMetadata
colorMetadata,
            (Text
"adaptiveQuantization" Text -> Mpeg2AdaptiveQuantization -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Mpeg2AdaptiveQuantization -> Pair)
-> Maybe Mpeg2AdaptiveQuantization -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2AdaptiveQuantization
adaptiveQuantization,
            (Text
"gopClosedCadence" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
gopClosedCadence,
            (Text
"colorSpace" Text -> Mpeg2ColorSpace -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mpeg2ColorSpace -> Pair) -> Maybe Mpeg2ColorSpace -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mpeg2ColorSpace
colorSpace,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"framerateNumerator" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
framerateNumerator),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"framerateDenominator"
                  Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
framerateDenominator
              )
          ]
      )