command line software for audio/video and image manipulation

0

0

Im running a website on Linux/Apache and I need to install software that does the following:

  • Converts audio files into MP3 and find the length of the file.
  • Converts video files into FLV.
  • Create several different sized images from one image.

Obviously I need to be able to run all this from a command line. So far the best solutions Ive found are SoX (for the audio), FFMPEG (for the video) and ImageMagick (for the images). Is there anything else that is better than these pieces of software?

Is there one piece of software that does all of these things? Or am I hoping for too much? :)

Jimmery

Posted 2011-12-21T14:41:44.583

Reputation: 440

3Why would you like to have all-in-one tool here? In my opinion, having 3 different tools is an advantage and I don't know any other tools which would beat those three same time! – Alexander Galkin – 2011-12-21T15:53:30.323

+1 @Alexander Galkin agree, there is not a reason to require all 3 tasks in one program, unless there is a requirement that the 3 types of content are all derived from one source and that there is some sort of complex interdependency between the sources that would make conversion indvidually highly manual. – therobyouknow – 2011-12-21T16:37:32.633

Answers

2

You have made good choices, although FFmpeg can also:

Convert audio files into MP3:

ffmpeg -i input -c:a libmp3lame -q:a 4 output.mp3

or pipe to LAME:

ffmpeg -i input -f wav - | lame -V4 - output.mp3

Find the length of the MP3 file:

ffmpeg -i input 2>&1 | awk '/Duration/{print $2}' | sed 's/,//g'

Convert video files into FLV:

ffmpeg -i input -c:v libx264 -preset medium -crf 24 -c:a libmp3lame \
-ar 44100 -q:a 4 output.flv

Create several different sized images from a video from 5 seconds in:

ffmpeg -i input -ss 5 -vframes 1 -vf scale=iw/2:-1 half.png -ss 5 -vframes 1 \
-vf scale=600:-1 600pxwide.png -ss 5 -vframes 1 -vf scale=300:300 \
300x300-ignoring-aspect.png

llogan

Posted 2011-12-21T14:41:44.583

Reputation: 31 929

1

Video command line and scripting/macros: Consider avidemux: http://www.avidemux.org/admWiki/doku.php and avisynth (also discussed there).

Audio command line: http://www.netwaysglobal.com/mpegrec/ and http://sourceforge.net/projects/mp3record/

Also:

Head on over to related sites in the stackexchange family: https://video.stackexchange.com/ (Audio Video Production Q&A) and photo.stackexchange.com for more ideas.

therobyouknow

Posted 2011-12-21T14:41:44.583

Reputation: 3 596