aws-solutions / video-on-demand-on-aws

An automated reference implementation leveraging AWS Step Functions and AWS Media Services to deploy a scalable fault tolerant Video on demand workflow
https://aws.amazon.com/solutions/video-on-demand-on-aws/
Apache License 2.0
504 stars 241 forks source link

Error when encoding video with no audio #45

Closed maduggan closed 4 years ago

maduggan commented 5 years ago

I'm getting the follow error when I attempt to encode video with no audio:

Invalid audio track specified for audio_selector [1]. Audio track [1] not found in input container.

Looking through some of the solutions I don't see an easy way to modify the output presets to allow for the successful processing of video with no audio. I found this solution on StackOverflow but I'm missing how I might make that change in the presets defined in the solution. Thanks for your time!

dscpinheiro commented 5 years ago

Hi @maduggan,

The workflow expects the video to have at least one audio track:

https://github.com/awslabs/video-on-demand-on-aws/blob/16bef0e010d0cd340546b65af0e0a0723c7b50e3/source/encode/index.js#L42-L52

You could change the presets created by the solution, but a better approach might be to create a custom preset (without audio) and custom job template in MediaConvert, and use them whenever you're uploading a video that does not have audio.

Would that be possible?

maduggan commented 4 years ago

@dscpinheiro It's certainly possible but ideally I would be able to handle both types of video without having to add a step where I check whether the source video has an audio track or not. If I modify the js there to remove track will it remove tracks from videos with audio or will it just handle both usecases? Thank you!

dscpinheiro commented 4 years ago

I followed the suggestion on the StackOverflow link you posted, and it looks like even after removing the Tracks property a video with audio is still processed successfully.

You're right that'd be ideal if the workflow identified if the video has audio or not. In a future update of the solution, we'll add this logic (at the time the solution was first designed, there was only need to support videos with audio).

maduggan commented 4 years ago

No worries, thanks for the quick response. Have a good one.

melvinmt commented 4 years ago

I'm having the same issue, I already have everything deployed but running into encoding issues with videos that have no audio. Where can I change this in the console?

EDIT: found it, it's in the encode lambda function