
當我嘗試將音訊轉換為圖像(幅度頻譜)並將其資料發送到標準輸出(它嵌入在腳本中,因此我不需要在磁碟上寫入)時,它失敗
ffmpeg -y -f alaw -ar 8000 -i 282578800275916.8000-audio-pcma -frames:v 1 -filter_complex aformat=channel_layouts=mono,compand,showwavespic=s=183322x15 -f png - 2>> ffmpegDrawErr.log
我在日誌中得到: 請求的輸出格式“png”不是合適的輸出格式
但是如果我直接將其運行到文件中
ffmpeg -y -f alaw -ar 8000 -i 282578800275916.8000-audio-pcma -frames:v 1 -filter_complex aformat=channel_layouts=mono,compand,showwavespic=s=183322x15 out.png 2>> ffmpegDrawErr.log
效果很好
答案1
對於影像格式,有一組通用的複用器(image2 和 image2pipe)。使用編解碼器選項設定格式。
ffmpeg -y -f alaw -ar 8000 -i 282578800275916.8000-audio-pcma -frames:v 1 -filter_complex aformat=channel_layouts=mono,compand,showwavespic=s=183322x15 -c:v png -f image2pipe - 2>> ffmpegDrawErr.log