mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
How to get buffer from drm_prime? #49
Labels
No labels
bug
enhancement
help wanted
invalid
pull-request
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/ffmpeg-rockchip#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FH0 on GitHub (Apr 8, 2024).
I use
av_hwframe_transfer_datato convertdrm_primetonv12.nv12has two planes, plane 0 size should be 2073600, plane 1 size should be 1036800, for case 1920x1080. But in factnv12plane 0 size is 3133568 and plane 1 will causeSegmentation fault.I use it in my Qt project.
@FH0 commented on GitHub (Apr 8, 2024):
the second linesize should be
960.If I copy with hard code, it will be OK.
@FH0 commented on GitHub (Apr 8, 2024):
Finally solved by
But I still don't know how to get buffer from avframe by ffmpeg way.
@nyanmisaka commented on GitHub (Apr 8, 2024):
@FH0
It is a semi-planar format, U and V are interleaved, so the 2nd linesize should be 1920.
1.5: bytes_per_pixel of NV12
Y buf: 1920xAlign(1080)x1.5=3133440 (+128=3133568) //<= calc by MPP runtime
UV buf: 1920xAlign(540)x1.5=1566720
See this func for more info
ba84e56c51/libavutil/hwcontext_rkmpp.c (L192)