Japanatron Logo

The open source stuff that JomSocial uses to convert and render video uploads (ffmpeg) also supports audio files.  I thought it would be cool to modify JomSocial to allow audio files to be used in its videos section.  It actually wasn't as hard to figure out as I thought it would be.  Please let me know if you have a better way to do this.  It would be cool if I could figure out how to customize the dull background ffmpeg puts on the "video," but at least it works.  Anyways, here's what I did...

* Find this file --> /components/com_community/helpers/videos.php
* Find the section that lists the MIME types that will be accepted
* Change / add MIME types as necessary

For example, I added this to videos.php:

$mimeType= array(
'audio/mpeg',
'video/x-flv',
'video/mpeg',
'video/mp4',

* You may also want to modify the language file so that audio files are listed as allowed uploads.  This just tells those uploading that they're allowed.

UPDATE 1
Something changed in a later version of ffmpeg, which broke JomSocial video uploads.  The wording on the ffmpeg version / copyright info changed, so some code modification was necessary to fix it.

* Go to a terminal on your server and type ffmpeg -version to see what the version / copyright info wording looks like.
* Edit this file --> /components/com_community/libraries/videos.php and look for the "hasFFmpegSupport" section.
* In my case I had to modify it to look like this:

function hasFFmpegSupport()
{
//return JFile::exists($this->ffmpeg);
$cmd= $this->ffmpeg . ' -version 2>&1';
$output= $this->_runCommand($cmd);
$hasVersion= JString::strpos( $output, 'ffmpeg version' );
$hasCopyright= JString::strpos( $output, 'the Libav developers' );

UPDATE 2
Newer versions of JomSocial have an additional file extension check upon upload, so 1 more change is necessary to get it working.

* Find the section below in file /components/com_community/helpers/videos.php, and add the file extensions you wish to support.  I added mp3 below as an example.

public function getValidExtensionType()
{
$extensionType= array(
'3g2',
'3gp',
'asf',
'asx',
'avi',
'flv',
'mov',
'mp3',
'mp4',

Related Articles

JomSocial - How to Disable Cov...

I don't particularly like Facebook's cover photo feature, so I didn't particularly like it when JomSocial followed suit.  Here's how to disable JomSocial's cove...

Combine Image File and Audio F...

I wanted to figure out a way to quickly and easily combine an image file (jpg) and audio file (mp3) into a video file (mov) using the free media converter tool ...

Hardware Graphics Acceleration...

ISSUEMS applications like Outlook sometimes show garbled video when scrolling through emails, etc.  Internet Explorer may garble the video when working in Citri...

Joomla - How to Modify RSSocia...

RSSocial is an awesome free Joomla extension I use to display social media icons on my site.  Since it uses the Fontello Zocial font kit, I figured out how to m...