4

I have been suggested two different ffmpeg commands for converting an mkv file to an mp4 while just re-encoding the audio (to aac) and leaving the video portion as is. Here are the two commands:

  1. ffmpeg -loglevel panic -i source.mkv -vcodec copy -c:a aac -strict -2 -ab 160k -ac 2 -ar 48k target.mp4

  2. ffmpeg -i source.mkv -c:v copy -c:a aac -b:a 384k -strict -2 target.mp4

Could someone please explain the difference? OK, more precisely, I am curious about the things the first command does in addition to what the second one does. Is it necessary to use a -log level panic argument? What happens if it's omitted?

I understand the second command thoroughly. But the additional arguments in the first one are confusing me and I didn't find much help in the ffmpeg documentation either. In particular, I want to understand what the -ac, -ar, and -ab arguments accomplish and why are they not used in the second command.

2 Answers 2

3

ffmpeg duplicates syntax. Except for the values used, and that the first command set the sampling rate instead of using the default, the commands are effectively the same:

 -loglevel panic  - merely makes ffmpeg less noisy in the shell
 -vcodec copy     = -c:v copy
 -acodec copy     = -c:a copy   # unlisted in the command, but listing here to show there is consistency
 -ab              = -b:a

Note: The other answer info is correct.

There is a guide online; it lists what every possible argument means.

0
2

The three flags ask for a 2 channel, 48000 Hz sampled, 160k bit rate encoded audio track.

The flags that can be passed to ffmpeg are listed in the ffmpeg manual page. Manual pages tend to be terse but informative:

ac

-ac channels

Set the number of audio channels (default = 1).

ar

-ar freq

Set the audio sampling frequency (default = 44100 Hz).

ab

-ab bitrate

Set the audio bitrate in bit/s (default = 64k).

2
  • if -ab sets the bitrate, isn't it the same as -b:a?
    – TheLearner
    Commented May 15, 2014 at 14:46
  • Why not try both and compare the output? It certainly looks possible to double set values with a tool as sophisticated and capable as ffmpeg. Commented May 15, 2014 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .