I think thats the issue...<div><br></div><div><br></div><div>gst-launch -e v4l2src ! &#39;video/x-raw-yuv,width=320,height=240, framerate=30/1&#39; ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4</div><div>
<br></div><div>run with<b><font class="Apple-style-span" color="#FF0000"> -e</font> </b>option<br><br></div><div><br></div><div><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <span dir="ltr">&lt;<a href="mailto:Topi.Santakivi@digia.com">Topi.Santakivi@digia.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 12/22/2010 12:18 PM, michael wrote:<br>
&gt; Now I can record the video to a AVI file with mpeg4 encoding by :<br>
&gt; gst-launch v4l2src ! &#39;video/x-raw-yuv,width=320,height=240,<br>
&gt; framerate=30/1&#39; ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink<br>
&gt; location=record.avi<br>
&gt;<br>
&gt; But I got two issues:<br>
&gt; 1: I want record as a MP4 file, I do it like this:<br>
&gt; gst-launch v4l2src ! &#39;video/x-raw-yuv,width=320,height=240,<br>
&gt; framerate=30/1&#39; ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink<br>
&gt; location=record.avi<br>
&gt; I can record the video , but when I playback it by mplayer, I got a error:<br>
&gt; Playing ./record.mp4.<br>
&gt; libavformat file format detected.<br>
&gt; [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found<br>
&gt; LAVF_header: av_open_input_stream() failed<br>
&gt; ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2<br>
<br>
</div>When recording, with the above gst-launch line, do you stop<br>
the pipeline with Ctrl+C..?<br>
<br>
It could be that the file container doesn&#39;t get fully written<br>
in case of such an interrupt and that&#39;s why the clip doesn&#39;t play.<br>
<br>
For example, if you use this pipeline and<br>
stop it with Ctrl+C, the clip doesn&#39;t play:<br>
<br>
gst-launch-0.10 videotestsrc !<br>
<div class="im">&#39;video/x-raw-yuv,width=320,height=240,framerate=30/1&#39; ! ffmpegcolorspace<br>
</div>! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4<br>
<br>
But this pipeline produces a valid video file:<br>
<br>
gst-launch-0.10 videotestsrc num-buffers=200 !<br>
<div class="im">&#39;video/x-raw-yuv,width=320,height=240,framerate=30/1&#39; ! ffmpegcolorspace<br>
</div>! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4<br>
<div class="im"><br>
&gt;<br>
&gt; 2: I want encode the video to H264, so I do like this:<br>
&gt; gst-launch v4l2src ! &#39;video/x-raw-yuv,width=320,height=240,<br>
&gt; framerate=30/1&#39; ! ffmpegcolorspace ! x264enc! avimux ! filesink<br>
&gt; location=record.avi<br>
<br>
</div>How about adding the format to the caps, e.g .<br>
v4l2src ! &#39;video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,<br>
framerate=30/1&#39; ! fmpegcolorspace ! x264enc! avimux ! filesink<br>
location=record.avi ?<br>
<br>
BR,<br>
Topi<br>
<div class="im"><br>
&gt; But when I run the pipeline I just get the error info like this:<br>
&gt; Setting pipeline to PAUSED ...<br>
&gt; Pipeline is live and does not need PREROLL ...<br>
&gt; Setting pipeline to PLAYING ...<br>
&gt; New clock: GstSystemClock<br>
&gt; ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal<br>
&gt; data flow error.<br>
&gt; Additional debug info:<br>
&gt; gstbasesrc.c(2550): gst_base_src_loop ():<br>
&gt; /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:<br>
&gt; streaming task paused, reason not-negotiated (-4)<br>
&gt; Execution ended after 1727716724 ns.<br>
&gt; Setting pipeline to PAUSED ...<br>
&gt; Setting pipeline to READY ...<br>
&gt; Setting pipeline to NULL ...<br>
&gt; Freeing pipeline ...<br>
&gt;<br>
&gt; Some one can help me fix the issues? Tks :)<br>
&gt;<br>
&gt;<br>
&gt; On 12/22/10, Timothy Braun &lt;<a href="mailto:braunsquared@gmail.com">braunsquared@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:braunsquared@gmail.com">braunsquared@gmail.com</a>&gt;&gt; wrote:<br>
&gt;  &gt; H264 is encoded with x264enc element.<br>
&gt;  &gt;<br>
&gt;  &gt; Sent from my iPhone<br>
&gt;  &gt;<br>
&gt;  &gt; On Dec 22, 2010, at 3:10 AM, wl2776 &lt;<a href="mailto:wl2776@gmail.com">wl2776@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:wl2776@gmail.com">wl2776@gmail.com</a>&gt;&gt; wrote:<br>
&gt;  &gt;<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt; michael young wrote:<br>
&gt;  &gt;&gt;&gt;<br>
&gt;  &gt;&gt;&gt; And now , I want to record the video to a MP4 file with the h264<br>
&gt; encoding<br>
&gt;  &gt;&gt;&gt; format  ,  How can I do ?<br>
&gt;  &gt;&gt;&gt;<br>
&gt;  &gt;&gt;&gt; On Wed, Dec 22, 2010 at 2:26 PM, michael &lt;<a href="mailto:mcygogo@gmail.com">mcygogo@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:mcygogo@gmail.com">mcygogo@gmail.com</a>&gt;&gt; wrote:<br>
&gt;  &gt;&gt;&gt;<br>
&gt;  &gt;&gt;&gt;&gt; tks, this is work:   gst-launch v4l2src device=/dev/video0 !<br>
&gt;  &gt;&gt;&gt;&gt; &#39;video/x-raw-yuv,width=640,height=480,framerate=30/1&#39; ! xvimagesink<br>
&gt;  &gt;&gt;&gt;<br>
&gt;  &gt;&gt;&gt;<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt; Looks like you can&#39;t, because h264 encoder is unavailable.<br>
&gt;  &gt;&gt; gst-inspect | grep h264<br>
&gt;  &gt;&gt; doesn&#39;t show it.<br>
&gt;  &gt;&gt; However, general idea is to encode, then mux, and then save to a file.<br>
&gt;  &gt;&gt; gst-launch v4l2src device=/dev/video0 !<br>
&gt;  &gt;&gt; &#39;video/x-raw-yuv,width=640,height=480,framerate=30/1&#39; !  ffenc_mpeg4 !<br>
&gt;  &gt;&gt; mp4mux !filesink location=/home/user/file.<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt; --<br>
&gt;  &gt;&gt; View this message in context:<br>
&gt;  &gt;&gt;<br>
&gt; <a href="http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html</a><br>

&gt;  &gt;&gt; Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt;<br>
&gt; ------------------------------------------------------------------------------<br>
&gt;  &gt;&gt; Forrester recently released a report on the Return on Investment<br>
&gt; (ROI) of<br>
&gt;  &gt;&gt; Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even<br>
&gt;  &gt;&gt; within 7 months.  Over 3 million businesses have gone Google with Google<br>
&gt;  &gt;&gt; Apps:<br>
&gt;  &gt;&gt; an online email calendar, and document program that&#39;s accessible<br>
&gt; from your<br>
&gt;  &gt;&gt;<br>
&gt;  &gt;&gt; browser. Read the Forrester report: <a href="http://p.sf.net/sfu/googleapps-sfnew" target="_blank">http://p.sf.net/sfu/googleapps-sfnew</a><br>
&gt;  &gt;&gt; _______________________________________________<br>
&gt;  &gt;&gt; gstreamer-devel mailing list<br>
&gt;  &gt;&gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div class="im">&gt;  &gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;  &gt;<br>
&gt;  &gt;<br>
&gt; ------------------------------------------------------------------------------<br>
&gt;  &gt; Forrester recently released a report on the Return on Investment (ROI) of<br>
&gt;  &gt; Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even<br>
&gt;  &gt; within 7 months.  Over 3 million businesses have gone Google with Google<br>
&gt;  &gt; Apps:<br>
&gt;  &gt; an online email calendar, and document program that&#39;s accessible from<br>
&gt; your<br>
&gt;  &gt; browser. Read the Forrester report: <a href="http://p.sf.net/sfu/googleapps-sfnew" target="_blank">http://p.sf.net/sfu/googleapps-sfnew</a><br>
&gt;  &gt; _______________________________________________<br>
&gt;  &gt; gstreamer-devel mailing list<br>
&gt;  &gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div><div></div><div class="h5">&gt;  &gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;  &gt;<br>
<br>
------------------------------------------------------------------------------<br>
Forrester recently released a report on the Return on Investment (ROI) of<br>
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even<br>
within 7 months.  Over 3 million businesses have gone Google with Google Apps:<br>
an online email calendar, and document program that&#39;s accessible from your<br>
browser. Read the Forrester report: <a href="http://p.sf.net/sfu/googleapps-sfnew" target="_blank">http://p.sf.net/sfu/googleapps-sfnew</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div>