Como definir a versão de um arquivo MP3 de saída no FFmpeg

0

Eu quero dividir um arquivo MP3 estéreo em dois arquivos MP3 mono usando o FFmpeg, de modo que cada um dos arquivos mono seja MPEG-1 Layer 3 Versão 1:

Eu uso este comando:

ffmpeg -i input.mp3 -map_channel 0.0.0 left.mp3 -map_channel 0.0.1 right.mp3

O arquivo de entrada é MPEG-1 Layer 3 Versão 1, mas as saídas de saída são MPEG-1 Layer 3 Version 2.

    
por samsam114 27.12.2016 / 14:02

1 resposta

2

Você não pode defini-lo. O FFmpeg escolhe a versão automaticamente com base na saída desejada. para forçar uma versão, você deve usar opções compatíveis com essa versão. Leia este link (intro da página abaixo) e escolha a combinação correta que funciona para sua aplicação.

Within an MPEG audio file, there is no main header, as an MPEG audio file is just built up from a succession of smaller parts called frames. Each frame is a datablock with its own header and audio information.

In the case of Layer I or Layer II, frames are totally independent from each other, so you can cut any part of an MPEG audio file and play it correctly. The player will then play the music starting from the first full valid frame it will find. However, in the case of Layer III, frames are not always independant. Due to the possible use of the "byte reservoir", wich is a kind of internal buffer, frames are often dependent of each other. In the worst case, 9 input frames may be needed before beeing able to decode one single frame.

If you need to retrieve information about an MPEG audio file, you might simply locate the first frame, and retrieve information from its header. Information within other frames should be consistent with the first one, except for the bitrate, as you might be retrieving information from a variable bitrate (VBR) file. In a VBR file, the bitrate can be changed in each frame. It can be used, as an exemple, to keep a constant sound quality during the whole file, by using more bits when the music is more complex and thus requires more bits to be encoded with a similar quality.

The frame header itself is 32 bits (4 bytes) length. The first twelve bits (or first eleven bits in the case of the MPEG 2.5 extension) of a frame header are always set to 1 and are called "frame sync". Frames may also feature an optional CRC checksum. It is 16 bits long and, if it exists, immediately follows the frame header. After the CRC comes the audio data. By re-calculating the CRC and comparing its value to the sored one, you can check if the frame has been altered during transmission of the bitstream.

    
por 27.12.2016 / 18:45