tola
(tola)
October 4, 2013, 5:58am
1
Archived from the Transloadit support forum. Originally posted on October 4, 2013; details may be outdated, see our docs for current behavior. Original thread
How do I write the file/filter robot in php? I’m getting stuck at the square brackets…clearly a jv squad syntax issue!
'files'=>array(
robot=> "/file/filter",
declines=> array(
["${file.size}", ">", "20971520"],
["${file.meta.duration}", ">", "300"]
),
'error_on_decline'=> true
),
tola
(tola)
October 4, 2013, 6:15am
2
Tried this to no effect:
'files'=>array(
'robot'=> "/file/filter",
'declines'=> array(
array("${file.size}", ">", " 71520"),array("${file.meta.duration}", ">", "10")),
'error_on_decline'=> true
),
tim-kos
(Tim Koschützki)
October 7, 2013, 1:07pm
3
Hey tola,
have you tried escaping the dollar signs so that they do not get interpreted as variables:
‘files’=>array( ‘robot’=> “/file/filter”, ‘declines’=> array( array(“\${file.size}”, “>”, " 71520"),array(“\${file.meta.duration}”, “>”, “10”)), ‘error_on_decline’=> true ),
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos
tim-kos
(Tim Koschützki)
December 10, 2013, 6:28am
4
I am going to close this ticket for now. Please feel free to reopen it again if you have further questions.
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos
tola
(tola)
December 10, 2013, 7:20am
5
Oh hey man, thanks.
Great product btw.
One off-the-current-subject question - are there such things as filters for videos? Have an idea to try and apply a lime green filter to uploaded videos.
tim-kos
(Tim Koschützki)
December 10, 2013, 7:55am
6
Hey Tola,
you can try it as you can pass ffmpeg parameters directly to the /video/encode robot: https://transloadit.com/docs/conversion-robots#video-encode
I need to double check which filters we have installed, though. Mind trying the lime green filter and then coming back to me?
Kind regards,
Tim
Co-Founder Transloadit
@tim_kos
tola
(tola)
December 10, 2013, 8:52am
7
Fantastic. Will try it this week and get back to you.
Thanks a ton.
tim-kos
(Tim Koschützki)
December 10, 2013, 8:55am
8
Alright, sounds good. Closing this ticket until then!