<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="MSHTML 6.00.6000.17098" name=GENERATOR></HEAD>
<BODY><p><font face='Microsoft Sans Serif' color='Black' size='2'><b>UNCLASSIFIED</b></font></p>
<DIV><SPAN class=028073105-28072011><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial size=2>I am currently
trying to develop an application which utilises GStreamer to write and YUV
format mpegts file. The driver uses appsrc to write raw RGB frames to a YUV
mpegts file.</FONT></SPAN></DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial size=2>I am trying to get a
pipeline together and as I'm new to GStreamer I am not quite sure which plugins
and caps to set.I was hoping someone can point me in the right
direction.</FONT></SPAN></DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial size=2>With the pipeline:
<STRONG>"appsrc name=\"adsssrc\"
caps=\"video/x-raw-rgb,width=704,height=480,framerate=(fraction)25/1\" !
ffmpegcolorspace ! video/x-raw-yuv<SPAN class=028073105-28072011> </SPAN>!
ffenc_mpeg2video ! mpegtsmux ! filesink location=processed.mpg " </STRONG>I get
the following errors:</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><SPAN class=028073105-28072011><FONT
face=Arial size=2><STRONG> </STRONG>0:00:00.107419734
ESC[332m28183ESC[00m 0x2556010
ESC[32;01mINFO ESC[00m
ESC[00;01;31m GST_STATES
gstbin.c:2425:gst_bin_change_state_func:<bin0>ESC[00m child 'adsssrc'
changed state to 3(PAUSED) successfully<BR>0:00:00.140944498
ESC[332m28183ESC[00m 0x2758f90
ESC[33;01mWARN ESC[00m ESC[00m
basetransform
gstbasetransform.c:1047:gst_base_transform_acceptcaps:<capsfilter0>ESC[00m
transform could not transform video/x-raw-rgb, width=(int)704,
height=(int)480, framerate=(fraction)25/1 in anything we
support<BR>0:00:00.141210658
ESC[332m28183ESC[00m 0x2758f90
ESC[33;01mWARN ESC[00m ESC[00m
basetransform
gstbasetransform.c:1144:gst_base_transform_setcaps:<ffmpegcsp0>ESC[00m
FAILED to configure caps <ffmpegcsp0:src> to accept video/x-raw-yuv,
width=(int)704, height=(int)480, framerate=(fraction)25/1,
format=(fourcc)I420<BR>0:00:00.141441378
ESC[332m28183ESC[00m 0x2758f90
ESC[32;01mINFO ESC[00m
ESC[00m
basesrc gstbasesrc.c:2447:gst_base_src_loop:<adsssrc>ESC[00m pausing
after gst_pad_push() = not-negotiated</FONT></SPAN></DIV></BLOCKQUOTE><SPAN
class=028073105-28072011><FONT face=Arial size=2>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"></FONT></SPAN><SPAN
class=028073105-28072011><FONT face=Arial size=2>My test source is
below:</FONT></SPAN></DIV>
<DIV><SPAN class=028073105-28072011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><SPAN class=028073105-28072011><FONT
face=Arial size=2>#include <stdlib.h><BR>#include
<glib.h><BR>#include <gst/gst.h><BR>#include
<gst/app/gstappsink.h><BR>#include
<gst/app/gstappsrc.h><BR>#include
<gst/app/gstappbuffer.h></FONT></SPAN></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"> </DIV><SPAN
class=028073105-28072011>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><BR><FONT face=Arial size=2>int
main(void)<BR>{ </FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2> const
int width=704;<BR> const int height=480;<BR> const int
numFrames=50;<BR> const int layers=3;</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2> char
*fullPipelineDesc = "appsrc name=\"adsssrc\"
caps=\"video/x-raw-rgb,width=704,height=480,framerate=(fraction)25/1\" !
ffmpegcolorspace ! video/x-raw-yuv<SPAN class=028073105-28072011> </SPAN>!
ffenc_mpeg2video ! mpegtsmux ! filesink location=processed.mpg ";<BR>
GstElement *writePipeline;<BR> GError
*error = NULL;<BR> GstAppSrc
*appsrc = NULL;<BR> GstBuffer *app_buffer;<BR>
unsigned char *outByte;<BR> unsigned char *outBuff;<BR> int
outBuffSize = width * height * layers;<BR> int count=0;</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2> outBuff
= calloc(outBuffSize, sizeof(unsigned char));</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><BR><FONT face=Arial size=2>
gst_init(NULL, NULL);<BR>
gst_debug_set_default_threshold(GST_LEVEL_INFO);</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
writePipeline = gst_parse_bin_from_description(fullPipelineDesc, FALSE,
&error);<BR> appsrc = (GstAppSrc *)
gst_bin_get_by_name(GST_BIN(writePipeline), "adsssrc");<BR>
gst_element_set_state(writePipeline, GST_STATE_PLAYING);</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
/******** WRITE SOME RGB DATA INTO A BUFFER *******/<BR> for (int
frame=0; frame<numFrames; frame++)<BR> {<BR>
count = 0;<BR> for (int row=0; row<height;
row++)<BR>
{<BR> for (int plane=0;
plane<layers; plane++)<BR> {</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
for (int pixel=0; pixel<width; pixel++)<BR>
{<BR> fflush(stdout);<BR> outByte =
outBuff;<BR> outByte += (row*width*layers) +
(pixel*layers) + plane;</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2> if
(row%2)<BR> *outByte =
255;<BR>
else<BR> *outByte = 0;</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2>
}<BR>
}<BR> }<BR>
app_buffer = gst_app_buffer_new(outBuff, outBuffSize,
<BR>
g_free, outBuff);</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2> /* Write the buffer to the source pad
*/<BR>
gst_app_src_push_buffer(GST_APP_SRC(appsrc), app_buffer);<BR>
}</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
gst_app_src_end_of_stream(appsrc);</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>
free(outBuff);</FONT></DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial
size=2></FONT> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2> return
0;<BR>}</FONT></SPAN></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=028073105-28072011></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><p><font face='microsoft sans serif' color='Red' size='2'><b>IMPORTANT</b>: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.
<br></font><font face='microsoft sans serif' color='Black' size='2'></font></p></BODY></HTML>