# Audio encoding

**URL:** <https://community.transloadit.com/t/audio-encoding/17843>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [January 18, 2011, 3:27pm UTC](https://community.transloadit.com/t/audio-encoding/17843 "2011-01-18T15:27:00Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 18, 2011, 3:27pm UTC](https://community.transloadit.com/t/audio-encoding/17843/1 "2011-01-18T15:27:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on January 18, 2011; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20151025114431/http://support.transloadit.com/discussions/problems/52-audio-encoding)

Hi Felix,  
Following on from this thread:  
[http://transloadit.com/docs/video-encode#comment-130207880](http://transloadit.com/docs/video-encode#comment-130207880)  
[https://community.transloadit.com/t/external\_id/tender-problems-24](https://community.transloadit.com/t/external%5Fid/tender-problems-24)

…I have signed up for an account and am going to develop against Transloadit as it’s cheaper to get started with than Pandastream.

In the previous support discussion you mentioned ‘metadata’ as a to do. I will definitely need to be able to set metadata fields on the encoded files… I’m hoping it will be possible already via ffmpeg commands in the Assembly ([http://multimedia.cx/eggs/supplying-ffmpeg-with-metadata/](http://multimedia.cx/eggs/supplying-ffmpeg-with-metadata/)) and that the metadata to do at your end is more related with [http://transloadit.com/docs/meta-data](http://transloadit.com/docs/meta-data) ?

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 19, 2011, 7:20pm UTC](https://community.transloadit.com/t/audio-encoding/17843/2 "2011-01-19T19:20:00Z")

</div>

I have had some difficulty getting ffmpeg to tag ID3 metadata in a way that is readable by Windows:  
[https://roundup.ffmpeg.org/issue2562](https://roundup.ffmpeg.org/issue2562)  
Since I want to provide well-tagged downloads from my app this is important for me.

I suspect the only answer may be to use a dedicated ID3 tagging utility. I believe this would have to operate on the file before it was stored to s3 - does that mean there would need to be a ‘metadata’ robot that could be a front-end onto such tools?

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 20, 2011, 10:03am UTC](https://community.transloadit.com/t/audio-encoding/17843/3 "2011-01-20T10:03:00Z")

</div>

> does that mean there would need to be a ‘metadata’ robot that could be a front-end onto such tools?

Yes. Our plan is to add meta data read and write support for audio files, but unfortunately we don’t support either so far.

I can’t give you a date for this yet, but a lot of people want audio improvements lately, so it’s rapidly moving up our todo list.

--fg

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 3:11pm UTC](https://community.transloadit.com/t/audio-encoding/17843/4 "2011-01-20T15:11:00Z")

</div>

In addition to mp3 I’d like to output a couple of other common formats (aac, flac and apple lossless, maybe ogg vorbis too)

I was just trying to get AAC to work but the problem I encountered is that (I think) Transloadit is not giving an output filename with an extension to ffmpeg. In which case ffmpeg seems to need a hint via the -f option.

‘-f mp3’ works for mp3s but I found testing on my local ffmpeg that neither ‘-f aac’ or ‘-f m4a’ work for AAC… they give the same error I get on Transloadit:

“Requested output format ‘m4a’/‘aac’ is not a suitable output format”

I’m just learning ffmpeg as I go so maybe there’s an easy way around this.

Hopefully you have libfaac enabled too:  
[http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2010-March/024662.html](http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2010-March/024662.html)  
🙂

---

<div class="post-metadata">

**Author:** ![kvz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/kvz/32/606_2.png) [@kvz](https://community.transloadit.com/u/kvz)\
**Post date:** [January 20, 2011, 4:03pm UTC](https://community.transloadit.com/t/audio-encoding/17843/5 "2011-01-20T16:03:00Z")

</div>

Hey,

I’m pretty sure we support libfaac  
Maybe you can try using the acodec flag like so?

```auto
 'acodec': 'aac',

```

if that doesn’t work, give me your full syntax and we’ll work something out

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 4:15pm UTC](https://community.transloadit.com/t/audio-encoding/17843/6 "2011-01-20T16:15:00Z")

</div>

Thanks for the reply.

I have tested locally using a command like:

```auto
 ffmpeg -i "D:\Audio Projects\short test.wav" -aq 100 -acodec aac -metadata title="Test Title" -metadata author="Test Artist" -metadata album="Test Album" ../out4

```

I get the same error as on Transloadit. When trying to encode to either mp3 or AAC if I don’t use the -f option I get an error like:

```auto
Unable to find a suitable output format for '/mnt/tmp/scratch/REDACTED'

```

With mp3 files I can get around that because ‘-f mp3’ works.

I have posted for support on the ffmpeg-users list. I don’t know if it’s the best way but maybe a simple solution would be if I could specify a file extension for the output path in my Assembly somehow.

(on the plus side - meta data for .m4a files output from ffmpeg shows up fine in Windows!)

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 5:41pm UTC](https://community.transloadit.com/t/audio-encoding/17843/7 "2011-01-20T17:41:00Z")

</div>

thanks to help from ffmpeg-users I found the correct -f option for AAC files is ‘mp4’:  
[http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2011-January/028474.html](http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2011-January/028474.html)

bit confusing because in the ffmpeg -formats list there are also ‘aac’ and ‘m4a’ entries which match the codec name and file extension respectively, but in this case they are the wrong ones to use!

so I assume for every output format there is a valid -f option and the file extension thing isn’t an issue.

in my Assembly response I see:

```auto
[audio_codec] => ffaac

```

so it looks like libfaac is used.

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 6:10pm UTC](https://community.transloadit.com/t/audio-encoding/17843/8 "2011-01-20T18:10:00Z")

</div>

Coming back to the thing of file extensions - it looks like Transloadit tries to detect the file type and append an appropriate file extension when copying results to s3 (?)

Due to earlier errors I established that at the ffmpeg encoding stage there was no file extension, but in the s3 bucket my mp3 result file is called ‘originalname.mp3’, which is great.

My AAC file came out as ‘originalname.mp4’, which is not wrong though in my case I’d like to see a .m4a like iTunes uses. The assembly reports a mime of **video/mp4** and type **video**. Seems like this should be ‘audio’, but I don’t know if the mp4 format is ambiguous or something.

I got FLAC working, but the output file is ‘originalname.wav’ …The assembly output shows **[mime] =\> audio/flac** so I guess you need more mappings of mime types to extensions.

Or… I think in the end being able to specify my own file extension in the assembly would be useful.

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 6:14pm UTC](https://community.transloadit.com/t/audio-encoding/17843/9 "2011-01-20T18:14:00Z")

</div>

Apologies… I can do the file extension myself by setting up the /s3/store robot properly!

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 20, 2011, 6:50pm UTC](https://community.transloadit.com/t/audio-encoding/17843/10 "2011-01-20T18:50:00Z")

</div>

and correct -f option for ALAC (Apple Lossless) is ‘-f ipod’…

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 21, 2011, 9:21am UTC](https://community.transloadit.com/t/audio-encoding/17843/11 "2011-01-21T09:21:00Z")

</div>

So at this point you still need us to fix the mime types of the files on S3? Or could you for the mean time make one export step for each file, and set the mime via the `headers` ‘Content-Type’ parameter?

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 21, 2011, 1:33pm UTC](https://community.transloadit.com/t/audio-encoding/17843/12 "2011-01-21T13:33:00Z")

</div>

Have you fixed the mime types? I am seeing **audio/mp4** today which is awesome (I might have had a mistake in my assembly yesterday).

I just processed a much more complete assembly with good success:  
[https://transloadit.com/assemblies/view/REDACTED](https://transloadit.com/assemblies/view/REDACTED) (I guess you can peek into my account)

Only the mp3s had their file extension detected when saving the output files, but as you say I can get around that by having individual export steps for each encoding in my assembly.

My only remaining issues are with metadata tagging in the files: Windows needs ID3v2.3 tags in mp3s but I can only output v2.4. Also I haven’t yet been able to write any metadata to the Ogg and the Flac only had partial data visible when played in VLC – Ogg and Flac both use Vorbis Comments format I think.

Both of these are issues with ffmpeg rather than Transloadit, but if no solution is possible on ffmpeg side it means I rely on Transloadit to provide other ways of adding metadata to the files before transfer to S3.

P.S.  
it’s great what you guys have built here, impressed!

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 21, 2011, 1:50pm UTC](https://community.transloadit.com/t/audio-encoding/17843/13 "2011-01-21T13:50:00Z")

</div>

Ideally I’d like to be able to add album art as metadata to those audio formats where that is possible. I don’t think ffmpeg can do that at all.

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 21, 2011, 2:54pm UTC](https://community.transloadit.com/t/audio-encoding/17843/14 "2011-01-21T14:54:00Z")

</div>

> Have you fixed the mime types?

No, we made no changes yet.

The stuff you are trying todo will require explicit audio meta data support on our end. If you know of any suitable linux tools for that, we’d be happy to hear about it.

--fg

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 26, 2011, 7:21pm UTC](https://community.transloadit.com/t/audio-encoding/17843/15 "2011-01-26T19:21:00Z")

</div>

re metadata tagging. I have been reading up lately and it’s quite a complicated issue.

The two libraries I’ve seen that comprehensively handle multiple formats and look up-to-date are:  
[http://code.google.com/p/mutagen](http://code.google.com/p/mutagen) (Python)  
[http://www.jthink.net/jaudiotagger](http://www.jthink.net/jaudiotagger) (Java)

For me Mutagen is _not_ currently an option as it insists on saving ID3v2.4 tags for mp3s. I believe jAudioTagger can be made to save v2.3 tags.

Both are object-oriented libraries without any command-line interface so you’d have to do some work to wrap them up and expose a nice interface to the Assembly engine. If you’re on Node.js then jAudioTagger might integrate more easily as it’s Java.

The main things for me are:  
- ability to set any tag in all the main formats (not just a subset of common tags) - ability to save ID3v2.3 tags in mp3s for Windows-compatible tagging

---

<div class="post-metadata">

**Author:** ![anentropic](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/anentropic/32/1496_2.png) [@anentropic](https://community.transloadit.com/u/anentropic)\
**Post date:** [January 26, 2011, 7:38pm UTC](https://community.transloadit.com/t/audio-encoding/17843/16 "2011-01-26T19:38:00Z")

</div>

As a quick fix, it would be great if there way a way to use the metadata option of ffmpeg via an assembly. On the command-line you have to use the -metadata option several times… once for each tag you want to set.

eg

```auto
ffmpeg -i "test.wav" -acodec libmp3lame -ab 128k -metadata artist="Artist" -metadata title="Title" ../test2.mp3

```

I don’t think this is possible via the ‘ffmpeg’ parameter of the encode robot currently?

Maybe if you could give it an object as a value, eg:

```auto
      "mp3_320": {
          "use": ":original",
          "robot": "/audio/encode",
          "ffmpeg": {
              "f": "mp3",
              "acodec": "libmp3lame",
              "ab": "320k",
              "metadata": {
                  "artist": "The Artist",
                  "title": "Track Title",
                  "album": "The Album"
              }
          }
      }

```

This still has the problems of using ffmpeg for the metadata but it would allow setting tags in mp3s (albeit v2.4) and m4a files (doesn’t seem to do much for flac or ogg).

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 31, 2011, 10:54am UTC](https://community.transloadit.com/t/audio-encoding/17843/17 "2011-01-31T10:54:00Z")

</div>

Actually, I think you can get the ffmpeg options to do this right now using this trick:

```auto
"mp3_320": {
  "use": ":original",
  "robot": "/audio/encode",
  "ffmpeg": [
    {
      "f": "mp3",
       "acodec": "libmp3lame",
       "ab": "320k",
    },
    { "metadata": "artist=\"The Artist\"" },
    { "metadata": "title=\"Track Title\"" },
    { "metadata": "album=\"The Album\"" }
  ]
}

```

I have not tested it, but it should pass the parameters to ffmpeg as you’d expected it to.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 9:11am UTC](https://community.transloadit.com/t/audio-encoding/17843/18 "2026-10-07T09:11:06Z")

</div>


