Now I can record the video to a <font class="Apple-style-span" color="#FF0000">AVI</font> file with <font class="Apple-style-span" color="#FF0000">mpeg4</font> encoding by :<br><font class="Apple-style-span" color="#000099">gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,<br>
framerate=30/1' ! ffmpegcolorspace ! </font><font class="Apple-style-span" color="#FF0000">ffenc_mpeg4</font><font class="Apple-style-span" color="#000099"> ! </font><font class="Apple-style-span" color="#FF0000">avimux</font><font class="Apple-style-span" color="#000099"> ! filesink<br>
location=record.avi</font><br><br><font class="Apple-style-span" color="#FF0000">But I got two issues:</font><br>1: I want record as a <font class="Apple-style-span" color="#FF0000">MP4</font> file, I do it like this:<br>
<font class="Apple-style-span" color="#000099">gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,<br>framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! </font><font class="Apple-style-span" color="#FF0000">mp4mux</font><font class="Apple-style-span" color="#000099"> ! filesink<br>
location=record.avi</font><br>I can record the video , but when I playback it by mplayer, I got a error:<br><font class="Apple-style-span" color="#FF0000">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</font><br><br>2: I want encode the video to <font class="Apple-style-span" color="#FF0000">H264</font>, so I do like this:<br>
<font class="Apple-style-span" color="#000099">gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! </font><font class="Apple-style-span" color="#FF0000">x264enc</font><font class="Apple-style-span" color="#000099"> ! avimux ! filesink location=record.avi</font><br>
But when I run the pipeline I just get the error info like this:<br><font class="Apple-style-span" color="#FF0000">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 data flow error.<br>Additional debug info:<br>gstbasesrc.c(2550): gst_base_src_loop (): /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 ...</font><br>
<br><div>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>> 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>> 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 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>> 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>>> <a href="http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html">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>>> 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 your<br>
>><br>>> browser. Read the Forrester report: <a href="http://p.sf.net/sfu/googleapps-sfnew">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">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><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 your<br>> browser. Read the Forrester report: <a href="http://p.sf.net/sfu/googleapps-sfnew">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">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
><br></div>