I’m writing a wrapper for FFMPEG and need help of a multimedia guru. The more I read about containers, formats and codecs the more confused I become, it all seems to be a pretty big mess. Anyway…
To convert a video file with ffmpeg you need to specify a few arguments for ffmpeg:
input file
some video/audio options (bit rates, sizes and so on)
format (to force format)
codec (to force codec)
output file
My confusion is all about the format and output file extension. If I want to encode my file in MPEG-4, I’ll use either ‘libx264’ or ‘libxvid’ codec. Then the encoded stream needs to be stored in a file. If I use ‘.mp4’ as the output file, it’ll be stored in that file. If I use ‘.mkv’, the video will still be MPEG-4 but stored in a Matroska container. But what do I do with the format option? When I force the format to ‘mp4’, does it mean I don’t have to enter output file, it’ll be stored as ‘.mp4’ anyway? Or if I use ‘-matroska’ will I still have to put it into a container ‘.mkv’? Can I use a ‘-matroska’ format but ‘.mp4’ output file for example?
What’s the difference between the format and output file in this context? Or what does forcing the format really do?
but if you are looking for an openSUSE community developer you need to
know they mostly do not come here…to interact with them you have to
go where they hang out, IRC or mail lists…
Like palladium I think you posted not in the forum most promissing to get the multi-media gurus seeing it.
In any case, I will drop in a bit. You are talking about the format inside a file versus the the last few characters of the filename (by some people called the extension (which is a leftover from the MS-DOS file name definition).
Remind that ending a files name in e.g. .mp3 does not mean the code inside is a valid MP3. It is just a convention. To make this subject more obscure, many applications and people follow this convention, but when you have a file containing an JPEG graphics and name it* idiot.mp3*, it is not changed into music. Silly enough, so called file managers like Dolphin and Konqueror follow the convention and do not look inside the file for a magic number and thus lie to you