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

FFmpegDemuxer: av_read_frame(): End of file #72

Open
gilbahat opened this issue Feb 28, 2020 · 6 comments
Open

FFmpegDemuxer: av_read_frame(): End of file #72

gilbahat opened this issue Feb 28, 2020 · 6 comments
Labels

Comments

@gilbahat
Copy link

Hi,

so, MojoVideoDecoder barfs on most videos on my system. it works occasionally but mostly doesn't. this is the key symptom, as it appears in the media_internals:

00:00:00.360 info "Selected MojoVideoDecoder for video decoding, config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [640,360], visible rect: [0,0,640,360], natural size: [640,360], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT470BG, transfer:GAMMA28, matrix:BT470BG, range:LIMITED}"
00:00:00.361 pipeline_state "kPlaying"
00:00:00.420 debug "FFmpegDemuxer: av_read_frame(): End of file"
00:00:01.956 error "VDA Error 4"
00:00:01.966 warning "video fallback to new decoder after initial decode error."
00:00:01.984 kIsVideoDecryptingDemuxerStream false
00:00:01.984 kVideoDecoderName "FFmpegVideoDecoder"
(...)

vdpau info:

display: :1 screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library 340.108 Wed Dec 11 14:31:24 PST 2019

Video surface:

name width height types

420 4096 4096 NV12 YV12
422 4096 4096 UYVY YUYV

Decoder capabilities:

name level macbs width height

MPEG1 0 8192 2048 2048
MPEG2_SIMPLE 3 8192 2048 2048
MPEG2_MAIN 3 8192 2048 2048
H264_BASELINE --- not supported ---
H264_MAIN 41 8190 2032 2048
H264_HIGH 41 8190 2032 2048
VC1_SIMPLE 1 8190 2048 2048
VC1_MAIN 2 8190 2048 2048
VC1_ADVANCED 4 8190 2048 2048
MPEG4_PART2_SP --- not supported ---
MPEG4_PART2_ASP --- not supported ---
DIVX4_QMOBILE --- not supported ---
DIVX4_MOBILE --- not supported ---
DIVX4_HOME_THEATER --- not supported ---
DIVX4_HD_1080P --- not supported ---
DIVX5_QMOBILE --- not supported ---
DIVX5_MOBILE --- not supported ---
DIVX5_HOME_THEATER --- not supported ---
DIVX5_HD_1080P --- not supported ---
H264_CONSTRAINED_BASELINE --- not supported ---
H264_EXTENDED --- not supported ---
H264_PROGRESSIVE_HIGH --- not supported ---
H264_CONSTRAINED_HIGH --- not supported ---
H264_HIGH_444_PREDICTIVE --- not supported ---
HEVC_MAIN --- not supported ---
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---

Output surface:

name width height nat types

B8G8R8A8 8192 8192 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
R10G10B10A2 8192 8192 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8

Bitmap surface:

name width height

B8G8R8A8 8192 8192
R8G8B8A8 8192 8192
R10G10B10A2 8192 8192
B10G10R10A2 8192 8192
A8 8192 8192

Video mixer:

feature name sup

DEINTERLACE_TEMPORAL y
DEINTERLACE_TEMPORAL_SPATIAL y
INVERSE_TELECINE y
NOISE_REDUCTION y
SHARPNESS y
LUMA_KEY y
HIGH QUALITY SCALING - L1 -
HIGH QUALITY SCALING - L2 -
HIGH QUALITY SCALING - L3 -
HIGH QUALITY SCALING - L4 -
HIGH QUALITY SCALING - L5 -
HIGH QUALITY SCALING - L6 -
HIGH QUALITY SCALING - L7 -
HIGH QUALITY SCALING - L8 -
HIGH QUALITY SCALING - L9 -

parameter name sup min max

VIDEO_SURFACE_WIDTH y 1 4096
VIDEO_SURFACE_HEIGHT y 1 4096
CHROMA_TYPE y
LAYERS y 0 4

attribute name sup min max

BACKGROUND_COLOR y
CSC_MATRIX y
NOISE_REDUCTION_LEVEL y 0.00 1.00
SHARPNESS_LEVEL y -1.00 1.00
LUMA_KEY_MIN_LUMA y
LUMA_KEY_MAX_LUMA y

vaapi info:
vainfo: VA-API version: 1.5 (libva 2.5.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
libva info: VA-API version 1.5.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_2
libva info: va_openDriver() returns 0

the driver version is 340.108 (the last supported by this card)
01:00.0 VGA compatible controller: NVIDIA Corporation C79 [ION] (rev b1)

@saiarcot895
Copy link
Owner

What's the output when running chromium as chromium-browser --enable-logging=stderr --log-level=0 --vmodule=vaapi_wrapper=4,vaapi_video_decode_accelerator=4?

@gilbahat
Copy link
Author

Here are the relevant error messages imho, but you will find the full log files attached as well:

[3526:3526:0318/141641.866014:ERROR:vaapi_wrapper.cc(1748)] vaPutSurface failed, VA error: operation failed
[3526:4122:0318/141641.866988:VERBOSE1:vaapi_wrapper.cc(1649)] vaCreateBuffer
[3526:4122:0318/141641.867560:VERBOSE1:vaapi_wrapper.cc(1649)] vaCreateBuffer
[3526:4122:0318/141641.868037:VERBOSE1:vaapi_wrapper.cc(1649)] vaCreateBuffer
[3542:14:0318/141641.868057:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

and in tandem:

Failed to create dedicated X11 display!
vdpau_video: VdpOutputSurfaceCreate(): status 23: The system does not have enough resources to complete the requested operation at this time.
vdpau_video: vaTerminate(): output ID 0x05000000 is still allocated, destroying
vdpau_video: vaTerminate(): output ID 0x05000003 is still allocated, destroying
vdpau_video: vaTerminate(): surface ID 0x03000000 is still allocated, destroying
vdpau_video: vaTerminate(): surface ID 0x03000001 is still allocated, destroying
vdpau_video: vaTerminate(): surface ID 0x03000004 is still allocated, destroying
vdpau_video: vaTerminate(): surface ID 0x03000005 is still allocated, destroying
vdpau_video: vaTerminate(): surface ID 0x03000006 is still allocated, destroying
vdpau_video: vaTerminate(): mixer ID 0x09000000 is still allocated, destroying

software that works directly with vdpau such as kodi 18.6 leia does work with accelerated video at these resolutions (720p/1080p), perhaps this is a limitation or problem of the vdpau-vaapi bridge.

log2.log
log.log

@saiarcot895
Copy link
Owner

vdpau_video: VdpOutputSurfaceCreate(): status 23: The system does not have enough resources to complete the requested operation at this time.

Any chance the GPU is running out of memory?

@gilbahat
Copy link
Author

well, yes and no:
It might be actually out of memory, but that would simply mean that vaapi bridge is extremely wasteful with GPU memory in some way as the system is demonstrably capable of processing 720p with vdpau per se.

How would I know if the GPU really ran out of memory or if that is an error masking another error condition?

@saiarcot895
Copy link
Owner

For Nvidia GPUs, nvidia-smi is available to print out how much GPU memory each process is using. But assuming nothing else is significantly using GPU memory, something somewhere isn't freeing the memory that was allocated.

@gilbahat
Copy link
Author

gilbahat commented Mar 25, 2020

I will do my best to check that. the software that did successfully play back videos was kodi. perhaps chromium itself takes GPU memory chunks or kodi overtakes other environment parts (compiz?) and disables them while testing with chromium would. I should have a report in a few minutes.

(edit: concatenating research details and erasing follow-up comment):

this is indeed an out-of-memory situation. increasing memory has enabled chromium to play back higher resolution streams.
however, comparing memory consumption with kodi shows little to no vram consumption when using 'straight up' vdpau. is this a limitation/design choice for mojo, perhaps relating to how buffering is handled?
if this is tweakable from within chromium, perhaps it is better to reduce the buffer size and not fault VDA entirely

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

No branches or pull requests

2 participants