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

Wrong incoming frame length #448

Closed
niXman opened this issue Nov 4, 2021 · 3 comments · Fixed by #543
Closed

Wrong incoming frame length #448

niXman opened this issue Nov 4, 2021 · 3 comments · Fixed by #543
Assignees
Labels
needs triage new issues

Comments

@niXman
Copy link

niXman commented Nov 4, 2021

hi,

I'm using ubuntu-20.04 with v4l2loopback-0.12.3.

I have two v4l2 loopback devices with the following characteristics:

ffprobe /dev/video0

Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 17479.219834, bitrate: 331776 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 331776 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
ffprobe /dev/video1

Input #0, video4linux2,v4l2, from '/dev/video1':
Duration: N/A, start: 17481.786751, bitrate: 117964 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x512, 117964 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

but I ran into a problem with the frame size in webrtc source code: https://webrtc.googlesource.com/src/+/refs/heads/main/modules/video_capture/video_capture_impl.cc#132

YUV420 frame size in bytes should be 1280×720+640×360×2 == 1382400 but was read 1384448...

IncomingFrame() called from here: https://webrtc.googlesource.com/src/+/refs/heads/main/modules/video_capture/linux/video_capture_linux.cc#411

struct v4l2_buffer filled here: https://webrtc.googlesource.com/src/+/refs/heads/main/modules/video_capture/linux/video_capture_linux.cc#398

but pay attention, webrtc works great for my second video stream! (/dev/video1: yuv420p, 640x512)
so I think the problem is not in the webrtc code.

any ideas?

best!

@niXman niXman added the needs triage new issues label Nov 4, 2021
@niXman
Copy link
Author

niXman commented Nov 5, 2021

looks like the problem is in gstreamer's v4l2sink plugin...

@mariannasb
Copy link

can you comment on what you found on v4l2sink?

@umlaeute
Copy link
Owner

umlaeute commented May 2, 2023

Here's the relevant bugreport for the v4l2sink: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2532

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

Successfully merging a pull request may close this issue.

3 participants