Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Re: Can the fps of -aviwrite output be specified? [Re: floo] #102530 11/09/15 08:48 PM
Joined: May 2011
Posts: 41
S
SoltanGris42 Offline
Member
Offline
Member
S
Joined: May 2011
Posts: 41
Originally Posted By floo
Originally Posted By SoltanGris42
When I use aviwrite on rabbit,


You didn't pay attention. I used rabbit as an example of correct behavior (on current mame), because it runs at exactly 60.0 fps.

Try it on a neogeo game, such as fatal fury special (fatfursp). I have gone through the tedium of dumping the frames of a sample in this game, comparing each one, and I can confirm that there are concurrent frames where the black or blank shadow is repeated. Even though the video samples I posted had already pointed to that.

Here is that sample.


You're right. I wasn't paying attention!

I just looked at Fatal Fury Special with -aviwrite. In a fight, I can see that every 73 frames that there is a duplicate frame. It's not always 73 frames, but it usually is.

Just so we're clear, you're saying that the emulated system isn't actually outputting duplicate frames like that. But instead -aviwrite is duplicating a frame every so often, essentially padding the almost 60fps up to 60fps when writing the avi? Or am I still misunderstanding?

I'm not a dev and can't help fix it. But that doesn't sound like the aviwrite feature is working the way it's supposed to.

Re: Can the fps of -aviwrite output be specified? [Re: floo] #102533 11/10/15 02:20 AM
Joined: Mar 2001
Posts: 16,471
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,471
It's possible he's doing -aviwrite while -vsync'ed to a monitor with a different-from-the-game's framerate. Or he just isn't seeing the duplicated frame when playing. Because regardless of what he thinks he's showing, it is physically impossible for -aviwrite to be anything other than every single frame drawn to the screen by the game in sequence.

ETA: -mt might cause duplicated frames too, but again those will appear on the screen as well.

Last edited by R. Belmont; 11/10/15 02:22 AM.
Re: Can the fps of -aviwrite output be specified? [Re: floo] #102534 11/10/15 02:49 AM
Joined: Jan 2012
Posts: 33
floo Offline OP
Member
OP Offline
Member
Joined: Jan 2012
Posts: 33
So mame captures the monitor refresh rate? I just tried on a 75 fps refresh rate and it still captured 60 fps avi.

Disabling mt made no discernible difference.

Re: Can the fps of -aviwrite output be specified? [Re: SoltanGris42] #102535 11/10/15 02:58 AM
Joined: Jan 2012
Posts: 33
floo Offline OP
Member
OP Offline
Member
Joined: Jan 2012
Posts: 33
Originally Posted By SoltanGris42
Just so we're clear, you're saying that the emulated system isn't actually outputting duplicate frames like that. But instead -aviwrite is duplicating a frame every so often, essentially padding the almost 60fps up to 60fps when writing the avi? Or am I still misunderstanding?


I assume if you run it on a screen that matches the emulated refresh rate, you won't see this effect within the actual emulation. (Things seem to run smooth if you enable cheats and change the emulated refresh rate to that of your monitor) But considering that aviwrite still outputs 60 fps avi if you are running the screen at 75 fps, it's probably just aviwrite feature hard coded to capture at 60 fps. If there is a hope that I could personally dig into the source code to verify it, it would be a year or several. I really don't know with 100% certainty, but if the sound is captured accurately and is in sync, I'm fairly certain that the emulated fps is being "resampled" into 60 fps and the jitter becomes duplicate frames into the avi, as well. If that's true, it's essentially "yes" to your question.

Re: Can the fps of -aviwrite output be specified? [Re: floo] #102543 11/10/15 04:42 PM
Joined: Aug 2015
Posts: 387
Edstrom Offline
Senior Member
Offline
Senior Member
Joined: Aug 2015
Posts: 387
Would it be possible that the post processing of the AVI file somehow inserts the extra frames?

For instance if it do A/V sync using the audio and the audio sample frequency differs with a small amount or just have dropped some data? I have also seen audio buffer that has been repeated since there has been no new data to present.

Do you hear any audio glitches or change in pitch?

Re: Can the fps of -aviwrite output be specified? [Re: Edstrom] #102547 11/11/15 09:39 AM
Joined: Jan 2012
Posts: 33
floo Offline OP
Member
OP Offline
Member
Joined: Jan 2012
Posts: 33
Originally Posted By Edstrom
Do you hear any audio glitches or change in pitch?


Nothing stands out to me when I hear these captures, but I don't have a real neogeo to compare it to.

Re: Can the fps of -aviwrite output be specified? [Re: floo] #102548 11/11/15 11:30 AM
Joined: Aug 2015
Posts: 387
Edstrom Offline
Senior Member
Offline
Senior Member
Joined: Aug 2015
Posts: 387
If the audio is perfect, perfect A/V sync, no glitches and same pitch as the original, but there are extra frames the problem can be related to conversion/capturing of the audio frame rate at same stage. There are a number of audio things that can cause problems

- Up conversion or lack thereof, ie 44.1 -> 48Khz
- Down conversion or lack thereof, ie 48 -> 44.1Khz
- Dropped audio data frames
- Duplicated audio data frames
- Mono -> Stereo conversion and vice versa

Since the game most probably produces PCM I guess it is compressed somewhere down the line. There are also insertion of A/V time stamps into the AVI file that might screw things up. I have also seen problems with a delay between audio and video data that could starve buffers in a conversion stage down he line.

If you can, raise the buffer sizes, otherwise I would print timestamps for audio and video for the old working AVI file and the new one with if possible the exactly same content like the intro or so. You should see a difference that could be a hint.

I am sorry I am not more familiar with the MAME A/V pipe line, these are just some general experience I share.

Last edited by Edstrom; 11/11/15 04:37 PM.
Re: Can the fps of -aviwrite output be specified? [Re: floo] #102549 11/11/15 01:17 PM
Joined: Mar 2001
Posts: 16,471
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,471
MAME does not compress anything going into the AVI file, which is why you need a very fast disk to sustain -writeavi without MAME pausing. For each game frame you get exactly one video frame and exactly (sample rate / game's frame rate) stereo audio samples. No more, no less.

Last edited by R. Belmont; 11/11/15 01:17 PM.
Re: Can the fps of -aviwrite output be specified? [Re: floo] #102551 11/11/15 04:48 PM
Joined: Aug 2015
Posts: 387
Edstrom Offline
Senior Member
Offline
Senior Member
Joined: Aug 2015
Posts: 387
Got it, I think this can also happen in post processing after MAME has produced the AVI format.

Re: Can the fps of -aviwrite output be specified? [Re: floo] #102679 11/20/15 02:38 AM
Joined: Jan 2012
Posts: 33
floo Offline OP
Member
OP Offline
Member
Joined: Jan 2012
Posts: 33
Just for posterity, I'll say that there is a quasi-workaround to get at the very least smooth blending of the shadows as discussed, previously.

First, you need to have cheats enabled. So, you pause mame right at the start of the aviwrite session, then go to slider controls and set the emulated fps to 60.000. From then on, the emulated frames will match what is captured in avi.

Here is the proof.

The thing is that trying to do this with input playback does not work, which is a bummer. If you intend to capture gameplay, you must do it in real time, as it's capturing. This is why I asked a while back about being able to force these slider settings enabled by cheats.

Page 2 of 2 1 2

Moderated by  R. Belmont 

Who's Online Now
4 registered members (shattered, R. Belmont, Sharkpuncher, 1 invisible), 175 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,763
Posts115,160
Members4,889
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3