Set partial pixel to be transparent in video
Sean
csosmo at hotmail.com
Mon Sep 26 05:52:04 UTC 2016
Hi,
I wrote to customized element (myelement) to set partial pixels of one video
frame to be transparent. My machine is little endian.
This is myelement implementation, I want to make the upper half of 640x480
(i.e. the upper 640x240 pixels ) invisible by setting the Alpha value to be
0x0
GstMapInfo info;
if (!gst_buffer_map(buffer, &info, GST_MAP_READ)) {
return GST_FLOW_ERROR;
}
for (int i = 0; i < 240; i++) {
for (int j = 0; j < 640; j++)
info.data[(i*640+j)*4] = 0x0;
}
GST_FLOW_OK;
This is my test command:
gst_launch -v videotestsrc ! video/x-raw,format=RGBA,width=640, height=480 !
videoconvert ! myelement ! x264enc ! mpegtsmux ! filesink location=test.ts
I expect the upper half of the test.ts should be transparent. However, the
result is (row,col)=(0,4), (0,8) (0,12)...... become a GREEN pixel. Would
anyone help to comment which part is wrong?
Thanks a lot.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Set-partial-pixel-to-be-transparent-in-video-tp4679769.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list