# Media File Transcoder



## PacketMan (Dec 7, 2014)

Hi all,

So I have been playing with MiniDLNA, and Plex both in a server role on FreeBSD 10.1-RELEASE 64 bit.

I like both, and it's obvious both have their strengths and weaknesses. If you boil it down, at the end of the day many of us are trying to achieve on thing: serve (stream) audio/video media files to our client devices. Without going into a big long discussion, I'll get right to the point.

Is there a port for FreeBSD for a media file transcoder? In this post I am not interested nor talking about transcoding on the fly. I am talking about having an 'app' find files in a folder that are one type of format, say .avi for example, and then transcoding that file into .mp4 for example. Ideally the user could set it up in such a way that many formats types are in the input, but only a couple types have been selected to be the output, say .mp3, and .mp4 for example.

And of course the various 'knobs' would be there so that the user can get the desired output media type.

A port like this would like this would be very useful not just for home users, but I think a fair few commercial applications too. Does such a port exist? I quick search revealed only one: arista which has been marked broken. That looks to be made for GNOME2 but I am more interested in something for server/appliance/headless type use, i.e access and configure it either GUI or HTTP access.


----------



## fonz (Dec 7, 2014)

There might be lighter solutions, but multimedia/mplayer can convert between movie formats.


----------



## DutchDaemon (Dec 7, 2014)

I use multimedia/ffmpeg for my (very infrequent) transcoding needs, usually for very new MP4 files that have codecs that my TV's media player doesn't recognize. I can quickly transcode them to a standard format that will play. Same for my car stereo that only handles MP3, so I transcode M4A/FLAC music into MP3. ffmpeg is a CLI tool, so it's very easy to script against.


----------



## DutchDaemon (Dec 7, 2014)

Just two very simple CLI ffmpeg(1) examples:
`/usr/local/bin/ffmpeg -n -i some_song.flac -ab 320k some_song.mp3`
`/usr/local/bin/ffmpeg -i some_vid.mp4 -b:v 2048k -b:a 128k some_vid.avi`

Use variables in the proper places, and you can easily pass file names to the commands.


----------



## fonz (Dec 7, 2014)

Out of curiosity: there seem to be three different versions in the ports tree. What's the difference between those?


----------



## PacketMan (Dec 7, 2014)

DutchDaemon said:


> Just two very simple CLI ffmpeg(1) examples:
> `/usr/local/bin/ffmpeg -n -i some_song.flac -ab 320k some_song.mp3`
> `/usr/local/bin/ffmpeg -i some_vid.mp4 -b:v 2048k -b:a 128k some_vid.avi`
> 
> Use variables in the proper places, and you can easily pass file names to the commands.



And with a little thought, and maybe a couple of directories, say a 'drop' directory and the 'streaming' directory, an amateur like me should be able to get a cron job looking for files in one directory, converting and drop into another directory, and clean up the drop directory automatically.

As I grow with FreeBSD, FreeBSD grows with me!


----------



## DutchDaemon (Dec 7, 2014)

Note that there are already several avenues into scripting/manipulating ffmpeg. 
	
	



```
$ psearch ffmpeg                                                          
graphics/php5-ffmpeg      The ffmpeg shared extension for php
multimedia/avbin          FFmpeg wrapper
multimedia/ffmpeg         Realtime audio/video encoder/converter and streaming server
multimedia/ffmpeg0        Realtime audio/video encoder/converter and streaming server
multimedia/ffmpeg24       Realtime audio/video encoder/converter and streaming server
multimedia/ffmpeg2theora  Reencode many media file formats to Ogg Theora
multimedia/ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers
multimedia/gstreamer-ffmpeg GStreamer plug-in for manipulating MPEG video streams
multimedia/kdemultimedia4-ffmpegthumbs FFmpeg-based thumbnail generator for video files
multimedia/p5-FFmpeg-Command Wrapper class for ffmpeg command line utility
multimedia/py-ffmpeg      Python bindings for FFmpeg
```


----------



## rmoe (Dec 7, 2014)

I've tried quite some applications and have arrived at using (command line) vlc for batch jobs and handbrake for a luxury GUI. There are diverse reasons for my choice, one of them being that I'm in between ignorant and stupid in that area, another one being that using vlc seemed to be the most convenient tool to use for batch conversions.

As it's laborious to think about the best settings and to remember the relevant options, parameters and settings I usually use handbrake for the occasional one-off job; it's simple, works well and, BTW., offers both a CLI version and some kind of batch jobs in the GUI, too ("job queues").


----------



## scottro (Dec 7, 2014)

I have a page that, though it wanders all over the place, does have a lot about transcoding, primarily with ffmpeg (and occasional HandBrakeCLI, which I prefer to its GUI version -- both get installed with the handbrake port.)

http://srobb.net/dvds.html


----------

