Transloadit: How can I replace audio track of a given video?

148 Views Asked by At

I am having trouble forming the steps that would replace/set the audio track of an mp4. Here is my code:

 require "open-uri"
 transloadit = Transloadit.new(:key => ENV['TRANSLOADIT_AUTH_KEY'],:secret => ENV['TRANSLOADIT_AUTH_SECRET'])
 video_encode = transloadit.step('video_encode', '/video/encode', use: ":original",ffmpeg_stack: "v2.0.0", ffmpeg: { i: "http://www.stephaniequinn.com/Music/Allegro%20from%20Duet%20in%20C%...;", map:"1:0", vcodec:"copy", acodec:"copy"}) 
 store = transloadit.step('store', '/s3/store', :key => ENV['S3_ACCESS_KEY'], :secret => ENV['S3_SECRET_ACCESS_KEY'], :bucket => ENV['S3_BUCKET'])
 assembly = transloadit.assembly(:steps => [ video_encode, store ] )
 response = assembly.submit! open('http://techslides.com/demos/sample-videos/small.mp4')

I am getting this message:

 'Unable to find a suitable output format'

Could someone tell me how parametrize ffmpeg and transloadit to set the audio track of a given mp4? I tried many variations without any luck.

1

There are 1 best solutions below

0
On

(Talking as a Transloadit cofounder) we're currently adding this feature to the /video/merge robot that you can use to replace the audio on a given input video. Should be shipping around October 2014, but we'll post it on our blog & twitter when ready.