0

I want to split a stereo MP3 file into two mono MP3 files using FFmpeg such that each of the mono files is MPEG-1 Layer 3 Version 1:

I use this command:

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

The input file is MPEG-1 Layer 3 Version 1 but the out puts are MPEG-1 Layer 3 Version 2.

0

1 Answer 1

1

You can’t set it. FFmpeg choses the version automatically based on the desired output. to force a version, you must use options compatible with that version. Read this link (intro from that page below) and choose the correct combination that works for your application.

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.

1
  • So, can you tell me the command for producing the desired output?
    – samsam114
    Dec 28, 2016 at 7:57

You must log in to answer this question.

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