Audio and video encoding in the same assembly

Archived from the Transloadit support forum. Originally posted on July 31, 2011; details may be outdated, see our docs for current behavior. Original thread

Hey Guys,

I have a template with audio and video encoding steps (id: REDACTED if you wanna look into it) which now fails to execute as soon as I try to upload video files since apparently transloadit tries to pass them into the audio-robot, see https://transloadit.com/assemblies/view/REDACTED for details.

Can you provide me with any workaround?

Cheers,
Christoph

The audio robot accepts audio and videos because both contain audio. You can probably make the audio encoding for videos work by providing a “vn: true” option to ffmpeg.

Well, it’s just that I want to leave the audiotrack of my videos untouched while reencoding all pure-audio-files. -vn would strip the video track, which is not what I want to acchieve.

Is there any way to make the audio-robot accept only pure audio files?

Bumb Hey Felix, do you have any idea for a workaround?

Thanks!

We currently can’t make the audio robot only accept audio files, a bunch of customers depend on the fact that video files are also accepted.

So your only option is to also encode an audio version of all uploaded videos by using the vn: true option in the audio robots. The video steps themselves will still do the regular video encoding for videos.

Does that make sense?

--fg

OK, I think we can live with that, we may just ignore the encoded audio-streams of the videos in the resultset.

Howerver there still remains a problem, if an uploaded video file does not contain an audiostream. ffmpeg then fails with an error like
Output file #0 does not contain any stream

See https://transloadit.com/assemblies/view/REDACTED for details. Any suggestion on that?

Howerver there still remains a problem, if an uploaded video file does not contain an audiostream. ffmpeg then fails with an error like

That’s a bug and we need to fix it. Do you have to deal with many videos like that?

Having a “type” or “accept” parameter that would allow you to limit the audio bot to only accept audio would be really useful. Otherwise you can’t make a template that handles any file type correctly.

Having a “type” or “accept” parameter that would allow you to limit the audio bot to only accept audio would be really useful. Otherwise you can’t make a template that handles any file type correctly.

Yes, that’s an issue. We will resolve that.

I don’t think we need to do anything here now that we have the /file/filter robot.

Can you plz confirm Christoph?

Yeah, I think we can avoid the error that results when video-files without audio-track are passed to the video-robot by prepending a filter.

However I suppose the problem, that we cannot encode videos that do not have an audio track still persists.

However I think it’s an edgecase and we should close this issue until someone really needs to encode videos without audio-track!

Agreed.

Closing for now.