intel / vpl-gpu-rt

MIT License
109 stars 92 forks source link

[Bug]: ffmpeg #348

Open GeorgeZaher opened 1 month ago

GeorgeZaher commented 1 month ago

Which component impacted?

Decode, Encode

Is it regression? Good in old configuration?

No, this issue exist a long time

What happened?

unable to decode/encode a file

What's the usage scenario when you are seeing the problem?

Others

What impacted?

No response

Debug Information

(base) ubuntu@DESKTOP-NDGNCJ5:/mnt/c/Users/ASUS Vivobook$ cd ffmpeg-1/ (base) ubuntu@DESKTOP-NDGNCJ5:/mnt/c/Users/ASUS Vivobook/ffmpeg-1$ sudo ./ffmpeg_g -c:v h264_qsv -i ../Downloads/TheaterSquare_854x480.mp4 o.mp4 ffmpeg version N-113426-g24cd178330 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --enable-libvpl --disable-x86asm libavutil 58. 36.101 / 58. 36.101 libavcodec 60. 38.100 / 60. 38.100 libavformat 60. 20.100 / 60. 20.100 libavdevice 60. 4.100 / 60. 4.100 libavfilter 9. 17.100 / 9. 17.100 libswscale 7. 6.100 / 7. 6.100 libswresample 4. 13.100 / 4. 13.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../Downloads/TheaterSquare_854x480.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isom creation_time : 2022-07-04T05:11:27.000000Z Duration: 00:00:10.00, start: 0.000000, bitrate: 4182 kb/s Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, progressive), 854x480 [SAR 1:1 DAR 427:240], 4176 kb/s, 60 fps, 60 tbr, 90k tbn (default) Metadata: creation_time : 2022-07-04T05:11:27.000000Z handler_name : ISO Video Handler vendor_id : [0][0][0][0] File 'o.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_qsv) -> mpeg4 (native)) Press [q] to stop, [?] for help [vist#0:0/h264 @ 0x55846b1d3c40] Error submitting packet to decoder: Unknown error occurred [h264_qsv @ 0x55846b1ce000] Error creating a MFX session: -9. [h264_qsv @ 0x55846b1ce000] Error initializing an MFX session [h264_qsv @ 0x55846b1ce000] Error decoding header [vist#0:0/h264 @ 0x55846b1d3c40] Error submitting packet to decoder: Unknown error occurred [h264_qsv @ 0x55846b1ce000] Error creating a MFX session: -9. [h264_qsv @ 0x55846b1ce000] Error initializing an MFX session [h264_qsv @ 0x55846b1ce000] Error decoding header [vist#0:0/h264 @ 0x55846b1d3c40] Error submitting packet to decoder: Unknown error occurred [h264_qsv @ 0x55846b1ce000] get_buffer() failed [h264_qsv @ 0x55846b1ce000] Too many errors when draining, this is a bug. Stop draining and force EOF. [vist#0:0/h264 @ 0x55846b1d3c40] Decoding error: Internal bug, should not have happened [vist#0:0/h264 @ 0x55846b1d3c40] Decode error rate 1 exceeds maximum 0.666667 [vist#0:0/h264 @ 0x55846b1d3c40] Task finished with error code: -1145393733 (Error number -1145393733 occurred) [vist#0:0/h264 @ 0x55846b1d3c40] Terminating thread with return code -1145393733 (Error number -1145393733 occurred) [vost#0:0/mpeg4 @ 0x55846b1ceb40] No filtered frames for output stream, trying to initialize anyway. [mpeg4 @ 0x55846b1d31c0] timebase 1/90000 not supported by MPEG 4 standard, the maximum admitted value for the timebase denominator is 65535 [vost#0:0/mpeg4 @ 0x55846b1ceb40] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x55846b1cee40] Task finished with error code: -22 (Invalid argument) [vf#0:0 @ 0x55846b1cee40] Terminating thread with return code -22 (Invalid argument) [vost#0:0/mpeg4 @ 0x55846b1ceb40] Could not open encoder before EOF [vost#0:0/mpeg4 @ 0x55846b1ceb40] Task finished with error code: -22 (Invalid argument) [vost#0:0/mpeg4 @ 0x55846b1ceb40] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55846b25fac0] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A Conversion failed! (base) ubuntu@DESKTOP-NDGNCJ5:/mnt/c/Users/

Do you want to contribute a patch to fix the issue?

Yes, I'm glad to submit a patch to fix it

Sherry-Lin commented 1 month ago

Could you provide the GPU hardware infromation by lspci -nn |grep -Ei 'VGA|DISPLAY' and vainfo log by vainfo >vainfo.log 2>&1?

GeorgeZaher commented 1 month ago

libva info: VA-API version 1.23.0 libva error: vaGetDriverNames() failed with unknown libva error vaInitialize failed with error code -1 (unknown libva error),exit

and this gave nothing lspci -nn |grep -Ei 'VGA|DISPLAY'

GeorgeZaher commented 1 month ago

also vainfo libva info: VA-API version 1.23.0 libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so libva info: va_openDriver() returns -1 libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit

lspci -nn |grep -Ei 'VGA|DISPLAY' 0000:00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P Integrated Graphics Controller [8086:46a6] (rev 0c) 0000:01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:28e0] (rev a1) Now

pc 2

Jexu commented 1 month ago

Using ffmpeg args '-hwaccel_device /dev/dri/renderD129' to open intel gpu when you have multi gpu(s) on your machine

Note: try renderD128 as well if not work.

GeorgeZaher commented 1 month ago

regarding the first pc and the below one? how to verify if they are compatible any chance that they are not?

./vpl-inspect

Warning - no implementations found by MFXEnumImplementations()

image

Jexu commented 3 weeks ago

Using ffmpeg args '-hwaccel_device /dev/dri/renderD129' to open intel gpu when you have multi gpu(s) on your machine

Note: try renderD128 as well if not work.

As saied, your mahine has 2 GPU on it, it may open NV drm node but using Intel backen driver, so leading failure.

Try to open Intel gpu node if you want to using Intel SW stack.

vainfo --display drm --device "/dev/dri/renderD12xx" -> choose intel node