簡體   English   中英

Fluent-ffmpeg“不合適的輸出格式”

[英]Fluent-ffmpeg “not a suitable output format”

我正在使用Node.js的fluent-ffmpeg模塊來轉換音頻文件。 我有一個.mp3文件,我想轉換為.wma

這是看起來像:

var proc = new ffmpeg({
   source: 'file.mp3',
   nolog: false
}).toFormat('wma')                                                
  .saveToFile('file.wma', function(stdout, stderr)
{                                                 
    console.log(stderr);
});

不幸的是,我收到錯誤:

 Requested output format 'wma' is not a suitable output format 

這是整個錯誤日志:

ffmpeg version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:25:10 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mp3, from 'song_downloads/You Suffer.mp3':
  Metadata:
    title           : You Suffer
    artist          : Napalm Death
    album           : Scum
    genre           : Death Metal
    track           : 12
    date            : 1987
  Duration: 00:00:04.98, start: 0.000000, bitrate: 381 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 193 kb/s
Requested output format 'wma' is not a suitable output format

我知道這不是一個ffmpeg問題,因為

ffmpeg -i file.mp3 file.wma

工作良好。 有任何想法嗎?

我認為,wma不是容器格式。 這是一個音頻編解碼器。 WMA文件最常包含在ASF(高級系統格式)格式中。 因此,請選擇fluent-ffmpeg API中給出的正確選項來設置編解碼器和格式。 您可以運行以下命令:

  1. ffmpeg -formats查看所有格式和

  2. ffmpeg -codecs查看所有支持的編解碼器

這對我很好

fluent_ffmpeg('input.mp3').audioCodec("aac").save('output.aac')

格式為: D aac raw ADTS AAC (Advanced Audio Coding)

不支持E = Muxing

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM