WHAT IS FFMPEG?
ffmpeg is a tool that, in its simplest form, implements a decoder and then an encoder, thus enabling the user to convert files from one container/codec combo to another, for example a VOB file from a DVD containing MPEG2 video and AC3 audio to an AVI file containing MPEG4 video and MP3 audio, or a QuickTime file containing SVQ3 video and MP3 audio to a 3GP file containing H263 video and AMR wideband audio. The original container is examined and the encoded data extracted and fed through the codecs. The newly-decoded data is then fed through the “target” codecs into the new container.
ffmpeg can also do a few basic manipulations on the audio and video data just before it is re-encoded by the target codecs. These manipulations include changing the sample rate of the audio and advancing or delaying it with respect to the video. They also include changing the frame rate of the resulting video, cropping it, resizing it, placing bars left and right and/or top and bottom in order to pad it when necessary, or changing the aspect ratio of the picture (if the container supports anamorphic display − not all do). Furthermore, ffmpeg allows importing audio and video from different sources, thus allowing dubbing for example.
Another piece of software similar to ffmpeg is transcode, but it seems far less flexible to me than ffmpeg when it comes to manipulating audio and video streams. Parts of transcode, though, are invaluable for grabbing data off DVD-Videos, in particular tcprobe (used for getting information about titles on the DVD), tccat (for descrambling − if libdvdcss is installed − and extracting the VOB files from the DVD, you’ll also need libdvdread) and sometimes tcextract for extracting the various audio, video and subtitle streams from the VOB files. This said, mplayer (built on ffmpeg) is perfectly capable of extracting titles from a DVD-Video and ffmpeg can extract the individual channels from the resulting .vob file.
BUILD AN APPLICATION CONVERTER
1)You’ll need ffmpeg.exe(google it;))
2)FFMPEG command line:
For more command lines check the documentation.
3)Delphi Application
To use FFMPEG in a delphi application we will use ShellExecute function, so we’ll have to include shellapi header.
params: string;
dir: string;
begin
dir:=ExtractFilePath(ParamStr(0))+'FFMPEG.EXE';
params:=' -i '+PWideChar(edit1.Text)+' -s '+combobox1.Items[combobox1.ItemIndex]+ ' -r '+edit2.Text +' -b '+edit3.Text+' -ar '+edit4.Text+' -ab '+edit5.Text+' -ac 2 '+edit6.Text+'.avi';
ShellExecute(Handle, PWideChar('open'), PWideChar(dir),Pwidechar(params), PWideChar(''), SW_SHOW);
end;
That’s all. You can check demo included…it allows converting to different resolution,bitrate,resample etc.




