godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.56k stars 21.27k forks source link

Godot doesn't crop 8-pixel overscan area when playing Ogg Theora video #62752

Open Calinou opened 2 years ago

Calinou commented 2 years ago

Godot version

3.4.4, 3.5.rc5, 4.0.alpha11

System information

Fedora 36, GeForce GTX 1080 (NVIDIA 510.68.02)

Issue description

Godot doesn't crop the 8-pixel overscan area at the bottom when playing an Ogg Theora video in a VideoStreamPlayer node (VideoPlayer in 3.x). This is most noticeable when the video plays, rather than when it's paused, so I recommend trying out the MRP locally if you can't notice the issue on the screenshots.

Notice how the last 8 rows of pixels are duplicated in Godot, but not in mpv:

Screenshot from Godot (bad)

Cropped to show only the video area (896×512).

image

image

Screenshot from mpv (good)

896×504.

image

image

This happens even if I re-encode the video using FFmpeg using ffmpeg -i Big_Buck_Bunny_medium.ogv bb.ogv.

ffprobe information (on original video file)

[ogg @ 0x55c00d5965c0] Broken file, keyframe not correctly marked.
Input #0, ogg, from '/tmp/test_ogg_theora/Big_Buck_Bunny_medium.ogv':
  Duration: 00:09:56.47, start: 0.000000, bitrate: 1317 kb/s
  Stream #0:0: Data: none
  Stream #0:1: Video: theora, yuv420p, 896x504, 24 tbr, 24 tbn
    Metadata:
      ENCODER         : ffmpeg2theora-0.25
      SOURCE_OSHASH   : cc9e38e85baf7573
  Stream #0:2: Audio: vorbis, 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      ENCODER         : ffmpeg2theora-0.25
      SOURCE_OSHASH   : cc9e38e85baf7573
Unsupported codec with id 0 for input stream 0

Steps to reproduce

Minimal reproduction project

N/A (previous link has expired)

Narotiza commented 1 year ago

i believe i ran into this issue in 4.2.dev5, with 12 extra pixels on the bottom and right sides. Cropping the video to its original resolution using a parent Control node with Clip Contents enabled seems to be a good workaround though.

SliverWorm commented 1 year ago

I also encountered similar problems. My godot version is 4.1.1. The right and bottom sides of my video in godot are blurry.Here are my ffmpeg command: ffmpeg -i xx.mp4 -q:v 10 -q:a 10 xx.ogv. I have recorded the video using mkv format, and then using ffmpeg: ffmpeg -i xx.mkv -q:v 10 -q:a 10 xx.ogv.Amazingly, there are no issues with the ogv video anymore.

olivergs commented 7 months ago

I have this problem in 4.2.1.

Used ffmpeg -i input.mp4 -c:v libtheora -q:v 7 output.ogv

bs commented 6 months ago

This got me when playing a fullscreen video @ 1920x1080 in 4.2.2, and the VideoStreamPlayer and parent AspectRationContainer take a forced transform of size: 1920x1088.