I just ran it :<br><font class="Apple-style-span" color="#3333FF">gst-launch -e v4l2src num-buffers=200  ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=record.mp4</font><br>
And got a mp4 file , but it still cannot be playbacked, and give the error info:<br><div><font class="Apple-style-span" color="#FF6666">Playing record.mp4.</font></div><div><font class="Apple-style-span" color="#FF6666">libavformat file format detected.</font></div>
<div><font class="Apple-style-span" color="#FF0000">[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits</font></div><div><font class="Apple-style-span" color="#FF0000">[mpeg4 @ 0x9376c10]my guess is 5 bits ;)</font></div>
<div><font class="Apple-style-span" color="#FF0000">[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -&gt; forcing low_delay flag</font></div><div><font class="Apple-style-span" color="#FF0000">[mpeg4 @ 0x9376c10]picture size invalid (0x0)</font></div>
<div><font class="Apple-style-span" color="#FF0000">[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))</font></div><div><font class="Apple-style-span" color="#FF6666">[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)</font></div>
<div><font class="Apple-style-span" color="#FF6666">LAVF_header: av_find_stream_info() failed</font></div><div><font class="Apple-style-span" color="#FF6666">ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2</font></div>
<div><font class="Apple-style-span" color="#FF6666">Quicktime/MOV file format detected.</font></div><div><font class="Apple-style-span" color="#FF6666">[mov] Video stream found, -vid 0</font></div><div><font class="Apple-style-span" color="#FF6666">VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)</font></div>
<div><font class="Apple-style-span" color="#FF6666">open: No such file or directory</font></div><div><font class="Apple-style-span" color="#FF6666">[MGA] Couldn&#39;t open: /dev/mga_vid</font></div><div><font class="Apple-style-span" color="#FF6666">open: No such file or directory</font></div>
<div><font class="Apple-style-span" color="#FF6666">[MGA] Couldn&#39;t open: /dev/mga_vid</font></div><div><font class="Apple-style-span" color="#FF6666">[VO_TDFXFB] Can&#39;t open /dev/fb0: Permission denied.</font></div>
<div><font class="Apple-style-span" color="#FF6666">[VO_3DFX] Unable to open /dev/3dfx.</font></div><div><font class="Apple-style-span" color="#FF6666">==========================================================================</font></div>
<div><font class="Apple-style-span" color="#FF6666">Opening video decoder: [ffmpeg] FFmpeg&#39;s libavcodec codec family</font></div><div><font class="Apple-style-span" color="#FF6666">Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)</font></div>
<div><font class="Apple-style-span" color="#FF6666">==========================================================================</font></div><div><font class="Apple-style-span" color="#FF6666">Audio: no sound</font></div><div>
<font class="Apple-style-span" color="#FF6666">Starting playback...</font></div><div><font class="Apple-style-span" color="#FF6666">VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)</font></div><div>
<font class="Apple-style-span" color="#FF6666">VDec: using Planar YV12 as output csp (no 0)</font></div><div><font class="Apple-style-span" color="#FF6666">Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.</font></div>
<div><font class="Apple-style-span" color="#FF6666">VO: [xv] 640x480 =&gt; 640x480 Planar YV12 </font></div><div><font class="Apple-style-span" color="#FF6666">V:   0.0 200/200 ??% ??% ??,?% 0 0 </font></div><div><font class="Apple-style-span" color="#FF6666"><br>
</font></div><div><font class="Apple-style-span" color="#FF6666">Exiting... (End of file)</font></div><div><br></div><div><div><div>But the error info not like the old one!</div><div><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 9:17 PM, liJin <span dir="ltr">&lt;<a href="mailto:lijinsyam@gmail.com">lijinsyam@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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 color="#FF0000"> -e</font> </b>option<br><br></div><div><div></div><div class="h5"><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" target="_blank">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>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>&#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>&#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><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><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" target="_blank">braunsquared@gmail.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:braunsquared@gmail.com" target="_blank">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" target="_blank">wl2776@gmail.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:wl2776@gmail.com" target="_blank">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" target="_blank">mcygogo@gmail.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:mcygogo@gmail.com" target="_blank">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" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div>&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" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
</div>&gt; &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div><div></div><div>&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" target="_blank">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>
</div></div><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>
<br></blockquote></div><br></div></div></div>