#freeze
*同梱ffmpegのlameエンコードの不具合 [#s142a025]

** このページは一時的なものです [#m6123016]

このページは一利用者が Craving Explorer 内蔵の ffmpeg について作者さんへ
とある提案をするために一時的に作成したものです。
このページは一利用者が Craving Explorer 内蔵の ffmpeg について作者さんへ提案をするために一時的に作成したものです。
あくまで暫定的なもので今後削除・凍結等される可能性もあります。
また、ここに質問やこのページで書いている内容に関係しない不具合報告をしても
スルーされる可能性が高いです。
一般的な質問・不具合報告・提案等はここではない然るべき場所へ書いてください。

- 正式リリース版に関しては [[サポート掲示板:http://www.crav-ing.com/bbs.html]] へ
- テストリリース版に関しては、この Wiki 内の [[最新テストリリース:http://wiki.crav-ing.com/index.php?%E3%83%86%E3%82%B9%E3%83%88%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%201.0.0%20RC%202b]] のページへ


** 同梱ffmpegのlameエンコードの不具合 [#fd98bb4e]

現行の ffmpeg に lame 3.98-2 をリンクして -acodec libmp3lame で音声をエンコードすると

+ 音声ストリームの終端で
[libmp3lame @ 0x15641f0]lame: output buffer too small (buffer index: 8064, free bytes: 576)
というようなバッファ不足のエラーが出る
+ 上記のエラーリターンのため以下の svn コミット
=======================================================================
r16538 | michael | 2009-01-12 01:15:34 +0900 (月, 12 1 2009) | 2 lines
Check the return of audio and video encoders.
=======================================================================
より後のビルドだと音声のエンコードが正常に完了しない
+ 同一音声ソースをエンコードした場合でも、指定した音声ビットレートによってエンコードされた mp3 のフレーム数が異なる
具体的には指定ビットレートが低いほど、フレーム数が水増しされて再生時間が微妙に長くなっていく

という状況になります。
自分で svn 最新版をビルドしたものと、CE 1.0.0 RC2 以降に同梱の ffmpeg の両方で確認しているので多分 ffmpeg 側の不具合と思われます
(CE 内蔵のは r16538 以前なのでエンコード自体は完了して再生できるファイルにはなりますが、1と3の現象は発生しています)。

とりあえず応急処置的に以下の修正を libavcodec/libmp3lame.c に加えたところ問題が出なくなったようなので、
もし今回新しくテストリリース用にビルドした ffmpeg で同じ問題が起きているようなら試してみていただけませんでしょうか。

 Index: libavcodec/libmp3lame.c
 ===================================================================
 --- libavcodec/libmp3lame.c     (リビジョン 16716)
 +++ libavcodec/libmp3lame.c     (作業コピー)
 @@ -34,6 +34,7 @@
      int stereo;
      uint8_t buffer[BUFFER_SIZE];
      int buffer_index;
 +    int buffer_flushed;
  } Mp3AudioContext;
 
  static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
 @@ -73,6 +74,8 @@
      avctx->coded_frame= avcodec_alloc_frame();
      avctx->coded_frame->key_frame= 1;
 
 +    s->buffer_flushed = 0;
 +
      return 0;
 
  err_close:
 @@ -166,13 +169,15 @@
                  BUFFER_SIZE - s->buffer_index
                  );
          }
 -    }else{
 +    }else if(data == NULL && s->buffer_flushed == 0){
          lame_result= lame_encode_flush(
                  s->gfp,
                  s->buffer + s->buffer_index,
                  BUFFER_SIZE - s->buffer_index
                  );
 -    }
 +        s->buffer_flushed = 1;
 +    }else
 +        lame_result = 0;
 
      if(lame_result < 0){
          if(lame_result==-1) {

よろしくお願いします。

----
以下はコメント欄

- FFmpeg version SVN-r16716, Copyright (c) 2000-2009 Fabrice Bellard, et al. でも同様の「output buffer too small」エラーが発生しました。こちらのパッチを適用してコンパイルしたところうまくエンコードできました。 -- [[yosiwo]] &new{2009-01-23 (金) 16:57:07};
- 情報ありがとうございます。[[テストリリース 1.0.0 RC 2c]] に同梱の ffmpeg で反映しました。 -- [[tuck@作者]] &new{2009-02-03 (火) 13:29:37};
- ffmpeg側にバグ報告はしないのでしょうか? http://roundup.ffmpeg.org/roundup/ffmpeg/ -- [[n]] &new{2009-05-29 (金) 10:22:07};
- このページを書いたものですが、本家でも同様のパッチがMLに一応あがってます。
が、本家的にはこれはlameの不具合との認識の模様で、reject されてますので・・・。-- [[golgol]] &new{2009-05-29 (金) 22:21:16};
http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2009-February/019050.html
http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2009-February/018834.html
http://archives.free.net.ph/message/20090218.152308.70d1991b.ja.html
https://roundup.mplayerhq.hu/roundup/ffmpeg/issue803
- そうでしたか。読んだところlame側で既に修正がなされているようですね。 -- [[n]] &new{2009-05-30 (土) 06:55:10};
- 確かに lame の cvs リポジトリの方ではこの問題は直っているようですね。lame の次の公式リリースでは問題なくなると思います。 -- [[golgol]] &new{2009-05-31 (日) 21:24:47};
- 11H32P  <a href="http://upyarjdplolz.com/">upyarjdplolz</a>, [url=http://czmixgcnjcas.com/]czmixgcnjcas[/url], [link=http://untjfrxvspyf.com/]untjfrxvspyf[/link], http://esldwjoosqnj.com/ -- [[bbwytwlf]] &new{2010-04-23 (金) 01:25:23};
- comment4, http://manchester.academia.edu/BuyOxycontin buy oxycontin without prescription,  svmcoe,  -- [[jonn2]] &new{2010-04-23 (金) 05:41:25};
- comment3, http://sitdownshutupwiki.fox.com/account/Acetaminophen buy acetaminophen without prescription,  8921, http://sitdownshutupwiki.fox.com/account/PREDNISOLONE buy prednisolone 5mg without prescription,  0852, http://lwordwiki.sho.com/account/Fastin buy fastin online,  fszjc, http://www.myvouchercodes.co.uk/forum/members/order-percocet/ order percocet,  8-PP, http://www.myvouchercodes.co.uk/forum/members/oxycodone-hci/ buy oxycodone hcl without prescription,  5965,  -- [[jonn1]] &new{2010-04-23 (金) 07:41:29};
- comment3, http://www.jumptags.com/Oxycontin/ buy oxycontin no prescription,  147021, http://www.jumptags.com/reductil/ reductil,  nwyye, http://fringewiki.fox.com/account/BACLOFEN buy baclofen online,  ievqa, http://www.thaivisa.com/forum/Diclofenac-m105236.html buy diclofenac online,  kow, http://www.thaivisa.com/forum/Sumatriptan-m105238.html buy sumatriptan online,  556,  -- [[jonn2]] &new{2010-04-23 (金) 17:02:46};
- ww.abqjournal.com http://helenadion331.tripod.com/objnet.computername.html the online assistant.com  www.facebook.clom http://helenadion331.tripod.com/fleureco-zonnet.nl.html tire warehouse.com  www.free chicken recipes.com http://helenadion331.tripod.com/ronningen-petter-co.html hegre art.com naomi  mrs. winner s fried chicken http://helenadion331.tripod.com/redskins.-com.html npf japan co. ltd  nascar.com logo http://helenadion331.tripod.com/giants-vs.-redskins-nfl.html story argentina asset c.f  st. louis beltran http://helenadion331.tripod.com/promoyional-codes-for-movietickets.com.html card view safe inc  scott trade ft. myers http://helenadion331.tripod.com/www.alpha-int.net.html index lizvicious.mpg  change user server.exe http://helenadion331.tripod.com/st.-louis-mo-casinos.html www.lookatmebitch user  www.cruiseship centres.com http://helenadion331.tripod.com/702daisy.com.html logo.tv  new hampshire meredith u.s.a http://helenadion331.tripod.com/jcpenney.com-codes.html card dynamix inc   -- [[walgreens.com coupon free shipping]] &new{2010-04-24 (土) 05:06:43};
- comment3, http://www.airliners.net/profile/meloxicam buy meloxicam online,  rmez, http://www.airliners.net/profile/percocet percocet no prescription,  jhqj, http://www.skybrary.aero/ipbforums/index.php?showuser=5964 oxycontin no rx,  =-((, http://www.remotecentral.com/cgi-bin/forums/members/viewprofile.cgi?c0hn88 hydrocodone no prescription,  3525, http://www.remotecentral.com/cgi-bin/forums/members/viewprofile.cgi?jinywr buy vicodin no prescription,  55661,  -- [[jonn1]] &new{2010-04-24 (土) 06:08:58};
- comment3, http://medialab.sissa.it/THE/forum/bubbles-forum/266715923 vicodin for sale online,  ikpaxa, http://medialab.sissa.it/THE/forum/bubbles-forum/266715924 vicodin es,  3037, http://www.skybrary.aero/ipbforums/index.php?showuser=5975 oxycodone 5mg,  47603, http://www.wirelessrerc.gatech.edu/SOT/sot-wireless-emergency-communication-forum/thad-starner-wireless-rerc-answers-questions-from-the-audience/294690478 buy norco,  5545, http://www.wirelessrerc.gatech.edu/SOT/sot-wireless-emergency-communication-forum/thad-starner-wireless-rerc-answers-questions-from-the-audience/1118057 buy adderall,  :[[,  -- [[jonn3]] &new{2010-04-24 (土) 21:52:30};
- スパムが激しいためロックします。このページに対する意見などが必要な場合は新規ページを起こしてください -- tuck@作者

#comment
//#comment

トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS