Reputation: 11310
I come across this code in one php script that i bought last time to convert video. The script is running on Ubuntu 12.04
-i $file_source -b 9600k -aspect 16:9 -acodec aac -strict experimental -ab 128k -ar 22050 $file_dest"
That is the full meaning of elements/attributes and what could be the alternative?
Thanks for your help
Upvotes: 0
Views: 2026
Reputation: 2735
You can use below command to convert videos using ffmpeg
Required Codec:
Commands As Below -
Convert to flv -
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.flv";
ffmpeg -i $file_source -pass 1 -vcodec libx264 -preset slower -b 512k -bt 512k -threads 0 -s 640x360 -aspect 16:9 -acodec libmp3lame -ar 44100 -ab 32 -f flv -y $file_dest
Convert to mp4 to support HTML5 -
$file_source = "/tmp/test.flv";
$file_dest = "/tmp/test.mp4";
ffmpeg -y -i $file_source -vcodec libx264 -q:v 1 -preset slower -profile:v baseline -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libfaac -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f mp4 $file_dest
Convert to webm to support HTML5 -
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.webm";
ffmpeg -y -i $file_source -vcodec libvpx -b:v 480k -bt 480k -preset slower -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libvorbis -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f webm $file_dest
Convert to ogv to support HTML5-
$file_source = "/tmp/test.mp4";
$file_dest = "/tmp/test.ogv";
ffmpeg -y -i $file_source -vcodec libtheora -b:v 480k -bt 480k -preset slower -level 30 -crf 30 -vf scale="480:360" -aspect 16:9 -s 640x360 -acodec libvorbis -ab 128k -ac 2 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 -f ogg $file_dest;
For more information about ogg,mp4,web check link html5-videos-things-you-need-to-know and easyhtml5video
Upvotes: 1
Reputation: 15871
This is a command line instruction for FFMPEG
You can read the documentation for alternative options at: FFMPEG Docs
Anyways just to explain..
-i $file_source -b 9600k -aspect 16:9 -acodec aac -strict experimental -ab 128k -ar 22050 $file_dest
Where..
-i $file_source
is your input file (any media type)
-b 9600k
is video bitrate
-aspect 16:9
is widescreen
-acodec aac -strict experimental
is using AAC codec (is experimental codec so use strict to force usage anyway)
-ab 128k
is audio bitrate 128kb/s
-ar 22050
is audio samplerate of 22.05 khz
$file_dest
the output filename (with extension so FFMPEG knows your preferred output format
Upvotes: 1