REg: Streaming and Recording Simultaneously

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

REg: Streaming and Recording Simultaneously

3,614 Views
vishvapathi
Contributor V

Hi All,

I used the below command to record the video from a UVC CAM, it records. But the size is too large. How to add encoding to this??

gst-launch-0.10 v4l2src device=/dev/video0 ! video/x-raw-yuv,width=352,height=288 ! avimux ! filesink location=test0.avi

Below command i used for streaming a single CAM.. it works fine... How to so streaming and recording at same time... read in the abv link should add "tee".. can someone share any documents regarding this??

gst-launch v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! mfw_isink disp-width=450 disp-height=300  axis-left=50 axis-top=100

And for $gst-launch v4l2src num-buffers=-1 ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

No such IOCTL, cmd is 22032

No such IOCTL, cmd is 22032

Setting pipeline to PAUSED ...

[INFO]  Product Info: i.MX6Q/D/S

vpuenc versions :smileyhappy:

        plugin: 3.0.7

        wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Feb 14 2014 12:45:49)

        vpulib: 5.4.16

        firmware: 2.3.10.40778

ERROR: Pipeline doesn't want to pause.

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negott

Additional debug info:

gstbasesrc.c(2787): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4:

Check your filtered caps, if any

Setting pipeline to NULL ...

Freeing pipeline ...

I get the above ERROR

Any suggestions is appreciated!!!!!!!!!!!

DaianeAngolini

shanmugamsundar

Labels (3)
19 Replies

2,176 Views
shanmugamsundar
Contributor IV

try using this command

gst-launch mfw_v4lsrc fps-n=30 capture-width=640 capture-height=480 capture-mode=0  ! queue ! mfw_vpuencoder codec-type=0 ! avimux ! filesink location=shan3.avi sync=false

Thanks

shan

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi Shan,

$ gst-launch mfw_v4lsrc fps-n=30 capture-width=640 capture-height=480 capture-mode=0  ! queue ! mfw_vpuencoder codec-type=0 ! avimux ! filesink location=shan3.avi sync=false

MFW_GST_V4LSRC_PLUGIN 3.0.7 build on Feb 14 2014 12:47:21.

WARNING: erroneous pipeline: no property "capture-width" in element "mfwgstv4ls"

I am getting the above warning...

0 Kudos

2,176 Views
shanmugamsundar
Contributor IV

hi viswa,

    which multimedia codec version you are using is it 11.09 or ?

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi,

$gst-inspect | grep mfw

mpeg2dec.imx:  mfw_mpeg2decoder: mpeg2 video decoder

h264.imx:  mfw_h264decoder: h264 video decoder

mpeg4dec.imx:  mfw_mpeg4aspdecoder: mpeg4 video decoder

amrdec.imx:  mfw_amrdecoder: amr audio decoder

mp3enc.imx:  mfw_mp3encoder: mp3 audio encoder

audiopeq.imx:  mfw_audio_pp: audio post equalizer

v4lsrc.imx:  mfw_v4lsrc: v4l2 based camera src

v4lsink.imx:  mfw_v4lsink: v4l2 video sink

isink.imx:  mfw_isink: IPU-based video sink

ipucsc.imx:  mfw_ipucsc: IPU-based video converter

I dont hav mfw_vpuencoder: mfw_vpuencoder: Freescale: Hardware (VPU) Encoder installed i guess!!!

0 Kudos

2,176 Views
Yuri
NXP Employee
NXP Employee

For i.MX6  codec prefix "mfw" is not used; elements re mnamed just as "vpudec", "vpuenc"

gst-inspect | grep imx

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi Yuri,

         I tried the below command...

$gst-launch v4l2src always-copy=false queue-size=16 num-buffers=900 ! queue ! capsfilter caps='video/x-raw-yuv,format=(fourcc)YUY2, width=640, height=480,framerate=30/1' ! ffmpegcolorspace ! capsfilter caps='video/x-raw-yuv,format=(fourcc)I420, width=640, height=480' ! vpuenc ! avimux! filesink location= /home/test.avi

RESPONSE ON SCREEN

No such IOCTL, cmd is 22032

No such IOCTL, cmd is 22032

Setting pipeline to PAUSED ...

[INFO]  Product Info: i.MX6Q/D/S                                               

vpuenc versions :smileyhappy:                                                             

        plugin: 3.0.7                                                          

        wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Feb 14 2014 12:45:49)    

        vpulib: 5.4.16                                                         

        firmware: 2.3.10.40778                                                 

Pipeline is live and does not need PREROLL ...                                 

Setting pipeline to PLAYING ...                                                

New clock: GstSystemClock                                                      

[INFO]  chromaInterleave 0, mapType 0, linear2TiledEnable 0

And the processor doesnt respond for any action....

0 Kudos

2,176 Views
Yuri
NXP Employee
NXP Employee

First, please try simplified  command :

$gst-launch v4l2src  ! ffmpegcolorspace !  vpuenc ! avimux! filesink location= /home/test.avi

then we can insert more details in order to define what option provides the problem.

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi Yuri,

   After issuing the above command the processor doesnt respond for any command or interrupt. It hangs/freezes

$ gst-launch v4l2src device=/dev/video1 ! ffmpegcolorspace !  vpuenc ! avimux! filesink location= /home/test.avi

No such IOCTL, cmd is 22032                                                    

No such IOCTL, cmd is 22032                                                    

Setting pipeline to PAUSED ...                                                 

[INFO]  Product Info: i.MX6Q/D/S                                               

vpuenc versions :smileyhappy:                                                             

        plugin: 3.0.7                                                          

        wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Feb 14 2014 12:45:49)    

        vpulib: 5.4.16                                                         

        firmware: 2.3.10.40778                                                 

Pipeline is live and does not need PREROLL ...                                 

Setting pipeline to PLAYING ...                                                

New clock: GstSystemClock                                                      

[INFO]  chromaInterleave 1, mapType 0, linear2TiledEnable 0

I have to restart manually to make it work again...

0 Kudos

2,176 Views
Yuri
NXP Employee
NXP Employee

In the beginning of the thread :


$ gst-launch v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! mfw_isink disp-width=450 disp-height=300  axis-left=50 axis-top=100

it is stated this works ? correct ?

0 Kudos

2,176 Views
vishvapathi
Contributor V

Yes... the below command works fine... its streams from the CAM...  until i giv ctrl+c...

$ gst-launch v4l2src device=/dev/video1 ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! mfw_isink disp-width=450 disp-height=300  axis-left=50 axis-top=100

MAX resolution 1024x768

set color key

MFW_GST_ISINK_PLUGIN 3.0.7 build on Feb 14 2014 12:47:47.

Setting pipeline to PAUSED ...

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

New clock: GstSystemClock

hwbuf allocator zone(155648) created

hwbuf allocator zone(155648) destroied.

can not create threadmfw_gst_isink_setcaps:1489

hwbuf allocator zone(155648) created

hwbuf allocator zone(155648) destroied.

hwbuf allocator zone(155648) created

VS0 created. in fmt[YUYV] win(0,0-320,240:320x240) out win(50,100-500,400:450x300)

set deinterlace mode 0

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi Yuri,

The below command works..

gst-launch --eos-on-shutdown v4l2src device="/dev/video1" ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! jpegenc ! avimux ! filesink location=video.avi

For a 7 second video the size is 6.3MB. I am not sure whether the Encoding technique is actually happening..

Any Suggestions?

0 Kudos

2,176 Views
Yuri
NXP Employee
NXP Employee

  First, the GST element " jpegenc" relates to software implementation (via ARM core instructions,

without  VPU support). Obe can use the next element (mjpg - image/jpeg) : ! vpuenc  codec=12 !

  Next, MJPEG  provides separate frames encoding, without using correlations between frames,

therefore compression ratio is not so good as - say -  for H.264.

0 Kudos

2,176 Views
vishvapathi
Contributor V

My Device Hangs/Freezes for the below command


$ gst-launch v4l2src device=/dev/video1 ! ffmpegcolorspace !  vpuenc ! matroskamux ! filesink location= /home/test.mkv                        
No such IOCTL, cmd is 22032                                                    
No such IOCTL, cmd is 22032                                                    
Setting pipeline to PAUSED ...                                                 
[INFO]  Product Info: i.MX6Q/D/S                                               
vpuenc versions :smileyhappy:                                                             
        plugin: 3.0.7                                                          
         wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Feb 14 2014 12:45:49)    
        vpulib: 5.4.16                                                         
        firmware: 2.3.10.40778                                                 
Pipeline is live and does not need PREROLL ...                                 
Setting pipeline to PLAYING ...                                                
New clock: GstSystemClock                                                      
[INFO]  chromaInterleave 1, mapType 0, linear2TiledEnable 0

Can anyone give me pointers about why this issue is happening????

Tarek

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi All,

Attaching Log file...

partial log file...

Complete log file attached....

stat: /usr/lib/gvfsd (error: No such file or directory)

0:01:38.528375912  2747    0x17050 LOG       GST_PLUGIN_LOADING gstplugin.c:1651:gst_plugin_ext_dep_scan_path_with_filenames:<plugin8> stat: /qt/lib/gvfsd (error: No such file or directory)

0:01:38.528765246  2747    0x17050 LOG       GST_PLUGIN_LOADING gstplugin.c:1651:gst_plugin_ext_dep_scan_path_with_filenames:<plugin8> stat: /usr/local/lib/gvfsd (error: No such file or directory)

0:01:38.529151246  2747    0x17050 LOG       GST_PLUGIN_LOADING gstplugin.c:1651:gst_plugin_ext_dep_scan_path_with_filenames:<plugin8> stat: /home/vishva/Desktop/L3.0.35_4.1.0_130816_source/yes/ltib/rootfs/usr/lib/gvfsd (error: No such file or directory)

0:01:38.529432246  2747    0x17050 LOG       GST_PLUGIN_LOADING gstplugin.c:1710:gst_plugin_ext_dep_get_stat_hash:<plugin8> done, scan_hash:

And it stops after the below data....

[INFO]    chromaInterleave 1, mapType 0, linear2TiledEnable 0

0:03:39.782497926  2747    0xc7d70 INFO                  vpuenc vpuenc.c:1175:gst_vpuenc_chain: get vpuenc require 4 frames.

0:03:39.887960927  2747    0xc7d70 LOG                   vpuenc vpuenc.c:1205:gst_vpuenc_chain: chain in with inbuffer size = 1843

0 Kudos

2,176 Views
Yuri
NXP Employee
NXP Employee

I just tried the next command

$ gst-launch v4l2src device=/dev/video0 ! ffmpegcolorspace ! vpuenc ! matroskamux ! filesink location= /home/test.mkv

under the following environment :

- SDP board ;

- Linux L3_0_35_4_1_0 ;

- IMX_MMCODEC_3.0.35_4.1.0 codec package.

And the issue is not reprodusible. 

What is different in Your system ?

0 Kudos

2,176 Views
vishvapathi
Contributor V
Hi Yuri,

       I have MARS board with IMX processor from Embest Technologies.
- Linux L3.0.35_4.1.0_130816
- Multi-media:IMX_MMCODEC_3.0.35_4.1.0_BUNDLE_CODA

I guess it is as same as your configuration.

0 Kudos

2,176 Views
vishvapathi
Contributor V

Hi,

LeonardoSandovalGonzalez

For video from Webcam i am getting the following error...

$ gst-launch v4l2src device=/dev/video1 num-buffers=-1 ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

No such IOCTL, cmd is 22032

No such IOCTL, cmd is 22032

Setting pipeline to PAUSED ...

[INFO]  Product Info: i.MX6Q/D/S

vpuenc versions :smileyhappy:

        plugin: 3.0.7

        wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Feb 14 2014 12:45:49)

        vpulib: 5.4.16

        firmware: 2.3.10.40778

ERROR: Pipeline doesn't want to pause.

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negott

Additional debug info:

gstbasesrc.c(2787): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4:

Check your filtered caps, if any

Setting pipeline to NULL ...

Freeing pipeline ...


LeonardoSandovalGonzalez

0 Kudos

2,176 Views
daiane_angolini
NXP Employee
NXP Employee

cool

let us know

0 Kudos

2,176 Views
daiane_angolini
NXP Employee
NXP Employee

1) how to set camera resolution:

You can see gst-inspect v4lsrc and look for the resolution parameters

Don´t forget to use the same for mux and encoder

2)

tee

GStreamer-devel - Good example to show usage of tee

0 Kudos