template problem

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

Hi!

I’m using this template (id = REDACTED) and If the file doesn’t have bitrate its going to decline.
I have the same logic on this template (id = REDACTED) and its works fine but on the first template the assembly through an internal code error because the file bitrare is null. Its seems like the decline filter it doesn’t work.

This is dthe assembly = REDACTED.

Thanks!

Cheers!

Hey Lucas,

preserving the video bitrate this way is not a good idea as sometimes the video bitrate cannot be parsed and also the values aren’t compatible with what ffmpeg expects. Just set it to a relatively high value (like “512k”) and you should be fine.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

Thanks for the answer but If I set a value on the ffmpeg like 512k videos with 64k are going to weigh 8 times more than before.

The questions before is about what happend with my template. It has to decline because the filter. But in this case the filter control passed well when it has to decline.

Any other suggestion?

Thanks again.
Cheers!

Hi Lucas,

If you pass the sameq argument to ffmpeg, ffmpeg itself preserves the bitrates; vs some metatool trying to parse it and then feeding it to it again.

Hope this helps,
Kevin

Right now, if we use this template ((id = REDACTED) with a video without bitrate, the decline filter does not work and the video passes as a good one. But since the bitrate is not set (or set to null), it eventually fails with a ffmpeg internal error.

We need the decline filter to catch that fail, so we use a different template (id= REDACTED) with a default value.

That implementation (the decline filter detection) is already working in another template (id = REDACTED) which uses videos served from urls, and also with audio presets.

So the question is: should we change something in the template to make the system decline those videos, or the template is fine and this change is required in the robot?

Hey Lucas,

why do you want to decline videos for which we cannot identify the bitrate?

Hi Tim!

If the file doesn’t have bitrate this part of the template return an internal comand error (exit code -1). Becaue the b params is NULL.

“ffmpeg”: {
“b”: “${file.meta.video_bitrate}”
}

I want to decline this files in order to use another template without ffmpeg params.

Cheers!

Hey Lucas, I don’t understand yet why you wouldn’t want to use the sameq option like I mentioned?

Hi Kevin!

sameq doesn’t stand for “same quality”, it stands for “same quant”.
That ffmpeg param is only useful for maintaining encoding matrices.
It works only if your output video has the same codec as your input one.
And as far as i know, it is deprecated on newer versions of ffmpeg.
Nevertheless it won’t work for what we need.
That’s why we need to address the original problem: understand why the decline filter is not working on the case described above.

Hi again!

I need to highlight the problem that I have.

If we have a videoDemo.mp4 without bitrate and I used the template T1 (imports a url) (id = REDACTED) the decline filter works fine!

But if we use the same video videoDemo.mp4 and I used the template T2 this attached the file manually (id =REDACTED ) the decline filter doesn’t work. Its give me a internal command error exit code 1 because b value is null.

I want the template T2 work like T1.
Cheers!

Hey Lucas,

can you please provide an assembly id for each template so that we can take a look at a real assembly?
If what you say is really true, then this is a bug that we need to fix.

Sorry for all the inconvenience.

Kind regards,
Tim

Co-Founder Transloadit
@tim_kos

Hi Tim!

This is the assembly that crash = REDACTED. Template id = REDACTED

This is the assembly thats decline filter work fine = REDACTED . template id = REDACTED

First of all sorry, I noticed that the second template doesn’t have the

"ffmpeg": {
"b": "${file.meta.video_bitrate}"
}

Thats why it was running ok.

There are any posibility to check the robot filter in order not to crash because the b value es null?

We tried sameq and the preset bitrate values but it isn’t what we need. The implementation of this can be possible?

Thanks you very much and sorry for the confusion.

Closing this as we moved the discussion to Skype.