我将音频文件MP4转换为AAC,然后想要在SoundManager2中播放该文件。如果我使用某些软件进行Windows转换,每次都很好,音频播放效果很好。但是,在服务器端,当使用ffmpeg将MP4文件转换为AAC时,文件将加载到SM2中,但不会启动播放。
我使用这个命令:
ffmpeg -i in.mp4 out.aac
这是SoundManager2日志:
-- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: true, wav: true -- soundmanager2.js:1156
-- SoundManager 2 V2.97a.20120916 (AS3/Flash 9) + HTML5 audio, high performance mode, custom (1ms) polling, wmode: transparent, flash debug mode, flashBlock mode -- soundmanager2.js:1156
soundManager::createMovie(): Trying to load /soundmanager/swf/soundmanager2_flash9_debug.swf soundmanager2.js:1156
soundManager::initMovie(): Waiting for ExternalInterface call from Flash... soundmanager2.js:1158
soundManager::externalInterfaceOK() (~0 ms) soundmanager2.js:1158
soundManager::init() soundmanager2.js:1158
soundManager: Attempting JS to Flash call... soundmanager2.js:1158
(Flash): SM2 SWF V2.97a.20120916 (AS3/Flash 9) soundmanager2.js:1158
Flash security sandbox type: remote soundmanager2.js:1158
(Flash): JS to/from Flash OK soundmanager2.js:1158
(Flash): Enabling polling, 1 ms interval soundmanager2.js:1158
-- SoundManager 2 loaded (OK) -- soundmanager2.js:1156
soundManager: Firing 1 onready() item soundmanager2.js:1158
threeSixtyPlayer.init() soundmanager2.js:1158
threeSixtyPlayer.init(): Found 1 relevant items. soundmanager2.js:1158
handleClick() soundmanager2.js:1158
soundManager.createSound(): ui360Sound0 (http://[private url]/out.aac?v=1350309261) soundmanager2.js:1156
soundManager.createSound(): Enabling usePolicyFile for data access soundmanager2.js:1158
SMSound() merged options: {
id: ui360Sound0,
url: http://[private url]/out.aac?v=1350309261,
onplay: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onstop: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onpause: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onresume: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onfinish: { var nextLink; pl.removeClass(this._360data.oUIBox,this._360data... },
onbufferchange: { if (this.isBuffering) { pl.addClass(this._360data.oUIBox,pl.css... },
whileloading: { if (this.paused) { self.updatePlaying.apply(this); } }... },
whileplaying: { self.updatePlaying.apply(this); this._360data.fps++; }... },
useWaveformData: false,
useEQData: false,
usePeakData: true,
autoLoad: false,
autoPlay: false,
loops: 1,
multiShot: true,
multiShotEvents: false,
pan: 0,
stream: true,
usePolicyFile: true,
volume: 50,
useMovieStar: false,
isMovieStar: false,
bufferTime: 3
} soundmanager2.js:1158
(Flash): SoundManager2_SMSound_AS3: Got duration: 0, autoPlay: false soundmanager2.js:1158
SMSound.play(): Attempting to load "ui360Sound0" soundmanager2.js:1156
SMSound.load(): http://[private url]/out.aac?v=1350309261 soundmanager2.js:1156
SMSound.play(): "ui360Sound0" is starting to play soundmanager2.js:1158
fanOut: ui360Sound0: http://[private url]/out.aac?v=1350309261 soundmanager2.js:1158
(Flash): start (ui360Sound0): 0 soundmanager2.js:1158
SMSound._onbufferchange(): 1 soundmanager2.js:1158
SMSound._onbufferchange(): 0 soundmanager2.js:1158
SMSound._onload(): "ui360Sound0" loaded.
可能有什么问题?
答案 0 :(得分:1)
仅SoundManager(完全)支持MPEG-4 AAC音频。您尝试播放的文件可能是MPEG-2 Part 7中定义的AAC的“非向后兼容”版本:
MPEG-2标准的Part 7 (ISO/IEC 13818-7)指定了一种相当不同的,非向后兼容的音频格式(也称为MPEG-2 NBC)。第7部分称为MPEG-2 AAC。
据我所知,只有Safari(QuickTime)会播放这些文件。 Chrome或Flash都不会播放这些文件。但是,MPEG-2 AAC文件的MIME类型对于MPEG-4 varient是相同的,因此在您尝试播放之前几乎不可能知道该文件是不可播放的。 (当被问到时,MPEG-LA回答“因为你这就是原因。”)