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

Smearing border at ogv playback #99154

Closed
andreas-volz opened this issue Nov 13, 2024 · 2 comments
Closed

Smearing border at ogv playback #99154

andreas-volz opened this issue Nov 13, 2024 · 2 comments

Comments

@andreas-volz
Copy link

andreas-volz commented Nov 13, 2024

Tested versions

v4.3.stable.official [77dcf97]

System information

Linux Mint 21 (Vanessa) - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3060 (nvidia; 535.183.01) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)

Issue description

I convert a video file to ogv and play in a godot VideoStreamPlayer. It seems to work, but the borders of the video are smearing at the border. It may be a encoder specific issue as I don't have this problem with other videos.

Steps to reproduce

ffmpeg -y -i <file.smk> -codec:v libtheora -qscale:v 31 -codec:a libvorbis -qscale:a 15 -pix_fmt yuv420p <out.ogv>

Minimal reproduction project (MRP)

only the video. just put into a new project and load into a VideoStreamPlayer
nlcfid00.ogv.zip

screenshot broken in Godot:
image

screenshot ok in video player application:
image

I made more research and found two things:

  1. it seems the minimal automatic detected size in VideoStreamPlayer is 64x64 (real video size is 60x56).
  2. even if I encode and scale a (similar) video it detects wrong size: fmpeg -y -i tscfid02.smk -vf scale=120:112 -codec:v libtheora -codec:a libvorbis -pix_fmt yuv420p tscfid02.ogv
    godot size detection is 128x112.
@andreas-volz
Copy link
Author

andreas-volz commented Nov 13, 2024

I would start to search at this place:

w = ((ti.pic_x + ti.frame_width + 1) & ~1) - (ti.pic_x & ~1);

	int w;
	int h;
	w = ((ti.pic_x + ti.frame_width + 1) & ~1) - (ti.pic_x & ~1);
	h = ((ti.pic_y + ti.frame_height + 1) & ~1) - (ti.pic_y & ~1);
	size.x = w;
	size.y = h;

But I've no setup for compiling and debugging Godot. I hope someone else with more knowledge starts with debugging until I find the time to setup a workspace.

Until I find a solution I'll workaround by padding some pixels and put a UI frame in front:
ffmpeg -y -i tscfid02.smk -vf "pad=width=64:height=64:x=2:y=4:color=black" -codec:v libtheora -codec:a libvorbis -pix_fmt yuv420p tscfid02.ogv

@Calinou
Copy link
Member

Calinou commented Nov 14, 2024

Thanks for the report! Consolidating in #62752.

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

No branches or pull requests

2 participants