Stream quality problems with simple h264 encoder
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- audio-video-rtc
Research direction
Start by reading src/stream/video/SnpEncoderVaH264.cpp and comparing its setup with the H264 example in libva-utils. Inspect the attached encoded stream in VLC and trace how successive frames are encoded and decoded. Done means identifying the cause of the accumulating quality loss and documenting or correcting the relevant encoder behavior.
Written by the indexing model from the issue text.
Description
I've written a simple h264 encoder using libva for a screen capture tool. The encoder is set up to create a single IDR frame with only P frames following. I've copied most of the code from the h264 example in libva-utils. I'm facing a problem with image quality of the encoded stream. Errors in the picture seem to accumulate over time and the visual quality deteriorates as more frames are encoded/decoded.
If i understand correctly, the quality should not get worse over time (as long as there are no transmission errors) - the encoder should know about the "reconstruction error" of individual frames and respect them when encoding another. The video I've attached shows a kind of "ghost picture" of past frames which gets more visible over time. I think I might be doing something wrong in my code, however I cannot find out.
The code can be found here:
https://github.com/martin19/snpserver/blob/main/src/stream/video/SnpEncoderVaH264.cpp
A dump of an encoded stream with QP set to constant value of 30 (can be viewed with VLC for example):
https://drive.google.com/file/d/1IdjtmxVxz6KTW8twdLvYodD7vrFhLU-a/view?usp=sharing
(..rgb components are swapped in the stream, so colors are not correct)
Can anyone please help here?
- Dominant language
- C
- Stars
- 244
- Forks
- 175
- Avg merge
- 9d 7h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from intel/libva-utils
-
av1encode: reference_frames[2..7] left as surface 0 (memset only covers 8 bytes)Possibly taken @0z5a claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
intel/libva-utils#390 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
intel/libva-utils#387 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
intel/libva-utils#378 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
intel/libva-utils#376 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
intel/libva-utils#374 ·
All issues in intel/libva-utils
Similar issues
-
ecs_ptr_from_json does not free the buffer of a string longer than 256 bytes on two error pathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SanderMertens/flecs#2444 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Cisco-Talos/clamav#1941 ·
Maintainers usually reply within 2 days
-
Status: Opened
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
espressif/esp-eth-drivers#201 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
libsdl-org/SDL#16788 ·
Maintainers usually reply within 1 day