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

AVI output in DirectX9 Alt blitter, with HardFX shaders outputs glitchy video. #1938

Open
ilker2495 opened this issue Jan 22, 2025 · 14 comments

Comments

@ilker2495
Copy link

On FBNeo latest version (nightly at the time of writing), when running -for example- ddpdojblk, in DirectX9 Alt blitter and with HardFX ("CRT Standard" in this case), gameplay on my screen looks perfectly fine while the AVI output is garbled. I am linking the video re-encoded into .mp4 for upload reasons, but the glitchy appearence is the same: https://0x0.st/8H75.mp4
I got my shaders from the FBNeo_Shaders repository made by "林润锋", and they work well. However there's this issue when outputting to AVI.

@barbudreadmon
Copy link
Collaborator

Does it happen with official shaders from https://neo-source.com/index.php?topic=4067.msg35928#msg35928 ?

Could you provide a link for downloading your shaders ?

@ilker2495
Copy link
Author

As a matter of fact, it does. Also, I forgot to mention because it was the default option after all, but I'm using the Intel IYUV codec, Microsoft AVI does output a less glitched video but it's still oddly squashed/stretched.
In my previous report I was using these https://github.com/lrf739146825/FBNeo_Shaders shaders, the outputs of both ended up being basically the same so I won't include another video here.
It's not a huge issue (I'd rather rely on an external program to record gameplay anyways) but I thought it was worth documenting for other people facing the same problems. Thanks for your time.

@barbudreadmon
Copy link
Collaborator

barbudreadmon commented Jan 24, 2025

I booted up that windows i never use to test this and only raw video seems to work, it doesn't even seem related to blitter/shader usage.

Is this recording component even something internal to FBNeo ? Somehow it's translated to my native language while the FBNeo UI is in english and i have no FBNeo language pack installed.

I'm not familiar at all with this stuff, maybe @dinkc64 or someone else will be able to help.

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 25, 2025

I'm going to get to this very soon, thanks for the bug report :)
There's another bug in the avi writer that needs attending to as well, I just need to finish a project that's taking (too much of) my attention.. :)

best regards,

  • dink

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 26, 2025

@ilker2495
Which encoder are you using? I'm using x264vfw with the avi writer and ddpdojblk, and it makes a perfect avi.
It was recorded while using HardFX "CRT CGA" shader,

In-case it helps, here's my x264vfw config screen:

Image

here's the avi, zipped, that my fbneo created:

ddpdojblk-01-25-201636_0.zip

Could you zip and attach your fbneo's ini file (config/fbneo.ini, usually)? Maybe it will help lead me to the problem. Also let me see a screencap of your x264vfw encoder settings screen.

best regards,

  • dink

@ilker2495
Copy link
Author

Of course! In the .zip is my config. I don't have the configuration screen that you do... All I get are these:

Image

Image

Config .zip:
fbneo64.zip

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 26, 2025

Oh! In that case, do grab x264vfw, install it and try with that codec instead :)

https://sourceforge.net/projects/x264vfw/files/latest/download

best regards,

  • dink

@barbudreadmon
Copy link
Collaborator

@dinkc64 Is there a way to remove the codecs that don't work from the list ? Or do they actually work on your side ? Is that list a windows thingy that can't be modified ?

@ilker2495
Copy link
Author

ilker2495 commented Jan 26, 2025

@dinkc64 The codec you have linked produces very similar results to the Microsoft AVI codec, in the sense that the video is oddly squashed. I have zipped a (terrible) 20 seconds of gameplay of ddpdojblk (I manage to drop chain even here somehow). Other things of interest are 1.) a very noticable audio desync and 2.) the shaders being completely missing from the final picture. For testing purposes I have also used the same HardFX "CRT CGA" shader that you used on your side.

out.zip

Edit: I am sorry, I just noticed that in the .avi you linked, these "issues" are also present :) So my guess is that this is intended behaviour?

Edit 2: I apologize to be constantly re-editing this reply but here is what a "fixed" version of your .avi would look like. I determined the video was in 1:2 instead of 3:4 as it should be, and there is a 60 frame audio delay. The command I ran was:

ffmpeg -i ddpdojblk-01-25-201636_0.avi -af "adelay=1000|1000" -vf "scale=672:896,setsar=1:1" fixed.avi

And the fixed .avi video:

fixed.zip

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 26, 2025

barbudreadmon, afaik the os displays that list.

@ilker2495 we just present the video to the video encoder just like we present the video to the blitter (video device),
so things like aspect correction will have to be handled with ffmpeg, unless someone comes up with some good code to resample it.
So, the shader tells the gpu to add the effects to the video output, so that doesn't get captured by the avi writer. For that, you might want to use something like OBS to record directly from the screen. But yea, I realize the avi writer stuff isn't adequate, but, I'm not very good at video or UI stuff. Sound & emulation is more my thing.

best regards,

  • dink

@barbudreadmon
Copy link
Collaborator

barbudreadmon commented Jan 27, 2025

Edit 2: I apologize to be constantly re-editing this reply but here is what a "fixed" version of your .avi would look like. I determined the video was in 1:2 instead of 3:4 as it should be, and there is a 60 frame audio delay. The command I ran was:

Aspect ratio isn't used by the avi recorder, meaning the pixels are square (DAR width:height or PAR 1:1, as you prefer). I believe that's intended.
ddpdojblk is 224x448 which indeed gives a DAR of 1:2.

I'm not too sure about the audio delay, i can't find an explanation from the code.

@ilker2495
Copy link
Author

Thank you both for the explanation. To be honest I probably should have checked pixel aspect ratio with ffprobe while I was at it. What you say is totally accurate. Fiddling with settings and I couldn't get rid of the audio delay, so I will be using something like OBS in the meanwhile. For everyone else, I suppose -af "adelay=1000|1000" -c:v copy in ffmpeg should be a fast and simple command to remedy it, as the 1 second delay is already filled with silence from what I can tell.

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 27, 2025

I swear, this 1 second audio delay was never there before - maybe its a new bug? grr.. :)

@dinkc64
Copy link
Collaborator

dinkc64 commented Jan 27, 2025

I found the problem, a few months back I was experimenting with x264vfw settings, and I goofed something up. Here's the proper settings for x264vfw that should get rid of the delay:

Image

I also updated the other post where I posted a similar settings screen, to avoid confusing any onlookers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants