<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:Arial;
        color:blue;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 107.65pt 72.0pt 107.65pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1 style='layout-grid:15.6pt'>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>Hi,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>Thanks a lot for the reply, my chain function is as
following:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>gst_video_enc_chain (GstPad * pad,
GstBuffer * buf)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>{<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GstVideoEnc *videoenc = GST_VIDEO_ENC
(GST_OBJECT_PARENT (pad));<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GstClockTime timestamp,
duration;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gboolean discont;</span></font><font
color=black><span lang=FR style='color:windowtext'><o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=FR
style='font-size:10.0pt;color:windowtext'> </span><span lang=EN-US>GstBuffer
*out_buf = NULL; <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GstFlowReturn ret =
GST_FLOW_OK;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> guint width, height;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> guint size;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> guint outsize;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> guint8 * buffer =
GST_BUFFER_DATA (buf);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> size = GST_BUFFER_SIZE (buf)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> timestamp =
GST_BUFFER_TIMESTAMP (buf);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> </span></font><font
color=black><span lang=FR style='color:windowtext'>duration =
GST_BUFFER_DURATION (buf);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=FR
style='font-size:10.0pt;color:windowtext'> </span><span lang=EN-US>discont
= GST_BUFFER_IS_DISCONT (buf); <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> outsize = encode_one_picture (videoenc,
buffer, &codedbuf); //encode one picture<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> out_buf =
gst_buffer_new_and_alloc (outsize); <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> memcpy (GST_BUFFER_DATA
(out_buf), coded_buf, outsize);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GST_BUFFER_SIZE
(out_buf) = outsize;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GST_BUFFER_TIMESTAMP
(out_buf) = timestamp;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GST_BUFFER_DURATION
(out_buf) = duration;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gst_buffer_set_caps
(out_buf, GST_PAD_CAPS (videoenc->srcpad));<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gst_buffer_unref (buf);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gst_pad_push
(videoenc->srcpad, out_buf);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> return ret;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>And the srccaps set function is as following:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>gst_video_enc_set_src_caps (GstVideoEnc
* videoenc, GstPad * pad)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>{<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> GstCaps *outcaps;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gboolean res;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> outcaps =
gst_caps_new_simple ("video/x-h264",<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>
"width", G_TYPE_INT, videoenc->width,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>
"height", G_TYPE_INT, videoenc->height,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>
"framerate", GST_TYPE_FRACTION, videoenc->fps_num,
videoenc->fps_den, NULL);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> res = gst_pad_set_caps (pad,
outcaps);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'> gst_caps_unref (outcaps);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>}<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>Is my info enough? If yes, what’s the
problem? <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>Could you please give me some help?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'>Thanks in advanced.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face=Arial><span lang=EN-US
style='font-size:10.0pt;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>thanks,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>Weian<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>-----Original Message-----<br>
From: Michael Smith [mailto:msmith@xiph.org] <br>
Sent: 2009</span></font><font face=宋体><span style='font-family:宋体'>年</span></font><span
lang=EN-US>8</span><font face=宋体><span style='font-family:宋体'>月</span></font><span
lang=EN-US>11</span><font face=宋体><span style='font-family:宋体'>日</span></font><span
lang=EN-US> 19:56<br>
To: Discussion of the development of GStreamer<br>
Subject: Re: [gst-devel] My H.264 encoder cound not work well with the MP4
muxer</span></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>On Tue, Aug 11, 2009 at 2:08 AM, Chen,
Weian<weian.chen@intel.com> wrote:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> Hi All<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> I am developing an H.264 encoder element, and
with pipeline: gst-launch<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> videotestsrc ! myencoder ! filesink
location=test.264 I can dump the<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> test.264 data, and also I can decoder it.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> But when I use pipeline: gst-launch videotestsrc
! myencoder ! mp4mux !<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> filesink location=test.mp4 I could not get any
output, and the size of<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> test.mp4 is 0.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> Could anybody here give me some hint what’s the
problem in my encoder? Why<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>> my encoder could not work with the MP4 muxer?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>You've given far too little information for us to
help. What caps are<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'>produced by your encoder? What's set on the buffers
you push? Etc.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>