min*_*hee 5 audio encoding aac m4a
有许多带有.m4a后缀的音频文件,这些文件以AAC或Apple Lossless (ALAC)之一编码。我只想选择以 Apple Lossless 编码的音频文件。有没有办法确定这一点?我试过FFmpeg,但它说所有这些都是用 AAC 编码的。
编辑:我目前在 Windows 上。
如果您有 FFmpeg软件包,那么您应该有ffprobe。
尝试一下:
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 file.m4a
Run Code Online (Sandbox Code Playgroud)
-v error:隐藏启动文本-select_streams a:0:选择第一个音轨-show_entries stream=codec_name:仅显示编解码器类型-of default=noprint_wrappers=1:nokey=1:删除多余的格式这将打印出aacor alac。非常适合编写脚本。
以下是第 67 页上包含 M4A 描述的文件(迄今为止我能找到的最好的描述):\n http://iweb.dl.sourceforge.net/project/audiotools/audio%20formats%20reference/2.14/audioformats_2。 14_字母.pdf
\n\n\n\n\nRun Code Online (Sandbox Code Playgroud)\nA typical M4A begins with an \'ftyp\' atom indicating its file type...\n10.2.1 the ftyp atom\n[0 31] ftyp Length [32 63] \'ftyp\' (0x66747970)\n[64 95] Major Brand [96 127] Major Brand Version\n[128 159] Compatible Brand\xe2\x82\x81 ...\nThe \'Major Brand\' and \'Compatible Brand\' elds are ASCII strings. \n\'Major Brand Version\' is an integer.\n
起初我认为“ftyp”是确定格式的地方,但从这个列表来看,它更像是文件类型本身(已经称为 m4a):\n http://www.ftyps.com/index.html html
\n\nhttp://www.ftyps.com/what.html描述了更多的格式。
\n\n如果 ftyp 不区分,那么我认为“主要品牌”字段可能指的是此页面上的 fourcc:\n http://wiki.multimedia.cx/index.php?title= QuickTime_container \nApple Lossless 的容器是“alac”,AAC 的容器可能是“mp4a”
\n\nApple的Lossless格式开源页面表明ftype是\'alac\'(与上面略有矛盾)\n http://alac.macosforge.org/trac/browser/trunk/ALACMagicCookieDescription.txt
\n\n到目前为止,我可以告诉的是,ftyp 之后的 4 个字节始终(在较小的样本大小中)“M4A”。
\n\n在前约 200(十六进制)字节左右的某个地方,有一个用于 AAC 压缩的 ascii“mp4a”或一个用于 Apple Lossless 的“alac”。“alac”似乎总是成对出现,相距约 30 个字节(“mp4a”仅一次)。
\n\n抱歉,这不是更具体,如果我找到确切的位置或前缀,我会再次更新。(我的猜测是标头的早期部分在某处指定了大小。)
\n