Create separate audio file using a video
As more people consume their media from more devices, it becomes important to have your content available across multiple mediums to make it easy for your users to consume. Often times, your audio can be an important part of your video which can be streamed separately from the video.
Using Qencode, you can easily create separate files using the audio tracks in your videos.
To create an audio output from a video, first create a task with the /v1/create_task method containing a format object with an output that is set to the audio ouput format you want. For example, if you want to create an MP3 file, set output to mp3.
Example:
{
"output": "mp3",
"audio_bitrate": 192
}
You can also create HLS outputs with a single audio stream, set the value of the output attribute to hls_audio. You also can use audio-only input as a source.
Example:
{
"output": "hls_audio",
"audio_codec": "libfdk_aac",
"audio_bitrate": 128
}
If you want to preserve the highest quality audio from a video file, you can use the flac format with bitrates up to 320 Kbps. FLAC is an audio codec known for its lossless compression that keeps the audio quality the same as the original.
You can also use just the audio input to create FLAC output, as with other formats.
Please note that changing the audio codec is not supported in this case.
Example:
{
"output": "flac",
"audio_bitrate": 320
}
You can fine tune audio settings using the following attributes as part of the format object. You can find a list of attributes below:
audio_codec | optional |
audio_bitrate | optional |
audio_sample_rate | optional |
audio_channels_number | optional |
Similar to video, you can customize any of the audio attributes like audio_bitrate, audio_sample_rate, and audio_channels_number.
Example
{
"output": "mp3",
"destination": {
"url":"s3://us-west.s3.qencode.com/yourbucket/output.mp3",
"key":"abcde12345",
"secret":"abcde12345",
"permissions": "public-read"
},
"audio_bitrate": 128,
"audio_sample_rate" : "44100",
"audio_channels_number" : "2"
}
Creating audio clips with start_time and duration attributes is also supported.