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

[Bug]: Decoding mpeg2 by OneVPL #342

Closed
kohshin-tokunaga opened this issue Jul 18, 2024 · 18 comments · Fixed by #349
Closed

[Bug]: Decoding mpeg2 by OneVPL #342

kohshin-tokunaga opened this issue Jul 18, 2024 · 18 comments · Fixed by #349
Assignees
Labels
Decode Video Decoding MPEG2 MPEG2 Codec

Comments

@kohshin-tokunaga
Copy link

Which component impacted?

Decode

Is it regression? Good in old configuration?

None

What happened?

Hello,

While using OneVPL to decode MPEG2, I encountered an issue. Please see the attached document for details.

This issue is very similar to a problem that occurred in the past:
https://community.intel.com/t5/Media-Intel-Video-Processing/decoding-mpeg2-by-Media-SDK/m-p/1294492

Also, I would like to send the project file used for decoding, but the file size is too large to attach to the message. Is there any way to send it?
README.xlsx
mediasdk_system_analyzer_64.txt

Thank you.

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

Others

What impacted?

Our company writes decoders for surveillance systems for IP cameras, and over time they fail almost 100% when using mpeg2.

Debug Information

The files required for reproduction are large, so we would like to use an ftp transfer system. Could you please contact us by email?

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

None

@Jexu Jexu self-assigned this Jul 18, 2024
@Jexu
Copy link
Contributor

Jexu commented Jul 18, 2024

Please give more descriptions about the issue. It is decoding error, output corruption or SW crash? Any avaiable failure log?
Do you try the sample decoder on your side if it decodes mpeg2 well?

@Jexu Jexu added Decode Video Decoding MPEG2 MPEG2 Codec labels Jul 18, 2024
@kohshin-tokunaga
Copy link
Author

This is decoding error.
It's a bug that causes an infinite loop when certain mpeg2 data is input.

I can send you the project I fixed to decode mpeg2, and the mpeg2 data where the error occurs.

But the file is too big to upload on this thread.
I'd like to send it to you using an ftp file transfer system, so could you please let me know your email address?

@intel-mediadev
Copy link
Contributor

Auto Created VSMGWL-75002 for further analysis.

@kohshin-tokunaga
Copy link
Author

Data_including_source_code.zip

Hi

I have prepared the minimum data to reproduce the bug.

hello-decode.exe -i OK.mpeg2
hello-decode.exe -i NG.mpeg2

OK.mpeg2 can be decoded, but NG.mpeg2 seems to enter an infinite loop.

Last time I pointed this out to MediaSDK, I asked the development team to analyze it.
Can you also ask the development team to analyze it?
https://community.intel.com/t5/Media-Intel-Video-Processing/decoding-mpeg2-by-Media-SDK/m-p/1294492

Regards.

@Jexu
Copy link
Contributor

Jexu commented Aug 7, 2024

Which plafrrom did you try?

With your provided NG.mpeg2, sample_decode works well without infinite loop as you saw.
./msdk_vpl_open/sample_decode mpeg2 -i NG.mpeg2 -hw -o out.yuv

You can get try to the sample_decode. hello-decode is minimum app for development reference, it may have potetial issue inside.

@kohshin-tokunaga
Copy link
Author

Sorry. Where is ./msdk_vpl_open/sample_decode?

I cloned the source code from below, but I can't find sample_decode.

https://github.com/intel/libvpl.git
https://github.com/intel/vpl-gpu-rt.git

@Jexu
Copy link
Contributor

Jexu commented Aug 7, 2024

Intel® VPL Tools have all been moved to https://github.com/intel/libvpl-tools

@kohshin-tokunaga
Copy link
Author

Hi

my platform is Windows.

I treid sample_decode.exe. But an error occured.
Do you have any advice?

C:\work\new_20240611\libvpl-tools\libvpl-tools_build\Release>sample_decode.exe mpeg2 -i NG.mpeg2 -hw -o out.yuv
CONFIGURE LOADER: required implementation: hw
CONFIGURE LOADER: required implementation mfxAccelerationMode: MFX_ACCEL_MODE_VIA_D3D11
CONFIGURE LOADER: Use dispatcher's low-latency mode

[ERROR], sts=MFX_ERR_NOT_FOUND(-9), CDecodingPipeline::InitMfxParams, SetParameters failed at pipeline_decode.cpp:1032
SetParameters_error

[ERROR], sts=MFX_ERR_NOT_FOUND(-9), CDecodingPipeline::Init, InitMfxParams failed at pipeline_decode.cpp:558

[ERROR], sts=MFX_ERR_NOT_FOUND(-9), main, Pipeline.Init failed at sample_decode.cpp:846

@kohshin-tokunaga
Copy link
Author

Hello.

I found a way to reproduce this problem, so I'm letting you know.

(Settings)

  1. Unzip movie_data.zip and copy it to C:.
  2. Unzip Debug.zip to a location of your choice.

(Execution)

  1. Run sample_decode_NORMAL.exe under Debug.
    sample_decode_NORMAL.exe mpeg2 -i meaged_data.dat -o out.yuv

This command should run without errors.

  1. Run sample_decode_NG.exe.
    sample_decode_NG.exe mpeg2 -i meaged_data.dat -o out.yuv

This command will stop with MFX_ERR_UNKNOWN(-1).

(Considerations)
sample_decode_NG.exe has been modified to read data from C:\movie_data sequentially. (sample_util.h, sample_util.cpp)
An error occurs when filename = C:\movie_data\data_000445.dat. This file only contains 1 byte of 00 data.
As I pointed out before, this phenomenon a
lso occurred with MediaSDK. Please check with the development team.
https://community.intel.com/t5/Media-Intel-Video-Processing/decoding-mpeg2-by-Media-SDK/m-p/1294492

Last time, it was improved by updating the driver. I hope for such a quick response this time as well.

movie_data.zip
Debug.zip

@kohshin-tokunaga
Copy link
Author

This is the modified source code for sample_decode_NG.exe.

sample_utils.zip

@Jexu
Copy link
Contributor

Jexu commented Aug 22, 2024

For 'data_000445', it only contains 1 byte of '00' and splittter will treat it as end of bitstream.
In vpl rt https://github.com/intel/vpl-gpu-rt/blob/main/_studio/shared/umc/codec/mpeg2_dec/src/umc_mpeg2_splitter.cpp#L87, the 'readSize' is overflow here that is an issue needing to fix. After fix, the readSize will become zero. I may want to know if this piece of bitstream accutully is end of bitstream for frame.

Jexu added a commit to Jexu/oneVPL-intel-gpu that referenced this issue Aug 22, 2024
@Jexu
Copy link
Contributor

Jexu commented Aug 22, 2024

Try fix in #349

@Jexu
Copy link
Contributor

Jexu commented Aug 22, 2024

Also add fix in example hello-*: intel/libvpl#155

@kohshin-tokunaga
Copy link
Author

Hi.

Do I need to take any action on this issue?

Regards.

@Jexu
Copy link
Contributor

Jexu commented Aug 23, 2024

No, when you verify it works for your test, I will get the PRs merged.

@Jexu
Copy link
Contributor

Jexu commented Sep 9, 2024

Hi may I know if above fix could solve your issue now?

@kohshin-tokunaga
Copy link
Author

Hi

Thank you for replay.

I tried to build but my environment is Windows.
I think that vpl-gpu-rt is for Linux.

How should I do?

gfxVPLsdm pushed a commit that referenced this issue Oct 9, 2024
@kohshin-tokunaga
Copy link
Author

Hello.

When will this fix be reflected in the Windows version?

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

Successfully merging a pull request may close this issue.

3 participants