dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Merged AV Dump

Open CasualPokePlayer opened this issue 2 years ago • 9 comments

WIP merged AV dump, very hacky so far, mostly PoC

I'm not sure how this wants to be proceeded (or if this is exactly wanted), so submitting this as draft for feedback. Worse case I guess is this ends up being AVSync hack unofficial builds.

CasualPokePlayer avatar Jul 06 '22 05:07 CasualPokePlayer

I want Audio/Video in a merged dump. Dunno much about the code quality for it though.

JMC47 avatar Jul 06 '22 05:07 JMC47

what is the desired end result? just "i want a screen recording with audio" or "1:1 pixel + audio dump" ?

if it's the former, you're better off just using the built-in windows recording functionality (in xbox game bar, confusingly). The same underlying api could be used programmatically from within dolphin, although I'm not sure there's much a reason to do so. This gives you hardware-accelerated encoding and outputs to a normal modern format.

shuffle2 avatar Jul 08 '22 00:07 shuffle2

The latter optimally, but most importantly here one which syncs together entirely (hence the need for resampling audio, mainly as nothing actually supports a non-integer sample rate). This would completely resolve issue 12951 along with other audio/video sync issues.

(The main use for something like this also would be for TASVideos encoding publications, they wouldn't be using external video recording software here).

CasualPokePlayer avatar Jul 08 '22 00:07 CasualPokePlayer

To clarify, the reason why TASVideo doesn't use regular external video recording software is because the recording can drop frames, or lag can get recorded if Dolphin isn't running at full speed. Dolphin's frame dumping ensures that the result is consistent regardless of how fast the computer is.

JosJuice avatar Jul 08 '22 15:07 JosJuice

Dolphin generally will be running under full speed in this case anyways, given goodizers will be cranked to the max if possible and generally that drops fps to the single digits.

(Also of course, not everyone has 4K monitors here and the workarounds for that are painful and thankfully reserved for old Dolphin versions)

CasualPokePlayer avatar Jul 08 '22 18:07 CasualPokePlayer

I understand the TAS usecase, which is what I always assumed the frame/audio dumping in dolphin was for (generally, people who want something like "raw data", and not just a quick convenient capture).

@CasualPokePlayer have you tried just using your platform's built-in recording ? it will probably perform better and produce better output for what you want than this PR...

shuffle2 avatar Jul 08 '22 19:07 shuffle2

The main intended use case here is for TASVideos (also to be clear, I am from the TASVideos community). So no platform's built in recording is not going to suffice (unless you somehow have a 4K monitor and a PC able to run Dolphin at full speed 100% of the time with max enhancements).

The separate video/audio dumps generally are OK for this case, however they will cause audio desyncs eventually due to the non-integer sample rate, and video splits (ie resolution change) cause video/audio desyncs due to not adding in duped frames to account for the time between the last frame and the frame where resolution changed.

These could be fixed separately (although the audio thing would need an option here, as I was told by Jos some people may not want the resampling done), however I think the best option here is simply to add a new option to dump a merged A/V dump, which has resampled audio and mixed in audio tracks, thereby giving a "perfect" A/V dump without A/V desyncs.

(Perhaps another thing to do is another option to hard sync video to audio by basing all timing according to emitted samples, though I don't think that should be necessary generally nowadays and has some potential cost to video output)

CasualPokePlayer avatar Jul 08 '22 19:07 CasualPokePlayer

I would really like merged dumps because it's a lot easier for me as well. Not a TASing thing, but for making videos and recording Dolphin in general.

JMC47 avatar Jul 08 '22 19:07 JMC47

if it's the former, you're better off just using the built-in windows recording functionality (in xbox game bar, confusingly).

How to access it? Is it windows only? How is that better than internal dolphin dumping?

vadosnaprimer avatar Jul 08 '22 20:07 vadosnaprimer