<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; } #yiv9320546080 #yiv9320546080 -- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Simon,<br>
</p>
<p><br>
</p>
<p>>>> <span style="font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: small; background-color: rgb(255, 255, 255);">Thank you for your suggestion, however, it still fails, and no error is reported.</span><br>
</p>
<p>If you're running the pipeline from a C/C++ program, you can pass the --gst-debug-level option to the</p>
<p>gst_init()<br>
</p>
<p>function<br>
</p>
<p><br>
</p>
<div><span style="white-space:pre"></span>int argc = 3;</div>
<div><span style="white-space:pre"></span>char **argv = new char*[argc];</div>
<div><span style="white-space:pre"></span>argv[0] = "appname";</div>
<div><span style="white-space:pre"></span>argv[1] = "--gst-debug-level=X";</div>
<div><span style="white-space:pre"></span>argv[2] = "--gst-debug-no-color";</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>gst_init(&argc, &argv);<br>
</div>
<div><br>
</div>
<div><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">where X is a number from 0 to 9, 9 being the highest level- then you'll see a lot of errors on stderr (even overwhelming)</span><br>
</div>
<div><br>
</div>
<div>Anyway, recently I managed to make the following pipeline work:<br>
</div>
<div><br>
</div>
<div>
<div>"appsrc name=appsrc_element block=true format=3 ! video/x-raw,format=YUY2,width=320,height=240,framerate=30/1 ! "</div>
<div><span style="white-space:pre"></span>"videoconvert ! x264enc tune=zerolatency bitrate=4096 ! video/x-h264,profile=\"high-4:4:4\" ! rtph264pay ! udpsink host=192.168.168.98 port=10000"<br>
</div>
<div><br>
</div>
<div>It does something similar to what you're trying to achieve- only transmits over the network instead of saving to a file.<br>
</div>
<div>As an advice try first replacing the whole H264 encoding part with a autovideosink- that way you'll</div>
<div>make sure that the video you import from the <strong>appsrc</strong> is working, something like:<br>
</div>
<div><br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
"appsrc name=appsrc_element block=true format=3 ! video/x-raw,format=YUY2,width=320,height=240,framerate=30/1 ! "</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">
<span style="white-space: pre;"></span>"videoconvert ! <strong>autovideosink</strong>"<br>
</div>
<br>
</div>
<div>When this pipeline works, proceed with adding more elements<br>
</div>
<div><br>
</div>
Hope that helps<br>
</div>
<div>Martin<br>
</div>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of simo zz <simon.zz@yahoo.com><br>
<b>Sent:</b> Friday, August 25, 2017 12:10 PM<br>
<b>To:</b> Discussion of the development of and with GStreamer<br>
<b>Subject:</b> Re: Gstreamer pipeline through OpenCV for H264 encoded video file</font>
<div> </div>
</div>
<div>
<div style="color:#000; background-color:#fff; font-family:標楷體,dfkai-sb; font-size:16px">
<div id="yui_3_16_0_ym19_1_1503645999210_46043"><font face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2">Hello Martin,</font></div>
<div id="yui_3_16_0_ym19_1_1503645999210_46046"><br>
</div>
<div id="yui_3_16_0_ym19_1_1503645999210_46179"><font id="yui_3_16_0_ym19_1_1503645999210_46417" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2">Thank you for your suggestion, however, it still fails, and no error
 is reported.</font></div>
<div><font id="yui_3_16_0_ym19_1_1503645999210_46417" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2"><br>
</font></div>
<div id="yui_3_16_0_ym19_1_1503645999210_46398"><font face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2">Regards,</font></div>
<div id="yui_3_16_0_ym19_1_1503645999210_46440"><font face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="2">Simon<br>
</font></div>
<div id="yui_3_16_0_ym19_1_1503645999210_45955"></div>
<div class="qtdSeparateBR"><br>
<br>
</div>
<div class="yahoo_quoted" style="display:block">
<div style="font-family:標楷體,dfkai-sb; font-size:16px">
<div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size:16px">
<div dir="ltr"><font face="Arial" size="2">El Viernes 25 de agosto de 2017 12:13, Martin Vachovski <Martin.Vachovski@skytek.com> escribió:<br>
</font></div>
<br>
<br>
<div class="y_msg_container">
<div id="yiv9320546080"><style type="text/css">
<!--
#yiv9320546080 #yiv9320546080 -- p
        {margin-top:0px;
        margin-bottom:0px}
-->
</style>
<div dir="ltr">
<div>Sorry... didn't mean to omit the autovideoconvert...<br clear="none">
</div>
<div><br clear="none">
</div>
<div>The pipeline I meant is to be read:<br clear="none">
</div>
<div><br clear="none">
</div>
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">appsrc ! </span><strong style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">video/x-raw,format=YUY2,width=320,height=240,framerate=30/1</strong><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"> <span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">!</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"> </span><strong style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">autovideoconvert </strong>​!  v4l2video1h264enc 
 ....</span><br clear="none">
</div>
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"><br clear="none">
</span></div>
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">Cheers</span></div>
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">Martin</span></div>
<div><br clear="none">
</div>
<div class="yiv9320546080yqt0756782030" id="yiv9320546080yqt80663">
<div dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div dir="ltr" id="yiv9320546080divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of Martin Vachovski <Martin.Vachovski@skytek.com><br clear="none">
<b>Sent:</b> Friday, August 25, 2017 11:09 AM<br clear="none">
<b>To:</b> gstreamer-devel@lists.freedesktop.org; simo zz<br clear="none">
<b>Subject:</b> Re: Gstreamer pipeline through OpenCV for H264 encoded video file</font>
<div> </div>
</div>
<div>
<div>One quick thing I can suggest is to try to specify the CAPS before the autovideoconvert element.<br clear="none">
</div>
<div>Otherwise there might be problems with the negotiation and starting of the pipeline<br clear="none">
</div>
<div>something like:<br clear="none">
</div>
<div><br clear="none">
</div>
<div>appsrc ! <strong>video/x-raw,format=YUY2,width=320,height=240,framerate=30/1</strong> !   v4l2video1h264enc  ....<br clear="none">
</div>
<div><br clear="none">
</div>
<div>Or whatever format you're getting the videoframes  in from the appsrc, try to specify as many details as possible<br clear="none">
</div>
<div><br clear="none">
</div>
<div>Cheers<br clear="none">
</div>
<div>Martin<br clear="none">
</div>
<div><br clear="none">
</div>
<div style="color:rgb(33,33,33)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div dir="ltr" id="yiv9320546080divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of simo zz <simon.zz@yahoo.com><br clear="none">
<b>Sent:</b> Friday, August 25, 2017 10:58 AM<br clear="none">
<b>To:</b> gstreamer-devel@lists.freedesktop.org<br clear="none">
<b>Subject:</b> Gstreamer pipeline through OpenCV for H264 encoded video file</font>
<div> </div>
</div>
<div>
<div style="color:#000; background-color:#fff; font-family:標楷體,dfkai-sb; font-size:16px">
<div id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_17294"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_17639" face="verdana, helvetica, sans-serif" size="2">Hi all,</font></div>
<div id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33994"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_17639" face="verdana, helvetica, sans-serif" size="2"><br clear="none">
</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_17512"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_17642" face="verdana, helvetica, sans-serif" size="2">I am working on an IP application working with OpenCV and I need to generate
 an H264 encoded videos.</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18104"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18283" face="verdana, helvetica, sans-serif" size="2">OpenCV uses GStramer to for this task, initializing the OpenCV
<b id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33730">VideoWriter</b> object with a
</font><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">GStramer pipeline. In turns it should passthe frames GStramer which should write the video..<br clear="none">
</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_26378"><br clear="none">
</div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_26380"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">The actual pipeline I am using for this task:</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33595"><br clear="none">
</div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33597"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">"<b id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33727">appsrc ! autovideoconvert
 ! v4l2video1h264enc extra-controls=\"encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=2000000\" ! h264parse ! rtph264pay config-interval=1 pt=96 ! filesink location=file.pm4</b>"<br clear="none">
</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_26208"><br clear="none">
</div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33888"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">But it's neither generating the video. I tried many pipelines without successful
 results..</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_33998"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">What is the correct pipeline I must use ?</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_34061"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2"><br clear="none">
</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_34000"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">Thank you in advance,</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_34002"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">Regards,</font></div>
<div dir="ltr" id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_34004"><font id="yiv9320546080yui_3_16_0_ym19_1_1503645999210_18284" face="verdana, helvetica, sans-serif" size="2">Simon<br clear="none">
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="yqt0756782030" id="yqt17470">_______________________________________________<br clear="none">
gstreamer-devel mailing list<br clear="none">
<a href="" class="removed-link" shape="rect">gstreamer-devel@lists.freedesktop.org</a><br clear="none">
<a href="" class="removed-link" shape="rect" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br clear="none">
</div>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>