2

さまざまなビデオ ファイルから字幕を抽出して.srtフォーマットする必要があります (html5 ビデオで使用するため)。Googleで見つけた多くのバリアントを試しました。しかし、このエラーが発生するたびに:

出力ストリーム #0:0 のエンコーダーを開くときにエラーが発生しました - bit_rate、rate、width、height などのパラメーターが正しくない可能性があります

このエラーは、ffmpeg がソース サブタイトルをデコードできるが、.srtフォーマットにエンコードできないことを意味していると思います。すべてのコーデックが有効になっています(別の構成でgitから新しいffmpegバージョンを数回コンパイルしました)。

出力は次のとおりです。

    # /usr/local/bin/ffmpeg -i /var/video/sources/Balbesy1.m2ts -an -vn  -copyinkf -scodec srt -f srt -y  sub.srt
ffmpeg version N-49947-g9f16cb9 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 14 2013 14:26:10 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --enable-encoder=dvdsub --enable-decoder=dvdsub --enable-decoder=pgssub --enable-encoder=srt --enable-decoder=srt --enable-encoder=srt --enable-decoder=srt
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[mpegts @ 0x2719040] Stream #5: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x2719040] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x271fec0] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from '/var/video/sources/Balbesy1.m2ts':
  Duration: 01:18:11.89, start: 599.958300, bitrate: 37378 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
    Stream #0:2[0x1101]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
    Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:4[0x1103]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:5[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Output #0, srt, to 'sub.srt':
    Stream #0:0: Subtitle: srt
Stream mapping:
  Stream #0:5 -> #0:0 (pgssub -> srt)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

私の英語でごめんなさい

4

0 に答える 0