how to create a pipeline to record video from camera?

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

how to create a pipeline to record video from camera?

michael young
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
anyone help?

On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

lijinshyam
Hi ...Michael

        I am not an expert ....but i think this will help 

          gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

 

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
anyone help?


On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

Timothy Braun
Be careful with the capsfilter you have in there. If that isn't the actual caps of the stream it will never preroll.  The camera will be the deciding factor for the caps of this stream. If the results you are looking for match the caps below, I would add a videorate, videoscale and ffmpeg_colorspace before the capsfilter. 

Best of luck,
Tim

Sent from my iPhone

On Dec 22, 2010, at 12:29 AM, liJin <[hidden email]> wrote:

Hi ...Michael

        I am not an expert ....but i think this will help 

          gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

 

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
anyone help?


On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
tks, this is work:   gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

On Wed, Dec 22, 2010 at 1:36 PM, Timothy Braun <[hidden email]> wrote:
Be careful with the capsfilter you have in there. If that isn't the actual caps of the stream it will never preroll.  The camera will be the deciding factor for the caps of this stream. If the results you are looking for match the caps below, I would add a videorate, videoscale and ffmpeg_colorspace before the capsfilter. 

Best of luck,
Tim

Sent from my iPhone

On Dec 22, 2010, at 12:29 AM, liJin <[hidden email]> wrote:

Hi ...Michael

        I am not an expert ....but i think this will help 

          gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

 

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email][hidden email]> wrote:
anyone help?


On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email][hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
And now , I want to record the video to a MP4 file with the h264 encoding format  ,  How can I do ?

On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]> wrote:
tks, this is work:   gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink


On Wed, Dec 22, 2010 at 1:36 PM, Timothy Braun <[hidden email]> wrote:
Be careful with the capsfilter you have in there. If that isn't the actual caps of the stream it will never preroll.  The camera will be the deciding factor for the caps of this stream. If the results you are looking for match the caps below, I would add a videorate, videoscale and ffmpeg_colorspace before the capsfilter. 

Best of luck,
Tim

Sent from my iPhone

On Dec 22, 2010, at 12:29 AM, liJin <[hidden email]> wrote:

Hi ...Michael

        I am not an expert ....but i think this will help 

          gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

 

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email][hidden email]> wrote:
anyone help?


On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email][hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

lijinshyam

 Try this.....

gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! ffenc_mpeg4 ! avimux ! filesink location=1.mp4

Here i encoded in to mpeg4 format in mp4 container ..If you want h264 stream then ..replace ffenc_mpeg4...

Reagrds
LiJin







On Wed, Dec 22, 2010 at 11:58 AM, michael <[hidden email]> wrote:
And now , I want to record the video to a MP4 file with the h264 encoding format  ,  How can I do ?


On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]> wrote:
tks, this is work:   gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink


On Wed, Dec 22, 2010 at 1:36 PM, Timothy Braun <[hidden email]> wrote:
Be careful with the capsfilter you have in there. If that isn't the actual caps of the stream it will never preroll.  The camera will be the deciding factor for the caps of this stream. If the results you are looking for match the caps below, I would add a videorate, videoscale and ffmpeg_colorspace before the capsfilter. 

Best of luck,
Tim

Sent from my iPhone

On Dec 22, 2010, at 12:29 AM, liJin <[hidden email]> wrote:

Hi ...Michael

        I am not an expert ....but i think this will help 

          gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink

 

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email][hidden email]> wrote:
anyone help?


On Tue, Dec 21, 2010 at 4:20 PM, michael <[hidden email][hidden email]> wrote:
Hi all:
     I want to record the video from my book's camera, and is there one pipeline can do this? tks :)


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

wl2776
Administrator
In reply to this post by michael young
michael young wrote
And now , I want to record the video to a MP4 file with the h264 encoding
format  ,  How can I do ?

On Wed, Dec 22, 2010 at 2:26 PM, michael <mcygogo@gmail.com> wrote:

> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
Looks like you can't, because h264 encoder is unavailable.
gst-inspect | grep h264
doesn't show it.
However, general idea is to encode, then mux, and then save to a file.
gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 ! mp4mux !filesink location=/home/user/file.
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

Timothy Braun
H264 is encoded with x264enc element.

Sent from my iPhone

On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]> wrote:

>
>
> michael young wrote:
>>
>> And now , I want to record the video to a MP4 file with the h264 encoding
>> format  ,  How can I do ?
>>
>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]> wrote:
>>
>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>>
>>
>
> Looks like you can't, because h264 encoder is unavailable.
> gst-inspect | grep h264
> doesn't show it.
> However, general idea is to encode, then mux, and then save to a file.
> gst-launch v4l2src device=/dev/video0 !
> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
> mp4mux !filesink location=/home/user/file.
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Forrester recently released a report on the Return on Investment (ROI) of
> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
> within 7 months.  Over 3 million businesses have gone Google with Google Apps:
> an online email calendar, and document program that's accessible from your
> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
Now I can record the video to a AVI file with mpeg4 encoding by :
gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
framerate=30/1' ! ffmpegcolorspace !
ffenc_mpeg4 ! avimux ! filesink
location=record.avi


But I got two issues:
1: I want record as a MP4 file, I do it like this:
gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 !
mp4mux ! filesink
location=record.avi

I can record the video , but when I playback it by mplayer, I got a error:
Playing ./record.mp4.
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
LAVF_header: av_open_input_stream() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2


2: I want encode the video to H264, so I do like this:
gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! x264enc ! avimux ! filesink location=record.avi
But when I run the pipeline I just get the error info like this:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2550): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 1727716724 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...


Some one can help me fix the issues? Tks :)


On 12/22/10, Timothy Braun <[hidden email]> wrote:
> H264 is encoded with x264enc element.
>
> Sent from my iPhone
>
> On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]> wrote:
>
>>
>>
>> michael young wrote:
>>>
>>> And now , I want to record the video to a MP4 file with the h264 encoding
>>> format  ,  How can I do ?
>>>
>>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]> wrote:
>>>
>>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>>>
>>>
>>
>> Looks like you can't, because h264 encoder is unavailable.
>> gst-inspect | grep h264
>> doesn't show it.
>> However, general idea is to encode, then mux, and then save to a file.
>> gst-launch v4l2src device=/dev/video0 !
>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>> mp4mux !filesink location=/home/user/file.
>>
>> --
>> View this message in context:
>> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Forrester recently released a report on the Return on Investment (ROI) of
>> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>> within 7 months.  Over 3 million businesses have gone Google with Google
>> Apps:
>> an online email calendar, and document program that's accessible from your
>>
>> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
> ------------------------------------------------------------------------------
> Forrester recently released a report on the Return on Investment (ROI) of
> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
> within 7 months.  Over 3 million businesses have gone Google with Google
> Apps:
> an online email calendar, and document program that's accessible from your
> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

Santakivi Topi
On 12/22/2010 12:18 PM, michael wrote:

> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email]
> <mailto:[hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email]
> <mailto:[hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

lijinshyam
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email]
> <mailto:[hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email]
> <mailto:[hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
In reply to this post by Santakivi Topi
Hi Santakivi:
    I have tried your method, 
1: I run it like this:
gst-launch videotestsrc num-buffers=200  ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=record.mp4
then, I can got a right MP4 file, and I can palyback it. But I record the video from my capture like this:
gst-launch v4l2src num-buffers=200  ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=record.mp4
I also got a file , But it cannot playback , I just get info like this:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9958c10]Error, header damaged or not MPEG4 header (f_code=0)
[mpeg4 @ 0x9958c10]header damaged
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9957640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

2: I run this:
gst-launch v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,framerate=30/1' ! ffmpegcolorspace ! x264enc ! avimux ! filesink location=record.avi
But I just got error like this:
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2755): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...
I don't know the fourcc means what, then I modified it to this:
 gst-launch v4l2src ! 'video/x-raw-yuv,format=I420,width=320,height=240,framerate=30/1' ! ffmpegcolorspace ! x264enc ! avimux ! filesink location=record.avi
But I just got warning like this:
WARNING: erroneous pipeline: could not link v4l2src0 to ffmpegcsp0
and cannot record the video. And I replaced the format I420 to others just like YVU9 YV12 and
 so on what I found by: gst-inspect v4l2src, but there is no one can work :(


On Wed, Dec 22, 2010 at 8:31 PM, Santakivi Topi <[hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email]
> <mailto:[hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email]
> <mailto:[hidden email]>


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
In reply to this post by lijinshyam
I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email]
> <mailto:[hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email]
> <mailto:[hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

Timothy Braun
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email]
> <mailto:[hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email]
> <mailto:[hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email]
> <mailto:[hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email]
> <mailto:[hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
I have tested changing the muxer to qtmux, but it still not work

On Wed, Dec 22, 2010 at 10:58 PM, Timothy Braun <[hidden email]> wrote:
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email][hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email][hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

Timothy Braun
Not qtmux, use mp4mux.

On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
I have tested changing the muxer to qtmux, but it still not work


On Wed, Dec 22, 2010 at 10:58 PM, Timothy Braun <[hidden email]> wrote:
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email][hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email][hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
neither qtmux nor mp4mux is not work well

On Wed, Dec 22, 2010 at 11:24 PM, Timothy Braun <[hidden email]> wrote:
Not qtmux, use mp4mux.


On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
I have tested changing the muxer to qtmux, but it still not work


On Wed, Dec 22, 2010 at 10:58 PM, Timothy Braun <[hidden email]> wrote:
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email][hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email][hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

michael young
Is there nobody know how to record video from camera to a MP4 container with the H264 encoding ?

On Thu, Dec 23, 2010 at 9:46 AM, michael <[hidden email]> wrote:
neither qtmux nor mp4mux is not work well


On Wed, Dec 22, 2010 at 11:24 PM, Timothy Braun <[hidden email]> wrote:
Not qtmux, use mp4mux.


On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
I have tested changing the muxer to qtmux, but it still not work


On Wed, Dec 22, 2010 at 10:58 PM, Timothy Braun <[hidden email]> wrote:
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email][hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email][hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to create a pipeline to record video from camera?

lijinshyam
Hi


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! x264enc ! mp4mux ! filesink location=1.mp4

This pipeline working fine  (4 me)......:)


On Thu, Dec 23, 2010 at 12:08 PM, michael <[hidden email]> wrote:
Is there nobody know how to record video from camera to a MP4 container with the H264 encoding ?


On Thu, Dec 23, 2010 at 9:46 AM, michael <[hidden email]> wrote:
neither qtmux nor mp4mux is not work well


On Wed, Dec 22, 2010 at 11:24 PM, Timothy Braun <[hidden email]> wrote:
Not qtmux, use mp4mux.


On Wed, Dec 22, 2010 at 10:10 AM, michael <[hidden email]> wrote:
I have tested changing the muxer to qtmux, but it still not work


On Wed, Dec 22, 2010 at 10:58 PM, Timothy Braun <[hidden email]> wrote:
I was never able to get the ffmpeg mpeg4 mixer to work quite right. I found that mp4mux, an extension of qtmux, works much better. If you inspect the ffmpeg mp4 muxer they actually suggest that you use a different one as it's unstable. 

Best,
Tim

Sent from my iPhone

On Dec 22, 2010, at 8:27 AM, michael <[hidden email]> wrote:

I just ran it :
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
And got a mp4 file , but it still cannot be playbacked, and give the error info:
Playing record.mp4.
libavformat file format detected.
[mpeg4 @ 0x9376c10]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x9376c10]my guess is 5 bits ;)
[mpeg4 @ 0x9376c10]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x9376c10]picture size invalid (0x0)
[mpeg4 @ 0x9376c10]get_buffer() failed (-1 0 0 (nil))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9375640]Could not find codec parameters (Video: mpeg4, yuv420p)
LAVF_header: av_find_stream_info() failed
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO:  [mp4v]  640x480  24bpp    inf fps    0.0 kbps ( 0.0 kbyte/s)
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: Permission denied.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Planar YV12 
V:   0.0 200/200 ??% ??% ??,?% 0 0 

Exiting... (End of file)

But the error info not like the old one!

On Wed, Dec 22, 2010 at 9:17 PM, liJin <[hidden email][hidden email]> wrote:
I think thats the issue...


gst-launch -e v4l2src ! 'video/x-raw-yuv,width=320,height=240, framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux ! filesink location=1.mp4

run with -e option



On Wed, Dec 22, 2010 at 6:01 PM, Santakivi Topi <[hidden email][hidden email]> wrote:
On 12/22/2010 12:18 PM, michael wrote:
> Now I can record the video to a AVI file with mpeg4 encoding by :
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4! avimux! filesink
> location=record.avi
>
> But I got two issues:
> 1: I want record as a MP4 file, I do it like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! ffenc_mpeg4 ! mp4mux! filesink
> location=record.avi
> I can record the video , but when I playback it by mplayer, I got a error:
> Playing ./record.mp4.
> libavformat file format detected.
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x8741640]moov atom not found
> LAVF_header: av_open_input_stream() failed
> ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2

When recording, with the above gst-launch line, do you stop
the pipeline with Ctrl+C..?

It could be that the file container doesn't get fully written
in case of such an interrupt and that's why the clip doesn't play.

For example, if you use this pipeline and
stop it with Ctrl+C, the clip doesn't play:

gst-launch-0.10 videotestsrc !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

But this pipeline produces a valid video file:

gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,width=320,height=240,framerate=30/1' ! ffmpegcolorspace
! ffenc_mpeg4 ! mp4mux ! filesink location=test.mp4

>
> 2: I want encode the video to H264, so I do like this:
> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,
> framerate=30/1' ! ffmpegcolorspace ! x264enc! avimux ! filesink
> location=record.avi

How about adding the format to the caps, e.g .
v4l2src ! 'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,
framerate=30/1' ! fmpegcolorspace ! x264enc! avimux ! filesink
location=record.avi ?

BR,
Topi

> But when I run the pipeline I just get the error info like this:
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2550): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 1727716724 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Some one can help me fix the issues? Tks :)
>
>
> On 12/22/10, Timothy Braun <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  > H264 is encoded with x264enc element.
>  >
>  > Sent from my iPhone
>  >
>  > On Dec 22, 2010, at 3:10 AM, wl2776 <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >
>  >>
>  >>
>  >> michael young wrote:
>  >>>
>  >>> And now , I want to record the video to a MP4 file with the h264
> encoding
>  >>> format  ,  How can I do ?
>  >>>
>  >>> On Wed, Dec 22, 2010 at 2:26 PM, michael <[hidden email][hidden email]
> <mailto:[hidden email][hidden email]>> wrote:
>  >>>
>  >>>> tks, this is work:   gst-launch v4l2src device=/dev/video0 !
>  >>>> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
>  >>>
>  >>>
>  >>
>  >> Looks like you can't, because h264 encoder is unavailable.
>  >> gst-inspect | grep h264
>  >> doesn't show it.
>  >> However, general idea is to encode, then mux, and then save to a file.
>  >> gst-launch v4l2src device=/dev/video0 !
>  >> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' !  ffenc_mpeg4 !
>  >> mp4mux !filesink location=/home/user/file.
>  >>
>  >> --
>  >> View this message in context:
>  >>
> http://gstreamer-devel.966125.n4.nabble.com/how-to-create-a-pipeline-to-record-video-from-camera-tp3134399p3160261.html
>  >> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>  >>
>  >>
> ------------------------------------------------------------------------------
>  >> Forrester recently released a report on the Return on Investment
> (ROI) of
>  >> Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  >> within 7 months.  Over 3 million businesses have gone Google with Google
>  >> Apps:
>  >> an online email calendar, and document program that's accessible
> from your
>  >>
>  >> browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  >> _______________________________________________
>  >> gstreamer-devel mailing list
>  >> [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >
>  >
> ------------------------------------------------------------------------------
>  > Forrester recently released a report on the Return on Investment (ROI) of
>  > Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
>  > within 7 months.  Over 3 million businesses have gone Google with Google
>  > Apps:
>  > an online email calendar, and document program that's accessible from
> your
>  > browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
>  > _______________________________________________
>  > gstreamer-devel mailing list
>  > [hidden email][hidden email]
> <mailto:[hidden email][hidden email]>
>  > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  >

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email][hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
12