GithubHelp home page GithubHelp logo

Just audio support? about amplify-video HOT 4 CLOSED

awslabs avatar awslabs commented on May 23, 2024
Just audio support?

from amplify-video.

Comments (4)

axptwig avatar axptwig commented on May 23, 2024 1

Currently WebRTC is not a supported protocol. For that you need to use something like Kinesis video with WebRTC.

https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/what-is-kvswebrtc.html

from amplify-video.

axptwig avatar axptwig commented on May 23, 2024

Hey @subhendukundu,

You can do this but you will need to make some changes to the existing code. You need to do 2 things.

  1. Create a new S3 event listening for .mp3 files which gets sent to the inputLambda function.
  2. Reference another Mediaconvert Job Template configured with a filegroup output. (you can do this by referencing the template when configuring the amplify resource).

Here are the steps you can take in order to achieve an audio pipeline.

  1. Navigate to the Mediaconvert service page and select job templates.
  2. You will need a to create a new job template. Reference the below doc link on how to create audio only outputs.
    1. https://docs.aws.amazon.com/mediaconvert/latest/ug/setting-up-audio-only.html
    2. If you need help making this I can show you an example of the JSON i have used before for mp3 to HLS transcoding.
  3. Initialize an amplify environment with amplify init.
  4. Next, amplify video add and select Video on Demand.
  5. For the question Select a system-provided encoding template, specify an already-created template name choose Bring your own template and specify the name of the audio MediaConvert template you created previously.
  6. Continue configuring the resource as you would normally.
  7. Once the prompt exits, check amplify status to see that your resource is configured to be created.
  8. Navigate to /amplify/backend/video/audio/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js and change the listner for 'mp4' to the file extension of your input container. Then save the file.
    1. You can view the list of supported containers here: https://docs.aws.amazon.com/mediaconvert/latest/ug/supported-codecs-containers-audio-only.html
  9. run amplify push and you should be all set.

from amplify-video.

axptwig avatar axptwig commented on May 23, 2024

Note you must supply a valid s3 bucket name before importing this template into mediaconvert.

{
  "Name": "audio_template",
  "Settings": {
    "OutputGroups": [
      {
        "Name": "Apple HLS",
        "Outputs": [
          {
            "ContainerSettings": {
              "Container": "M3U8",
              "M3u8Settings": {
                "AudioFramesPerPes": 4,
                "PcrControl": "PCR_EVERY_PES_PACKET",
                "PmtPid": 480,
                "PrivateMetadataPid": 503,
                "ProgramNumber": 1,
                "PatInterval": 0,
                "PmtInterval": 0,
                "Scte35Source": "NONE",
                "NielsenId3": "NONE",
                "TimedMetadata": "NONE",
                "VideoPid": 481,
                "AudioPids": [
                  482,
                  483,
                  484,
                  485,
                  486,
                  487,
                  488,
                  489,
                  490,
                  491,
                  492
                ]
              }
            },
            "AudioDescriptions": [
              {
                "AudioTypeControl": "FOLLOW_INPUT",
                "AudioSourceName": "Audio Selector 1",
                "CodecSettings": {
                  "Codec": "AAC",
                  "AacSettings": {
                    "AudioDescriptionBroadcasterMix": "NORMAL",
                    "Bitrate": 96000,
                    "RateControlMode": "CBR",
                    "CodecProfile": "LC",
                    "CodingMode": "CODING_MODE_2_0",
                    "RawFormat": "NONE",
                    "SampleRate": 48000,
                    "Specification": "MPEG4"
                  }
                },
                "LanguageCodeControl": "FOLLOW_INPUT"
              }
            ],
            "OutputSettings": {
              "HlsSettings": {
                "AudioGroupId": "program_audio",
                "AudioOnlyContainer": "AUTOMATIC",
                "IFrameOnlyManifest": "EXCLUDE"
              }
            },
            "NameModifier": "_audio"
          }
        ],
        "OutputGroupSettings": {
          "Type": "HLS_GROUP_SETTINGS",
          "HlsGroupSettings": {
            "ManifestDurationFormat": "INTEGER",
            "SegmentLength": 10,
            "TimedMetadataId3Period": 10,
            "CaptionLanguageSetting": "OMIT",
            "Destination": "s3://**YOUR-S3-BUCKET**/mp3/",
            "TimedMetadataId3Frame": "PRIV",
            "CodecSpecification": "RFC_4281",
            "OutputSelection": "MANIFESTS_AND_SEGMENTS",
            "ProgramDateTimePeriod": 600,
            "MinSegmentLength": 0,
            "MinFinalSegmentLength": 0,
            "DirectoryStructure": "SINGLE_DIRECTORY",
            "ProgramDateTime": "EXCLUDE",
            "SegmentControl": "SEGMENTED_FILES",
            "ManifestCompression": "NONE",
            "ClientCache": "ENABLED",
            "StreamInfResolution": "INCLUDE"
          }
        }
      }
    ],
    "AdAvailOffset": 0,
    "Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "Offset": 0,
            "DefaultSelection": "DEFAULT",
            "ProgramSelection": 1
          }
        },
        "FilterEnable": "AUTO",
        "PsiControl": "USE_PSI",
        "FilterStrength": 0,
        "DeblockFilter": "DISABLED",
        "DenoiseFilter": "DISABLED",
        "TimecodeSource": "EMBEDDED"
      }
    ]
  },
  "AccelerationSettings": {
    "Mode": "DISABLED"
  },
  "StatusUpdateInterval": "SECONDS_60",
  "Priority": 0,
  "HopDestinations": []
}

from amplify-video.

subhendukundu avatar subhendukundu commented on May 23, 2024

Thank you so much for the explanations, it does make sense. I will try this out.
One more quick question Would be possible to make Real-Time communication? What I mean is, like if someone else wants to join to the live show, would that be possible?
Something like, rtc network protocol?

from amplify-video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.