Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ドロップログ上のパケット数が m2ts ファイル上での実際の数よりも少ない #603

Open
yuta2k opened this issue Jun 6, 2022 · 1 comment
Labels

Comments

@yuta2k
Copy link

yuta2k commented Jun 6, 2022

環境

  • Version of EPGStation: 2.6.20
  • Version of Mirakurun: 3.9.0-rc.2
  • Version of Node: 16.13.1
  • Version of NPM: 8.1.2
  • OS(ホスト): Linux (Debian Bullseye) #1 SMP Debian 5.10.113-1 (2022-04-29)
  • Architecture: x64

docker-mirakurun-epgstation v2 の上で動かしています。

Issue

録画時にドロップログへ出力されるパケット数が、m2ts ファイル上での実際のパケット数よりも常に少なくなります。
実用上大きな問題にはなりませんが、可能であれば整合させたいです。

確認方法

  1. config.ymlisEnabledDropCheck: true を追記
  2. 録画
  3. 以下のいずれかの方法で m2ts ファイルの (PID 別の) 実際のパケット数を調べる
  4. ドロップログと比較 (パケットの多い映像系の PID が顕著)
  • node-aribts をチェックアウトし node sample/check_packet.js /path/to/m2ts
  • Multi2Dec の「TSエラーチェック」
  • EpgStation の DropCheckerModel の処理を既存の m2ts ファイルに対して実行
    こちらのフォークしたリポジトリ・ブランチにて
    https://github.com/yuta2k/EPGStation/tree/feature-drop-check
    npm i
    npm run build-server
    npm run drop-check /path/to/m2ts
    

原因と思われる箇所

RecorderModel にて RecorderModel#recFile への pipe (= m2ts ファイルの書き出しの開始) から

this.stream.pipe(this.recFile);

DropCheckerModel#start の呼び出しまでの間に流れたパケットが取りこぼされているものと推測します。
await this.dropChecker.start(this.config.dropLog, recPath.fullPath, this.stream);

良い方法が思いつかなかったですが、試しに一旦 stream.PassThrough を介するようにして RecorderModel#recFileDropCheckerModel へ完全に同じパケットが流れるようにすると、ドロップログ上に正確なパケット数が書き出されるようになりました。

そのまま使うには色々甘いと思いますが、こちらのブランチにて確認可能です。
master...yuta2k:eval-droplog-correction

@yuta2k
Copy link
Author

yuta2k commented Jan 22, 2023

新しく issue を建てるべきか悩ましいところですが recordingFinishCommand の実行時に ERROR_CNT1 で渡され、ドロップログにも

error: (pid: 0x1A1C, counter: -, expected: -, time: -)
pid: 0x1A1C, error: 1, drop: 0, scrambling: 0, packet: 1, name: -

などが残ることが週数回あります。
(PID は毎回異なる?)

上記フォーク・ブランチによる後からのドロップチェックでは問題ないことから、本 issue の範囲で何か原因があるのではと推測しています。

@l3tnun l3tnun added the bug label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants