dcherednik / atracdenc

Dirty implementation of ATRAC1, ATRAC3 encoder
GNU Lesser General Public License v2.1
56 stars 14 forks source link

Convert ATRAC3 Plus to ATRAC1 #9

Open Invictaz opened 4 years ago

Invictaz commented 4 years ago
  1. Input track.oma or .msf (not yet supported)
  2. Determine if it is ATRAC 3 or ATRAC 3 Plus
  3. Convert to ATRAC 1 and output track.aea

Is not possible yet. It's only possible to decode Atrac1, not Atrac 3 or Atrac 3 Plus.

Decoding source

ATRAC3 Plus https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/atrac3plus.c ATRAC3 https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/atrac3.c

Or use the one from VGMStream

https://github.com/losnoco/vgmstream

dcherednik commented 4 years ago

You can decode atrac3plus by ffmpeg to pcm and than encode pcm to atrac1. The result will be same.

Invictaz commented 4 years ago

That requires additional extra steps and extra harddrive space which consume a lot of time.

dcherednik commented 4 years ago

I can support read from stdin, on linux/mac it makes possible to pipeline ffmpeg and atracdenc without saving temporal files. It can be done for quite short period.

Invictaz commented 4 years ago

Great, I hope it is possible on the Windows build as well (or with temp files which can be deleted after processing).

dcherednik commented 4 years ago

The New Year present )) I added support of reading from stdin for windows and POSIX. So now it should be possible make a pipe from ffmpeg to atracdenc. Example: ffmpeg -i input_audio_file_supported_by_ffmpeg -f au - | atracdenc -e atrac1 -i - -o out.aea

https://github.com/dcherednik/atracdenc/releases/tag/0.0.2

Invictaz commented 4 years ago

It seems as if the pipe is failing:

image

dcherednik commented 4 years ago

The ffmpeg input file has 48000 samplerate. Try to add ffmpeg option to resample stream to 44100

Invictaz commented 4 years ago

Thanks, it seems to work for ATRAC3, but not for ATRAC3 plus (see below)

ffmpeg -i -ar 44100 -f au - | atracdenc -e atrac1 -i - -o out.aea

image

For ATRAC3Plus it seems to fail

image

Can upload sample file if you want.

Invictaz commented 4 years ago

It's quite weird as an output file is generated but still the errors in the console.

dcherednik commented 4 years ago

Can you just decode this sample by ffmpeg? If so please send me this sample.

enimatek-nl commented 3 years ago

Maybe use -f wav instead, all formats seem to work for me instead of using -f au.

And to get 'DSP Type-?' kind of that extra 'airy'-sound you could pre-process the wav with eg. stereotool.com (free version is what i use) and search for a very neutral profile on the forum (or create one your self) especially more silent/background instruments need to be pushed more forward i guess, and widen the stereo a bit, that is probably what the DSP/Type stuff does during recording, but i can only guess.

For example; you can also pipe stereotool so you command will be like: ffmpeg -i input.flac -f wav - | stereo_tool_mac - - -s neutral.sts | atracdenc -e atrac1 -i - -o output.aea