unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 240 forks source link

Playback rendering frames at incorrect dimensions #495

Closed KennethWhite closed 3 years ago

KennethWhite commented 4 years ago

Playback rendering frames at incorrect dimensions

When using the library we noticed a video with dimensions 204x360 (WxH) was having its frames displayed at 200x360. Debugging through pertinent areas like VideoComponent.MaterializeFrame() or VideoRenderer shows the dimensions on the frames and bitmaps being generated are 204x360 as expected, snoop shows the image in the model as 204x360, but the actual on-screen physical pixel dimension is 200x360.

We also tested this against the sample WPF application, VLC, and FFplay. In the sample app the resolution appears to be scaled up, but the video plays back at 400x720 as opposed to an expected 408x720 (17/30 aspect ratio). In comparison when played through FFplay and VLC we see the video rendered at the correct dimensions 204x360.

This is reproducible by trimming down other video files to the same dimensions.

Issue Categories

Version Information

Steps to Reproduce

  1. Play the attached video file in the Unosquare.FFME.Windows.Sample application
  2. Measure the physical on-screen image dimensions with a tool of your choice, e.g. SnagIt
  3. Compare the measured dimensions with the dimensions on either the VideoFrame object in the code behind, or the image dimensions in Snoop.

Unosquare.FFME.Windows.Sample player image

Expected Results

VLC Media Player image

FFplay Media Player image

Command line ffplay

Version information

❯ffplay.exe -version
ffplay version git-2020-03-15-c467328 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20200122
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil      56. 42.100 / 56. 42.100
libavcodec     58. 75.100 / 58. 75.100
libavformat    58. 41.100 / 58. 41.100
libavdevice    58.  9.103 / 58.  9.103
libavfilter     7. 77.100 /  7. 77.100
libswscale      5.  6.101 /  5.  6.101
libswresample   3.  6.100 /  3.  6.100
libpostproc    55.  6.100 / 55.  6.100

Example invocation

ffplay.exe "C:\Users\<User>\Videos\204x360.mp4"
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

KennethWhite commented 4 years ago

This still remains an issue, simply fighting the Stale Bot.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mariodivece commented 4 years ago

My apologies for sucha late response @KennethWhite will the PR #493 fix this? if so let me know so I can close this issue.

KennethWhite commented 4 years ago

Unfortunately the changes in #493 do not fix this issue here. I had spent some time digging to see what was causing this but never tracked down the exact cause.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.