2016-07-30 25 views
0

我試着去處理一個文件並運行以下命令FFmpeg的「無法分析選項值‘(空)’作爲樣本格式」

ffmpeg -i input.webm output.webm 

我與ffmpeg的圖書館做它從videoconverter.js。我試圖瞭解什麼是錯的,或者我如何解決它。

我最終得到這樣的:

Worker has received command 
Received command: -i input.webm output.webm. Processing with 268435456 bits. 
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers 
    built on Jun 9 2014 20:24:32 with emcc (Emscripten GCC-like replacement) 1.12.0 (commit 6960d2296299e96d43e694806f5d35799ef8d39c) 
    configuration: --cc=emcc --prefix=/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist --extra-cflags='-I/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/include -v' --enable-cross-compile --target-os=none --arch=x86_32 --cpu=generic --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-protocols --disable-indevs --disable-outdevs --enable-protocol=file --enable-libvpx --enable-gpl --extra-libs='/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libx264.a /Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libvpx.a' 
    libavutil  52. 66.100/52. 66.100 
    libavcodec  55. 52.102/55. 52.102 
    libavformat 55. 33.100/55. 33.100 
    libavdevice 55. 10.100/55. 10.100 
    libavfilter  4. 2.100/4. 2.100 
    libswscale  2. 5.102/2. 5.102 
    libswresample 0. 18.100/0. 18.100 
    libpostproc 52. 3.100/52. 3.100 
[vp8 @ 0xed8c00] Warning: not compiled with thread support, using thread emulation 
Guessed Channel Layout for Input Stream #0.0 : mono 
Input #0, matroska,webm, from 'input.webm': 
    Metadata: 
    encoder   : Chrome 
    Duration: N/A, start: 0.000000, bitrate: N/A 
    Stream #0:0(eng): Audio: opus, 48000 Hz, mono (default) 
    Stream #0:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 1k tbn, 1k tbc (default) 
[abuffer @ 0xedd670] Unable to parse option value "(null)" as sample format 
    Last message repeated 1 times 
    Last message repeated 1 times 
[abuffer @ 0xedd670] Error setting option sample_fmt to value (null). 
[graph 1 input from stream 0:0 @ 0xedd600] Error applying options to the filter. 
Error opening filters! 
Finished processing (took 673ms) 

最終的結果是,由於停止「無法分析選項值‘(空)’作爲樣本格式」。我將如何解決這個問題?

+0

看起來不像一個編程特定的問題,所以它在這裏是不重要的。我建議[su]提供'ffmpeg' cli工具使用問題。 – LordNeckbeard

+0

@LordNeckbeard ffmpeg的普通版本沒有問題。 JavaScript emscripten版本。 – Akshat

回答

0

您的ffmpeg版本正在使用舊版不支持的版本2.2.1。 它本身支持Opus解碼太舊(此版本需要libopus來解碼Opus)。升級到源自開發分支(「git master」)的構建,或者至少使用最新版本。

如果可能的話,您還應該使用現代的libvpx。請注意,使用最新的FFmpeg,您需要刪除--disable-bsfs,因爲VP9現在是Webm的默認視頻編碼器,它需要vp9_superframe比特流篩選器(它會自動應用)。或者,您可以使用-c:v libvpx強制VP8編碼。

考慮爲Webm添加libopus(首選)或libvorbis支持;否則你會使用非常糟糕和實驗性的FFmpeg原生Vorbis編碼器。

+0

構建javascript版本需要Disable-asm和disable-pthreads。它是一個emscripten版本。我會嘗試用'--disable-bsfs'重建。你可以在這裏看到構建腳本:https://github.com/bgrins/videoconverter.js/blob/master/build/build_all_codecs.sh。我曾嘗試使用-c複製,它有同樣的問題,我認爲它需要一個解碼器可用來做一個remux。 – Akshat

+0

@Akshat答案已更新。您的版本太舊,本地支持Opus解碼。 – LordNeckbeard