I think thats the issue...<div><br></div><div><br></div><div>gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! 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"><<a href="mailto:Topi.Santakivi@digia.com">Topi.Santakivi@digia.com</a>></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>
> Now I can record the video to a AVI file with mpeg4 encoding by :<br>
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,<br>
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink<br>
> location=record.avi<br>
><br>
> But I got two issues:<br>
> 1: I want record as a MP4 file, I do it like this:<br>
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,<br>
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink<br>
> location=record.avi<br>
> I can record the video , but when I playback it by mplayer, I got a error:<br>
> Playing ./record.mp4.<br>
> libavformat file format detected.<br>
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found<br>
> LAVF_header: av_open_input_stream() failed<br>
> 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't get fully written<br>
in case of such an interrupt and that's why the clip doesn't play.<br>
<br>
For example, if you use this pipeline and<br>
stop it with Ctrl+C, the clip doesn't play:<br>
<br>
gst-launch-0.10 videotestsrc !<br>
<div class="im">'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! 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">'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace<br>
</div>! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4<br>
<div class="im"><br>
><br>
> 2: I want encode the video to H264, so I do like this:<br>
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,<br>
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink<br>
> location=record.avi<br>
<br>
</div>How about adding the format to the caps, e.g .<br>
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,<br>
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink<br>
location=record.avi ?<br>
<br>
BR,<br>
Topi<br>
<div class="im"><br>
> But when I run the pipeline I just get the error info like this:<br>
> Setting pipeline to PAUSED ...<br>
> Pipeline is live and does not need PREROLL ...<br>
> Setting pipeline to PLAYING ...<br>
> New clock: GstSystemClock<br>
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal<br>
> data flow error.<br>
> Additional debug info:<br>
> gstbasesrc.c(2550): gst_base_src_loop ():<br>
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:<br>
> streaming task paused, reason not-negotiated (-4)<br>
> Execution ended after 1727716724 ns.<br>
> Setting pipeline to PAUSED ...<br>
> Setting pipeline to READY ...<br>
> Setting pipeline to NULL ...<br>
> Freeing pipeline ...<br>
><br>
> Some one can help me fix the issues? Tks :)<br>
><br>
><br>
> On 12/22/10, Timothy Braun <<a href="mailto:braunsquared@gmail.com">braunsquared@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:braunsquared@gmail.com">braunsquared@gmail.com</a>>> wrote:<br>
> > H264 is encoded with x264enc element.<br>
> ><br>
> > Sent from my iPhone<br>
> ><br>
> > On Dec 22, 2010, at 3:10 AM, wl2776 <<a href="mailto:wl2776@gmail.com">wl2776@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:wl2776@gmail.com">wl2776@gmail.com</a>>> wrote:<br>
> ><br>
> >><br>
> >><br>
> >> michael young wrote:<br>
> >>><br>
> >>> And now , I want to record the video to a MP4 file with the h264<br>
> encoding<br>
> >>> format , How can I do ?<br>
> >>><br>
> >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <<a href="mailto:mcygogo@gmail.com">mcygogo@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:mcygogo@gmail.com">mcygogo@gmail.com</a>>> wrote:<br>
> >>><br>
> >>>> tks, this is work: gst-launch v4l2src device=/dev/video0 !<br>
> >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink<br>
> >>><br>
> >>><br>
> >><br>
> >> Looks like you can't, because h264 encoder is unavailable.<br>
> >> gst-inspect | grep h264<br>
> >> doesn't show it.<br>
> >> However, general idea is to encode, then mux, and then save to a file.<br>
> >> gst-launch v4l2src device=/dev/video0 !<br>
> >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! ffenc_mpeg4 !<br>
> >> mp4mux !filesink location=/home/user/file.<br>
> >><br>
> >> --<br>
> >> View this message in context:<br>
> >><br>
> <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>
> >> Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
> >><br>
> >><br>
> ------------------------------------------------------------------------------<br>
> >> Forrester recently released a report on the Return on Investment<br>
> (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<br>
> >> Apps:<br>
> >> an online email calendar, and document program that's accessible<br>
> from your<br>
> >><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>
</div>> <mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>><br>
<div class="im">> >> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
> ><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<br>
> > Apps:<br>
> > an online email calendar, and document program that's accessible from<br>
> 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>
</div>> <mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>><br>
<div><div></div><div class="h5">> > <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
> ><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'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>