0

ffmpeg の Python GUI を書いています。サブプロセス経由で ffmpeg を呼び出すと、コマンドが次のようになっている限り、正常に実行されます

subprocess.Popen([ffmpeg_converter,
        '-i',file,
        target_file
        ])

しかし、ffmpeg 引数を使用して同じ呼び出しを行うと、「少なくとも 1 つの出力ファイルを指定する必要があります」で失敗します。

option_string = '-q:a 4'
subprocess.Popen([ffmpeg_converter,
        '-i',file,
        option_string,
        target_file
        ])

オプションも認識しますが、ターゲット ファイルは表示されません。実際のターゲットファイルを「test.mp3」のような単純なものに置き換えても、同じエラーが発生します。何か案は?(私はPython 3.3を搭載したWindowsを使用しています。)

完全なコンソール出力は次のとおりです。

    ffmpeg version N-57781-g0610d6e Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov  1 2013 18:01:35 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 49.100 / 52. 49.100
  libavcodec     55. 40.101 / 55. 40.101
  libavformat    55. 20.105 / 55. 20.105
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Trailing options were found on the commandline.
Input #0, flac, from 'c:\script\python\testdata\source\01. Es geht los.flac':
  Metadata:
    ARTIST          : Olivia Trummer Trio
    TITLE           : Es geht los
    ALBUM           : Westwind
    DATE            : 2008
    track           : 01
    GENRE           : Jazz
    COMMENT         : EAC FLAC -8
  Duration: 00:06:27.25, bitrate: 834 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
At least one output file must be specified
4

2 に答える 2

0

-q:a 4個別の値として渡す必要があると思います-q:a, 4.

于 2015-01-06T15:33:54.507 に答える