Encode Audio and copy to S3 not working if no encoding needs to be done..

Matt Bryson's Avatar

Matt Bryson

19 May, 2014 04:59 PM

If we encode the audio and then copy to S3 it works fine.

But if we ingest a file that doesn't need encoding (is already the right type, bitrate, sample rate etc) it doesn't copy to S3.
If we remove the encode step, the same file is copied to s3.

Its as though our encode step doesn't actually return if the file doesn't need encoding ?? How do we get round this?

{
  "steps": {
    "encode": {
      "robot": "/audio/encode",
      "bitrate": 96,
      "sample_rate": 16000
    },
    "export": {
      "robot": "/s3/store",
      "key": "******",
      "secret": "*******",
      "bucket": "bucket.name"
    }
  }
}
  1. Support Staff 1 Posted by Kevin van Zonne... on 19 May, 2014 05:56 PM

    Kevin van Zonneveld's Avatar

    Hi Matt,

    I think what you are looking for is the use parameter so you can also store the original file. e.g.:

    {
      "steps": {
        "encode": {
          "robot": "/audio/encode",
          "bitrate": 96,
          "sample_rate": 16000
        },
        "export": {
          "use": [ "encode", ":original" ],
          "robot": "/s3/store",
          "key": "******",
          "secret": "*******",
          "bucket": "bucket.name"
        }
      }
    }
    

    Please let me know if that helps!

    Kind regards,
    Kevin

  2. 2 Posted by Matt Bryson on 19 May, 2014 06:15 PM

    Matt Bryson's Avatar

    so that would store the encoded file if work was done, and the original if not?

    Rather than copying two files, or one overwriting the other?

  3. 3 Posted by Matt Bryson on 20 May, 2014 10:03 AM

    Matt Bryson's Avatar

    I tried adding the two 'use' items, but it uploads 2 files when work DOES need to be done, and 1 when it does not.

    How can we configure it so it only ever uploads one file , regardless if encoding needs to be done or not?

  4. Support Staff 4 Posted by Tim Koschützki on 23 May, 2014 07:34 AM

    Tim Koschützki's Avatar

    Hey Matt,

    for that you would need the /file/filter robot, which is documented here: https://transloadit.com/docs/conversion-robots#file-filter You can also find some examples of it at the end of the documentation section there.

    Aside from this, we recommend that you always store the original files. In the future if your application demands different encoded versions you will be happy if you still have them and can re-encode them into additional formats. You can still keep your logic to either store the original or the encoded file in that specific file path. However, in any case you should store the original also in some other folder every time.

    Please let me know if you need help setting up the /file/filter robot.

    Kind regards,
    Tim

    Co-Founder Transloadit
    @tim_kos

  5. Support Staff 5 Posted by Tim Koschützki on 20 Jun, 2014 06:53 AM

    Tim Koschützki's Avatar

    Closing this for now. If you need more help, please feel free to re-open this issue.

    Kind regards,
    Tim

    Co-Founder Transloadit
    @tim_kos

  6. Tim Koschützki closed this discussion on 20 Jun, 2014 06:53 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

20 Nov, 2016 02:52 AM
29 Oct, 2015 05:01 AM
27 Oct, 2015 05:01 AM
27 Oct, 2015 05:01 AM
26 Oct, 2015 05:03 AM

 

26 Oct, 2015 05:02 AM
26 Oct, 2015 05:02 AM
26 Oct, 2015 05:02 AM
26 Oct, 2015 05:02 AM
26 Oct, 2015 05:02 AM
26 Oct, 2015 05:01 AM