murkland / tango-legacy

last generation rollback netplay for mega man battle network / 前世代のロックマンエグゼのロールバックネットプレイ
GNU Affero General Public License v3.0
3 stars 0 forks source link

Add frame dumping to replayviewer. #49

Open luckytyphlosion opened 2 years ago

luckytyphlosion commented 2 years ago

Article explaining pros and cons of using libavcodec vs ffmpeg image2pipe: https://www.drmaciver.com/2010/12/reading-video-frame-by-frame-with-ffmpeg/

Probably just pipe in video and audio data. Two options:

  1. Encode both video and audio at the same time using named pipes ( https://stackoverflow.com/questions/37078099/best-way-to-pipe-audio-and-video-chunks-from-within-python-to-ffmpeg )
  2. Encode video with a single pipe, store audio in a separate buffer, then encode audio once replay has finished (no concrete example, might not even be easier because you would still need to create a pipe using the Windows API)
luckytyphlosion commented 2 years ago

Bonus feature: synced double replays ( https://youtu.be/jM02XE4A-_E?t=8851 )

Also maybe build a minimal FFmpeg executable which only has the necessary codecs for what bbn6 will do? Pre-built binary releases are ~76MB.

Also should have support to dump frames at unlimited speed (which nearly all emulators support).

bigfarts commented 2 years ago

https://pkg.go.dev/github.com/Microsoft/go-winio has support for named pipes, it seems (on posix just syscall.Mkfifo would work fine)