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

Corruption Frame after decoding #188

Open
Mon-ius opened this issue Aug 13, 2024 · 8 comments
Open

Corruption Frame after decoding #188

Mon-ius opened this issue Aug 13, 2024 · 8 comments

Comments

@Mon-ius
Copy link

Mon-ius commented Aug 13, 2024

Given two examples videos, after decoding we will get frames with heavy lines.

1.mp4
2.mp4

And the corrupted frames after decoding:

1
2

@SimonRacaud
Copy link

Hello, I had that kind of problem. The content of the resulting AVFrame may not be parsed right.

First, check the value in AVFrame.format after the call to receive_frame(), to see if it's the right format you are trying to display. Then see how the content of the frame is processed (frame.data).

Example:

if frame.format == AV_PIX_FMT_YUV420P {
    /// The frame is in YUV420P format
}

@Mon-ius
Copy link
Author

Mon-ius commented Aug 21, 2024

@SimonRacaud Thanks for your reply. I tried your method before, which is not the root cause of this issue. Also, I uploaded the video which is YUV420P format for both 1.mp4 and 2.mp4. I also tried to use scaler to convert it to RGB24, and none of them work.

@Codewithteju
Copy link

Codewithteju commented Sep 15, 2024

@Mon-ius , May I know how did you converted the frame which is YUV_420P format into RGB ?

@Mon-ius
Copy link
Author

Mon-ius commented Sep 16, 2024

@Codewithteju Yes, I found the rust based ffmpeg solutions all have this issue.

@Codewithteju
Copy link

Codewithteju commented Sep 16, 2024

@Mon-ius, Actually I am trying to decode a input video and get the frames out of it for further modification such as converting them to grayscale, etc. With Rsmpeg I can only decode the video in raw format (.264), if i use the .mp4 video files, it\s saying there is -"No start codes found, NAL issues and something like this"
([h264 @ 00000000xyz] No start code is found
[h264 @ 00000000xyz] Error splitting the input into NAL units.)
Have you tried decoding the input video which is .mp4 format?

Is there any discord channel for the rsmpeg module? I have got some doubts regarding encoding too?

@Mon-ius
Copy link
Author

Mon-ius commented Sep 16, 2024

@Codewithteju

Hi, I uploaded these two video which are .mp4 format indeed, you can actually download them by clicking the dots and do more test 🤗

@Codewithteju
Copy link

@Mon-ius , I have tried decoding with those videos, but getting the same error. How did you decode it, can you provide any code snippet of rsmpeg ?

@ldm0
Copy link
Member

ldm0 commented Sep 16, 2024

@Codewithteju Yes, I found the rust based ffmpeg solutions all have this issue.

@Mon-ius Could you provide a minimal reproducible example in Rust and C? It's pretty interesting that's Rust-related. I am happy to do some investigation.

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

No branches or pull requests

4 participants