現実モデリング

データとかエンジニアリングとか健エミュとか

VRChatで動画プレイヤーが再生できないエラーに対応する

概要

  • 2025年4月、筆者の手元でVRChat上で動画プレイヤーが突然再生できなくなる事象が発生した。
  • YouTube側のBot判定により、YouTubeがyt-dlpによるアクセスをブロックし、ログインを要求したことが直接的な原因である
  • Windowsのファイアウォール設定にルールを追加してBot判定が行われる状況を回避し、動画を再生できる状態まで復元できた

自分用に対処法をメモしておく。

何が起こったか

2025年の4月のある日、動画再生ギミックのあるワールドに入ったら、動画が聞こえなくなった。昨日は再生できていたので、何もしていないのに壊れたことになる。いろいろなワールドで調べてみたが、どうやらすべてで発生している。Twitterを観る感じ、他にも同様のエラーに遭遇したユーザーさんがいるらしい。というわけで早速調査してみる。

ログをみる

まずは「設定 > デバッグ情報 > ログフォルダーを開く」からログを見てみる。エラー発生時のログが記載されていた。

2025.04.28 14:45:24 Debug      -  NativeProcess.HasExited: process exited with code 1, took 1781 ms. Command line: C:/Users/sora3/AppData/LocalLow/VRChat/VRChat\Tools/yt-dlp.exe (...)
2025.04.28 14:45:24 Warning    -  [Video Playback] ERROR: [youtube] jfKfPfyJRdk: Sign in to confirm you�fre not a bot. Use --cookies-from-browser or --cookies for the authentication. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies. Also see  https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies  for tips on effectively exporting YouTube cookies
2025.04.28 14:45:24 Debug      -  [Video Playback] URL 'https://www.youtube.com/watch?v=jfKfPfyJRdk' resolved to 'https://www.youtube.com/watch?v=jfKfPfyJRdk'
2025.04.28 14:45:24 Debug      -  [AVProVideo] Opening https://www.youtube.com/watch?v=jfKfPfyJRdk (offset 0) with API MediaFoundation
2025.04.28 14:45:26 Debug      -  Setting Target Color to: 3
2025.04.28 14:45:26 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 14:45:26 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=jfKfPfyJRdk
2025.04.28 14:45:29 Debug      -  Setting Target Color to: 4
2025.04.28 14:45:31 Debug      -  [<color=#9C6994>USharpVideo</color>] Retrying load
2025.04.28 14:45:31 Debug      -  [Video Playback] Attempting to resolve URL 'https://www.youtube.com/watch?v=jfKfPfyJRdk'
2025.04.28 14:45:31 Debug      -  NativeProcess.Start: started process id [28348]: C:/Users/sora3/AppData/LocalLow/VRChat/VRChat\Tools/yt-dlp.exe (...)
2025.04.28 14:45:32 Debug      -  Setting Target Color to: 5

### ここからが本質
2025.04.28 14:45:33 Debug      -  NativeProcess.HasExited: process exited with code 1, took 1662 ms. Command line: C:/Users/sora3/AppData/LocalLow/VRChat/VRChat\Tools/yt-dlp.exe (...)
2025.04.28 14:45:33 Warning    -  [Video Playback] ERROR: [youtube] jfKfPfyJRdk: Sign in to confirm you�fre not a bot. Use --cookies-from-browser or --cookies for the authentication. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies. Also see  https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies  for tips on effectively exporting YouTube cookies
###

2025.04.28 14:45:33 Debug      -  [Video Playback] URL 'https://www.youtube.com/watch?v=jfKfPfyJRdk' resolved to 'https://www.youtube.com/watch?v=jfKfPfyJRdk'
2025.04.28 14:45:33 Debug      -  [AVProVideo] Opening https://www.youtube.com/watch?v=jfKfPfyJRdk (offset 0) with API MediaFoundation
2025.04.28 14:45:33 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 14:45:33 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=jfKfPfyJRdk

つまり、ログを読むと

  • yt-dlpがYouTubeにアクセスする際、YouTube側にBotとして認識されているらしい
  • Botではないことを証明するためにログインが必要になっているとのこと
  • 実際、ChromeのシークレットモードでYoutubeにアクセスすると「Botではないことを確認するためログインして下さい」と表示されていた

突然現れた挙動なので、原因としては以下の二つのうちどちらか(あるいは両方)だと思われる。

  1. 同一のグローバルIPを持つ回線につながった誰かが変なことをやった
  2. YouTube側のBotの判定が急にシビアになった

原因の追究は脇においておき、ここでネットで調べてみると、以下のようなツイートが見つかった。

つまり、上記事象はIPv6のIPアドレスでwww.youtube.comの名前解決を行った際に見られる事象らしい。この仮説を裏付けるため、ひとまず現在利用しているネットワークアダプターのIPv6を無効化してみる。しっかり動画が表示されることを確認した。

マジでこのツイートがなかったら一生詰まっていたと思います。ツイ主さんに本当に感謝...

ただし、この状態だとすべての動作でIPv6が利用できなくなってしまってよろしくないので、ツイ主さんが追記した以下の方法を試してみる。

コマンドプロンプトを管理者権限で起動し、以下コマンドでファイアウォールにルールを追加してみる

netsh advfirewall firewall add rule name="Block IPv6 Range 2404:6800:4004::/48" dir=out action=block remoteip=2404:6800:4004::/48 profile=any
  • 諸々試行錯誤した後に上記コマンドを実行すると、なぜかコマンドが実行できなかった
  • Windowsをチェックポイントから復元させて再度実行した
  • 正常に実行でき、ファイアウォールにルールが追加されたことを確認した

Windowsのコマンドプロンプトは本当に覚えられないので、ChatGPTに聞いてコマンドをひねり出す。

ファイアウォールにルールを追加した後、Chromeのシークレットウィンドウから、ログイン不要で動画が見れることを確認した

Image from Gyazo

一方、VRChatのエラーはまだ発生しているし、当然動画も見れていない。エラーログは以下の通り:

2025.04.28 16:55:07 Error      -  [<color=#FF00FF>USharpVideo</color>] Video 'https://www.youtube.com/watch?v=jfKfPfyJRdk' failed to play with error Unknown
2025.04.28 16:57:29 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:57:29 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=jfKfPfyJRdk
2025.04.28 16:57:35 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:57:35 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=jfKfPfyJRdk
2025.04.28 16:57:46 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:57:46 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=VHxeuLf_eRs
2025.04.28 16:57:52 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:57:52 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=VHxeuLf_eRs
2025.04.28 16:57:59 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:57:59 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=VHxeuLf_eRs
2025.04.28 16:58:05 Error      -  [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
2025.04.28 16:58:05 Error      -  [<color=#FF00FF>USharpVideo</color>] Video player error when trying to load https://www.youtube.com/watch?v=VHxeuLf_eRs
2025.04.28 16:58:10 Error      -  [<color=#FF00FF>USharpVideo</color>] Video 'https://www.youtube.com/watch?v=VHxeuLf_eRs' failed to play with error Unknown

もしかしたら、yt-dltのコンフィグが残っていたのが原因かもしれない

  • 以下のツイートを参考にyt-dlpのコンフィグをいじっていた
  • yt-dlp.exeと同一のフォルダに配置されていたyt-dlp.confを削除してみる
  • 削除して再度VRChatにログインし、動画再生ができることを確認した。

解消から一週間ほど経過したが、まだ再生はできている。めでたし...となるのだろうか。IPv4の方もBot判定くらったら、この記事で書いた回避策も無効化されてしまうのではないだろうか。その時はその時か。