<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<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 dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011>I am making slight progress with this problem. I have
fully defined the caps for APPSRC to match those specified as a SINK in
ffmpegcolorspace. My new pipeline is (the rest of the source is below
in the original email):</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011></SPAN></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011> char *fullPipelineDesc = "appsrc is-live=true
name=\"adsssrc\"
caps=\"video/x-raw-rgb,width=704,height=480,framerate=(fraction)25/1,bpp=24,depth=24,red_mask=255,green_mask=65280,blue_mask=16711680,endianness=4321\"
! ffmpegcolorspace !
video/x-raw-yuv,width=704,height=480,framerate=(fraction)25/1,format=(fourcc)I420
! ffenc_mpeg2video ! mpegtsmux ! filesink location=processed.mpg
";</SPAN></FONT></DIV></BLOCKQUOTE>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011>With this I see the following
error:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011></SPAN></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>
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, bpp=(int)24, depth=(int)24,
red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680,
endianness=(int)4321 in anything we support</FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=737000605-02082011>This
puzzles me as the both the sink and src capabilities match the output I see from
"gst-inspect-0.10 ffmpegcolorspace". Am I missing something?</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=737000605-02082011>Paul</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><BR>
<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>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Durrand, Paul (Contractor)
<BR><B>Sent:</B> Monday, 1 August 2011 3:49 PM<BR><B>To:</B> 'Discussion of the
development of and with GStreamer'<BR><B>Subject:</B> Writing raw frames to
mpegts [SEC=UNCLASSIFIED]<BR></FONT><BR></DIV>
<DIV></DIV>
<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>