Если декодеры/кодеры годные и правильно настроены, то конвертирование lossless (далее LL) 2 LL колько угодно раз должно происходить без потерь. Проведем эксперимент:
Действующие лица: flac, ffmpeg, mplayer, альбом Pink Floyd в формате ape.
Задача: ape -> wav, wav -> flac, flac -> wav. При этом первый и последний wav'ы должны быть одинаковыми до байта.
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ file CDImage.ape
CDImage.ape: Monkey's Audio compressed format version 3990 with normal compression, stereo, sample rate 44100
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ ls
covers/ CDImage.ape CDImage.cue CDImage.log
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ cat `which any2wav`
#!/bin/sh
INPUTFILE=$1
OUTPUTFILE=$2
mplayer "$INPUTFILE" -vc null -vo null -ao pcm:fast:file="$OUTPUTFILE.wav"
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ any2wav CDImage.ape "1_ape2wav"
MPlayer SVN-r31303-4.4.3 (C) 2000-2010 MPlayer Team
Playing CDImage.ape.
libavformat file format detected.
[lavf] stream 0: audio (ape), -aid 0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
Selected audio codec: [ffape] afm: ffmpeg (FFmpeg Monkey's Audio)
==========================================================================
[AO PCM] File: 1_ape2wav.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:2576.7 (42:56.7) of 2576.7 (42:56.7) 0.9%
Exiting... (End of file)
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ flac --best --verify "1_ape2wav.wav" -o "2_wav2flac.flac"
flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.
1_ape2wav.wav: Verify OK, wrote 218614157 bytes, ratio=0.481
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ any2wav 2_wav2flac.flac "3_flac2wav"
MPlayer SVN-r31303-4.4.3 (C) 2000-2010 MPlayer Team
Playing 2_wav2flac.flac.
Audio only file format detected.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 678.7 kbit/48.10% (ratio: 84841->176400)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO PCM] File: 3_flac2wav.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:2578.1 (42:58.0) of 2576.0 (42:56.0) 0.2%
Exiting... (End of file)
|
|
~/tmp/1973 The Dark Side Of The Moon (Black Triangle) $ llr
total 1303676
drwxr-xr-x 2 X Y 4096 2010-04-03 03:20 covers/
-rw-r--r-- 1 X Y 454535804 2010-06-10 14:53 1_ape2wav.wav
-rw-r--r-- 1 X Y 218614157 2010-06-10 14:53 2_wav2flac.flac
-rw-r--r-- 1 X Y 454443052 2010-06-10 14:58 3_flac2wav.wav
-rw-r--r-- 1 X Y 207332660 2010-04-03 03:21 CDImage.ape
-rw-r--r-- 1 X Y 1062 2010-04-03 03:19 CDImage.cue
-rw-r--r-- 1 X Y 834 2010-04-03 03:19 CDImage.log
Кому лень читать портянку бреда привожу результат:
454535804 1_ape2wav.wav
454443052 3_flac2wav.wav
Версии программ:
~ $ flac --version
flac 1.2.1
.
~ $ mplayer -version
MPlayer SVN-r31303-4.4.3 (C) 2000-2010 MPlayer Team
.
~ $ ffmpeg --version
FFmpeg version SVN-r23019-4:0.6~svn20100505-1ubuntu1~multimediappa2, Copyright (c) 2000-2010 the FFmpeg developers