Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default ffmpeg codec when nothing is specified

Tags:

ffmpeg

codec

If I import a file to use with ffmpeg but dont specify anything about the codecs of any of the streams, will ffmpeg do anything? Is the default action to just copy the codecs? Or will ffmpeg encode the input file using some default codec?

Would the following two commands be the same? Or will the second re-encode and take ages?

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

ffmpeg -i input.mkv output.mp4
like image 528
Sam Avatar asked Jul 22 '13 16:07

Sam


People also ask

What is the default value of output devices in FFmpeg?

The default value for both options is 0. Output devices are configured elements in FFmpeg that can write multimedia data to an output device attached to your system. When you configure your FFmpeg build, all the supported output devices are enabled by default. You can list all available ones using the configure option "–list-outdevs".

How does FFmpeg re-encode audio files?

ffmpeg will re-encode each stream in the input using default encoders. The encoders used will depend on how you configured ffmpeg. For example, if available libx264 will be the default encoder for mp4 output, but if not then mpeg4 will be used.

Which options are supported by FFmpeg’s FLAC encoder?

The following options are supported by FFmpeg’s flac encoder. Sets the compression level, which chooses defaults for many other options if they are not set explicitly. Valid values are from 0 to 12, 5 is the default.

How to set avcodeccontext options in FFmpeg?

Also some options are meant only for decoding or encoding. Options may be set by specifying - option value in the FFmpeg tools, or by setting the value explicitly in the AVCodecContext options or using the libavutil/opt.h API for programmatic use. The list of supported options follow:


1 Answers

If I import a file to use with ffmpeg but dont specify anything about the codecs of any of the streams, will ffmpeg do anything?

ffmpeg will re-encode each stream in the input using default encoders. The encoders used will depend on how you configured ffmpeg. For example, if available libx264 will be the default encoder for mp4 output, but if not then mpeg4 will be used. By default ffmpeg will only re-encode one stream of each type and will ignore the rest (see stream selection).

Of your two commands the first one will use stream copy mode for the video and audio. Your second command will re-encode.

like image 186
llogan Avatar answered Sep 30 '22 06:09

llogan