Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine whether an audio file is encoded in Apple Lossless (ALAC)

There are a number of audio files that have .m4a suffix and these are encoded in one of AAC or Apple Lossless (ALAC). I want to choose only audio files encoded in Apple Lossless of them. Is there any way to determine this? I tried FFmpeg, but it says all of them are encoded in AAC.

Edit: I am currently on Windows.

like image 841
minhee Avatar asked Jun 07 '12 15:06

minhee


1 Answers

If you have the FFmpeg package, you should have ffprobe.

Give this a try:

ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 file.m4a
  • -v error: to hide the startup text
  • -select_streams a:0: to select the first audio track
  • -show_entries stream=codec_name: to display only the codec type
  • -of default=noprint_wrappers=1:nokey=1: to remove extra formatting

This will print out just aac or alac. Perfect for scripting.

like image 91
Phernost Avatar answered Sep 29 '22 09:09

Phernost