0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

QuickTime Player 10 動画再生で特定区間が遅くなる件

Last updated at Posted at 2024-05-27

こちらの記事を真似して FFmpeg の show 系で遊んでいたら、妙に長い動画に変換されました。

shell
% ffmpeg -i input.wav -filter_complex "\
    [0:a]showspectrum=s=320x100,pad=320:180[vs]; \
    [0:a]showwaves=s=320x80[sw]; \
    [vs][sw]overlay=0:H-h[out]" \
    -map "[out]" -map 0:a output.mp4
input.wav output.mp4
スクリーンショット 2024-05-28 1.49.58.png スクリーンショット 2024-05-28 1.50.02.png

35分32秒 が 3時間29分39 に増えてます。
また、再生ゲージの下に見た事のないゲージが増えていて、そのゲージの区間だけ再生がとても遅くなります。
全体時間はこの遅くなった分だけ増加しているようです。なお、このゲージの間隔を 0 にすれば普通に再生します。

ブラウザの video タグで再生しても 35分32秒で再生しますし、ffplay でも同じくです。
どうやら、QuickTime Player の特殊事情のようです。

アドバイス

神よ。。。

このコマンドだと確かに問題なくなります。

なるほど fps 、と思って自分の作った動画をよくよく見ると、巨大な fps 値です。

shell
% ffmpeg -i output.mp4
(略)
  Duration: 00:35:32.51, start: 0.000000, bitrate: 353 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 320x180 [SAR 1:1 DAR 16:9], 196 kb/s, 240 fps, 240 tbr, 15360 tbn (default)

240 fps !!??

先の変換コマンドだとデフォルトでこの 240 fps になるようです。

調査

25 - 240 の間で二分探索して問題の発生する閾値を調べました。

25 - 240 => 100 => 200 => 150 => 125 => 110 => 105 => 104

% ffmpeg -y -i input.wav -filter_complex  " \
    [0:a]showspectrum=s=320x100:fps=104,pad=320:180[vs]; \
    [0:a]showwaves=s=320x80[sw]; \
    [vs][sw]overlay=0:H-h[out]" \
    -map "[out]" -map 0:a output104.mp4
% ffmpeg -y -i input.wav -filter_complex  " \
    [0:a]showspectrum=s=320x100:fps=105,pad=320:180[vs]; \
    [0:a]showwaves=s=320x80[sw]; \
    [vs][sw]overlay=0:H-h[out]" \
    -map "[out]" -map 0:a output104.mp4
output104.mp4 output105.mp4
スクリーンショット 2024-05-27 0.27.55.png スクリーンショット 2024-05-27 0.27.47.png

fps:104 までセーフ。fps:105 から QuickTime Player の挙動がおかしくなります。

備考

もしかしたら、メタデータの解釈が ffmpeg と QuickTime Player で異なるのではと、ffmpeg の metadata を消すコマンドを試したり、バイナリ編集で udta を削ったりして、解決しませんでした。

どなたかヒントを頂けないでしょうか。_:(´ཀ`」 ∠):

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?