Playing MP2 files
  • Hello,
    Is there a way to play MP2 files in Airtime?
    I usually record streams from satellite and i'd prefer to keep them in mp2 instead of convert in mp3...
    Thanks
  • 15 Comments sorted by
  • Vote Up0Vote Down hoerichhoerich
    Posts: 627Member, Airtime Moderator
    hi, afaik, no!
    Airtime supports the playout of lossy compressed audio files in both MP3 and AAC formats and the open, royalty-free equivalent Ogg Vorbis. It also supports playout of lossless FLAC and WAV format audio files.
    see http://sourcefabric.booktype.pro/airtime-24-for-broadcasters/what-is-airtime/
    cheers
    Official Airtime Forum Manager
    --------------------------
    Most of the time an issue is located between keyboard and chair.
  • Been playing MPEG1 Layer 2 (MP2) files in airtime..just rename the extension from MP2 to MP3. I don't think the fades will work consistently but I'm still experimenting a bit..would love to see not having to change the extension to play them. It would be nice to support them since they are a standard among broadcasters. Also at higher bit rates they can actually outperform mp3..
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Kevin, thanks for the tip on renaming the files, I have filed a bug http://dev.sourcefabric.org/browse/CC-5481 to get this fixed.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    The small changes in https://github.com/danielhjames/Airtime/commit/41b32279ed100d289c3f92eb7e2a2df7f93b47d1 will enable you to upload .mp2 files and play them out. The Preview pop-up window does not yet work.
  • Good news! I'll wait for the 2.6 version.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    If you run your own server, you can make these small changes now, no need to wait for the next release. The Preview feature is unlikely to work because MP2 is not part of the HTML5 standard, so programs like jPlayer do not support it, as far as I can tell.

    Cheers!

    Daniel
  • That's great Daniel! Since I just joined the forums I had a little problem logging back in on my account due to my mistake. I'm not that familiar with the command line stuff in linux and how to do those little edits but will keep on working on it. You know what they say better be lucky than smart. :) 
  • Well I got in there last night and figured out how to find and make the changes but still got invalid extension error.. restarted computer and the same thing so I turned it off went to sleep and this morning it worked just fine. Sooo I guess it took a hard reboot to do the trick. :) It sure is nice to be able to just add the files to the library. I wonder if it would be possible to actually encode an mp2 stream? LOL, would make a nice fat STL or network stream for others to pull from.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Kevin, a hard reboot should not be required. These code changes affect two different parts of Airtime, the web interface Javascript (plupload) and the media monitor (started by /etc/init.d/airtime-media-monitor on boot). In theory the Javascript should be reloaded when you refresh the Add Media page, but it's quite likely that your web browser has a copy of the old version in its cache.

    So while testing this code change, after modifying the files in the commit, I performed two extra steps...

    1. Issued the command: sudo /etc/init.d/airtime-media-monitor restart
    2. In Firefox, I went to Edit -> Preferences -> Privacy -> clear your recent history -> check box for Cache -> Clear Now.

    As for encoding an MP2 stream, this may be possible with the twolame encoder but I'm not sure that Liquidsoap has any support for that at present. There are probably better options than MP2 for studio-to-transmitter links these days, but if you absolutely must use MP2 (for example in a DAB setup where the output is MP2) then I would suggest talking to the Liquidsoap devs about that.

    Cheers!

    Daniel
  • If you run your own server, you can make these small changes now, no need to wait for the next release. The Preview feature is unlikely to work because MP2 is not part of the HTML5 standard, so programs like jPlayer do not support it, as far as I can tell.

    Cheers!

    Daniel


    Ok, but where are the files
    plupload.js and pure.py  ? I run Airtime in Debian.
    Thanks!
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Divay, if you have performed a regular Airtime install, you would need to edit:

    /usr/share/airtime/public/js/airtime/library/plupload.js

    and

    /usr/lib/airtime/media-monitor/mm2/media/monitor/pure.py

    These changes would be overwritten when you upgrade, so the best place to hack on these features is in a git cloned copy, pulling from https://github.com/sourcefabric/Airtime.git on a regular basis.

    Cheers!

    Daniel
  • Thank you, it works perfectly! :)
  • Hi, I've seen you recently add a comment on the bug tracker because the preview does not work. Can we be able to upload mp2 files in the 2.6 version without modification?
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Divay, there is a further issue that Mutagen (the tagging library that we use) was not correctly reporting the mimetype of MP2 files. I have sent a patch to the authors of Mutagen and asked them to fix this. In the meantime we may patch the version of Mutagen that we ship with Airtime for the 2.6.0 release.

    I found a further issue that when Mutagen correctly identifies the file as MP2, and this value is stored in the Airtime database, the file no longer plays out. So it looks like I need to make another change to Airtime before this feature works 'out of the box'.

    Cheers!

    Daniel
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    I fixed the above issue - in advance of the feature being merged, you can roll a new pybundle with a patched mutagen or hack on the mutagen files directly on the server. There are only two files that need changing:

    https://github.com/danielhjames/Airtime/commit/99dde7fd693dd98e6c3ca2da59254e59fbcc5075

    The improvement that this modification offers is that Airtime can distinguish MP2 from MP3 even when the mimetype of the uploaded file is the same (e.g. audio/mpeg). This means that Airtime will not attempt to offer the user a browser preview of the MP2 file, which will not work since HTML5 has no support for MP2. Instead, the Library shows a padlock icon, just as for the other file types which cannot be previewed in a browser.

    Cheers!

    Daniel