intel / cartwheel-ffmpeg

Intel developer staging area for unmerged upstream patch contributions to FFmpeg
GNU Lesser General Public License v2.1
97 stars 33 forks source link

[Feature Request] Compatibility #246

Closed thx4ever closed 1 year ago

thx4ever commented 1 year ago

Hi, its possible to add compatibility with Media Server Studio plugins again? I can see load_plugins options but it doesnt work without intel GPU since ffmpeg version 4.5 in software mode using libmfxsw64.dll and 2fca99749fdb49aeb121a5b63ef568f7 (mfxplugin64_hevce_sw.dll), why with ffmpeg 4.5 it works but in this newer ffmpeg versions 5 or 6 it doesnt? Until now i can only use software mode wihthout intel GPU, but i have plans to buy Intel ARC A380 graphics card My build have libmfx and libvpl My ffmpeg command line options:

ffmpeg -v verbose -hide_banner -i C:\Users\Administrator\Desktop\Source2.264 -c:v hevc_qsv -pix_fmt nv12 -load_plugin hevc_sw -profile:v main -preset:v veryslow -bsf:v hevc_metadata=transfer_characteristics=1:colour_primaries=1:video_full_range_flag=0:matrix_coefficients=1 -b:v 2500k C:\Users\Administrator\Desktop\teste.hevc

This message i get when try to use ffmpeg above version 4.5 [hevc_qsv @ 000001AA94A52A00] Error initializing a MFX session: unsupported (-3) [vost#0:0/hevc_qsv @ 000001AA94A48080] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.

Regards

nyanmisaka commented 1 year ago

AFAIK the Media SDK is discontinued and its plugins are no longer supported and required by oneVPL.

So you have to build FFmpeg with --enable-libmfx instead of --enable-libvpl to get plugin support on legacy platforms.

thx4ever commented 1 year ago

I have now enabled --enable libmfx but it always show error -3, its possible to add support to use software mode libmfxsw64.dll use? Any command line options or something? Because it doesnt allow software mode currently?

xhaihao commented 1 year ago

@thx4ever There isn't a tag for version 4.5 in http://git.videolan.org/?p=ffmpeg.git;a=tags, are you using an official version ?

nyanmisaka commented 1 year ago

I think he is referring to the n4.5-dev tag, which is a branch point after 4.4 release.

xhaihao commented 1 year ago

@nyanmisaka thanks for the comment.

@thx4ever I'm sorry I don't have the environment to try libmfxsw64.dll, could you help to try FFmpeg 5.0 (which doesn't support oneVPL, we shouldn't change too much for QSV) ?

thx4ever commented 1 year ago

Yes i did test it it show error -3 because i dont have a Intel GFX or GPU installed, but it works fine without it on ffmpeg 4.5 old version, since i dont have a intel GPU it doesnt work in old version ffmpeg 4.5 it doesnt matter it load libmfxsw64.dll and works

xhaihao commented 1 year ago

@thx4ever could you try https://github.com/intel-media-ci/ffmpeg/pull/649 ?

thx4ever commented 1 year ago

OK i will try and report back

thx4ever commented 1 year ago

It works now [h264 @ 000001F3CF28CB40] Reinit context to 1920x1088, pix_fmt: yuv420p [graph 0 input from stream 0:0 @ 000001F3D13BA5C0] w:1920 h:1080 pixfmt:yuv420p tb:1/90000 fr:24000/1001 sar:1/1 [auto_scale_0 @ 000001F3D13B79C0] w:iw h:ih flags:'' interl:0 [format @ 000001F3D13B91C0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format' [auto_scale_0 @ 000001F3D13B79C0] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:p010le sar:1/1 flags:0x00000004 [hevc_qsv @ 000001F3CF28BF40] Encoder: input is system memory surface [hevc_qsv @ 000001F3CF28BF40] Use Intel(R) Media SDK to create MFX session, the required implementation version is 1.1 [hevc_qsv @ 000001F3CF28BF40] Error initializing a MFX session: unsupported (-3) [hevc_qsv @ 000001F3CF28BF40] The current impl is not supported, try next impl. [hevc_qsv @ 000001F3CF28BF40] Use Intel(R) Media SDK to create MFX session, the required implementation version is 1.1 [hevc_qsv @ 000001F3CF28BF40] Initialized an internal MFX session using software implementation [hevc_qsv @ 000001F3CF28BF40] Using the constant quantization parameter (CQP) ratecontrol method [hevc_qsv @ 000001F3CF28BF40] profile: hevc main10; level: 40 [hevc_qsv @ 000001F3CF28BF40] GopPicSize: 0; GopRefDist: 8; GopOptFlag:; IdrInterval: 1 [hevc_qsv @ 000001F3CF28BF40] TargetUsage: 1; RateControlMethod: CQP [hevc_qsv @ 000001F3CF28BF40] QPI: 18; QPP: 23; QPB: 30 [hevc_qsv @ 000001F3CF28BF40] NumSlice: 1; NumRefFrame: 4 [hevc_qsv @ 000001F3CF28BF40] RateDistortionOpt: unknown [hevc_qsv @ 000001F3CF28BF40] RecoveryPointSEI: unknown [hevc_qsv @ 000001F3CF28BF40] VDENC: unknown [hevc_qsv @ 000001F3CF28BF40] NalHrdConformance: unknown; VuiNalHrdParameters: unknown [hevc_qsv @ 000001F3CF28BF40] FrameRateExtD: 1001; FrameRateExtN: 24000 [hevc_qsv @ 000001F3CF28BF40] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0 [hevc_qsv @ 000001F3CF28BF40] MaxFrameSize: 0; MaxSliceSize: 0 [hevc_qsv @ 000001F3CF28BF40] BitrateLimit: unknown; MBBRC: ON; ExtBRC: unknown [hevc_qsv @ 000001F3CF28BF40] Trellis: auto [hevc_qsv @ 000001F3CF28BF40] RepeatPPS: unknown; NumMbPerSlice: 0; LookAheadDS: unknown [hevc_qsv @ 000001F3CF28BF40] AdaptiveI: OFF; AdaptiveB: unknown; BRefType:auto [hevc_qsv @ 000001F3CF28BF40] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0 [hevc_qsv @ 000001F3CF28BF40] DisableDeblockingIdc: 0 [hevc_qsv @ 000001F3CF28BF40] SkipFrame: no_skip [hevc_qsv @ 000001F3CF28BF40] PRefType: default [hevc_qsv @ 000001F3CF28BF40] GPB: OFF [hevc_qsv @ 000001F3CF28BF40] TransformSkip: unknown [hevc_qsv @ 000001F3CF28BF40] IntRefCycleDist: 0 [hevc_qsv @ 000001F3CF28BF40] LowDelayBRC: unknown [hevc_qsv @ 000001F3CF28BF40] MaxFrameSizeI: 0; MaxFrameSizeP: 0 [hevc_qsv @ 000001F3CF28BF40] ScenarioInfo: 0 [hevc_qsv @ 000001F3CF28BF40] NumTileColumns: 1; NumTileRows: 1 Output #0, hevc, to 'C:\teste.hevc':

xhaihao commented 1 year ago

Fixed in http://git.videolan.org/?p=ffmpeg.git;a=commit;h=2b0fe529674e91bd55b52512f9a2bb0658ce0f7c