videoscale fails with v4l2src

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

videoscale fails with v4l2src

Gabriel Johnson
Hello,

I am trying to scale a v4l2src but when I add videoscale to the path
something doesn't work correctly.  When I use the command
`gst-launch v4l2src !
video/x-raw-rgb,bpp=16,depth=16,width=720,height=512 ! fakesink`
everything works fine.  When I try and use the command
`gst-launch v4l2src !
video/x-raw-rgb,bpp=16,depth=16,width=720,height=512 ! videoscale !
fakesink`
I get the error "ERROR: from element
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate
format".

GST_DEBUG=GST_PAD*:5 gives me the following messages pertaining to the v4l2src
0:00:03.207476000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:851:gst_pad_activate_push:<capsfilter0:sink> trying to set
activated in push mode
0:00:03.207857000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:871:gst_pad_activate_push:<capsfilter0:sink> activating pad
from none
0:00:03.208229000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:581:pre_activate:<capsfilter0:sink> setting ACTIVATE_MODE 1,
unset flushing
0:00:03.208627000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:907:gst_pad_activate_push:<capsfilter0:sink> activated in
push mode
0:00:03.209278000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:658:gst_pad_set_active:<v4l2src0:src> activating pad from
none
0:00:03.209663000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:851:gst_pad_activate_push:<v4l2src0:src> trying to set
activated in push mode
0:00:03.210030000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:871:gst_pad_activate_push:<v4l2src0:src> activating pad from
none
0:00:03.210379000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:581:pre_activate:<v4l2src0:src> setting ACTIVATE_MODE 1,
unset flushing
0:00:03.214782000  2122 0x10046050 INFO              GST_PADS
gstpad.c:927:gst_pad_activate_push:<v4l2src0:src> failed to activate
in push mode
0:00:03.215182000  2122 0x10046050 WARN              GST_PADS
gstpad.c:685:gst_pad_set_active:<v4l2src0:src> Failed to activate pad

GST_DEBUG=v4l2src*:5 Gives me the following:
0:00:02.871845000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:553:gst_v4l2src_fill_format_list:<v4l2src0> got 2
format(s)
0:00:02.872301000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.872720000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGB4 (Invalid
argument)
0:00:02.873073000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGB4
0:00:02.873522000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:02.873857000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGB4
0:00:02.874219000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768
0:00:02.874737000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.875158000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGBP (Invalid
argument)
0:00:03.208595000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGBP
0:00:03.209008000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:03.209339000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGBP
0:00:03.210053000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768

I know that the v4l2 driver I am using isn't very complete that is why
I specify the cap filter to define what the input format is.  Does
anyone have any ideas about what needs to be done to scale a raw video
source?

Thanks,
Gabe

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: videoscale fails with v4l2src

Zheng, Huan
I spent some time looked into it, hope my findings can help you or help somebody else to help you. :)
I use <<mywords>> below. To make it easy read, I copy it directly below:
<<This log indicates: Your V4l2 driver only support 2 formats by now>>
<<This log indicates: calling to v4l2_ioctl (fd, VIDIOC_ENUM_FRAMESIZES, &size) failed>>
<<Above log indicates: V4l2src got two caps, one is RGB4, width range from 48 to 1024, height range from 32 to 768, the other is RGBP, width range from 48 to 1024, height range from 32 to 768>>

Your driver doesn't implement ENUM_FRAMESIZES ioctl, so V4l2Src uses
v4l2_ioctl (fd, VIDIOC_TRY_FMT, &fmt);
v4l2_ioctl (fd, VIDIOC_S_FMT, &fmt);
to probe formats that maybe applied to driver. That may not be accurate if your driver's implementation is not complete or not good.

V4l2src works well on many other places, so I doubt it's your driver's issue. And perhaps related to your resolution.

Perhaps you could try
`gst-launch v4l2src ! video/x-raw-rgb,bpp=16,depth=16,width=640,height=480 ! ffmpegcolorspace ! videoscale ! fakesink`

GST_DEBUG=v4l2src*:5 Gives me the following:
0:00:02.871845000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:553:gst_v4l2src_fill_format_list:<v4l2src0> got 2
format(s)
<<This log indicates: Your V4l2 driver only support 2 formats by now>>
0:00:02.872301000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.872720000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGB4 (Invalid
argument)
<<This log indicates: calling to v4l2_ioctl (fd, VIDIOC_ENUM_FRAMESIZES, &size) failed>>
0:00:02.873073000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGB4
0:00:02.873522000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:02.873857000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGB4
0:00:02.874219000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768
0:00:02.874737000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.875158000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGBP (Invalid
argument)
0:00:03.208595000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGBP
0:00:03.209008000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:03.209339000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGBP
0:00:03.210053000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768
<<Above log indicates: V4l2src got two caps, one is RGB4, width range from 48 to 1024, height range from 32 to 768, the other is RGBP, width range from 48 to 1024, height range from 32 to 768>>
Best Regards, Zheng, Huan(ZBT)
OTC/SSD/SSG
Intel Asia-Pacific Research & Developement Ltd
Tel: 021-6116 6435
Inet: 8821 6435
Cub: 3W035
-----Original Message-----
From: Gabriel Johnson [mailto:[hidden email]]
Sent: Thursday, May 21, 2009 4:25 AM
To: [hidden email]
Subject: [gst-devel] videoscale fails with v4l2src

Hello,

I am trying to scale a v4l2src but when I add videoscale to the path
something doesn't work correctly.  When I use the command
`gst-launch v4l2src !
video/x-raw-rgb,bpp=16,depth=16,width=720,height=512 ! fakesink`
everything works fine.  When I try and use the command
`gst-launch v4l2src !
video/x-raw-rgb,bpp=16,depth=16,width=720,height=512 ! videoscale !
fakesink`
I get the error "ERROR: from element
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate
format".

GST_DEBUG=GST_PAD*:5 gives me the following messages pertaining to the v4l2src
0:00:03.207476000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:851:gst_pad_activate_push:<capsfilter0:sink> trying to set
activated in push mode
0:00:03.207857000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:871:gst_pad_activate_push:<capsfilter0:sink> activating pad
from none
0:00:03.208229000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:581:pre_activate:<capsfilter0:sink> setting ACTIVATE_MODE 1,
unset flushing
0:00:03.208627000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:907:gst_pad_activate_push:<capsfilter0:sink> activated in
push mode
0:00:03.209278000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:658:gst_pad_set_active:<v4l2src0:src> activating pad from
none
0:00:03.209663000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:851:gst_pad_activate_push:<v4l2src0:src> trying to set
activated in push mode
0:00:03.210030000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:871:gst_pad_activate_push:<v4l2src0:src> activating pad from
none
0:00:03.210379000  2122 0x10046050 DEBUG             GST_PADS
gstpad.c:581:pre_activate:<v4l2src0:src> setting ACTIVATE_MODE 1,
unset flushing
0:00:03.214782000  2122 0x10046050 INFO              GST_PADS
gstpad.c:927:gst_pad_activate_push:<v4l2src0:src> failed to activate
in push mode
0:00:03.215182000  2122 0x10046050 WARN              GST_PADS
gstpad.c:685:gst_pad_set_active:<v4l2src0:src> Failed to activate pad

GST_DEBUG=v4l2src*:5 Gives me the following:
0:00:02.871845000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:553:gst_v4l2src_fill_format_list:<v4l2src0> got 2
format(s)
0:00:02.872301000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.872720000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGB4 (Invalid
argument)
0:00:02.873073000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGB4
0:00:02.873522000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:02.873857000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGB4
0:00:02.874219000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768
0:00:02.874737000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:805:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Enumerating frame sizes
0:00:02.875158000  2133 0x10046050 DEBUG              v4l2src
v4l2src_calls.c:899:gst_v4l2src_probe_caps_for_format:<v4l2src0>
Failed to enumerate frame sizes for pixelformat RGBP (Invalid
argument)
0:00:03.208595000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 1x1 with format RGBP
0:00:03.209008000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 48x32
0:00:03.209339000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1563:gst_v4l2src_get_nearest_size:<v4l2src0> getting
nearest size to 32768x32768 with format RGBP
0:00:03.210053000  2133 0x10046050 LOG                v4l2src
v4l2src_calls.c:1617:gst_v4l2src_get_nearest_size:<v4l2src0> got
nearest size 1024x768

I know that the v4l2 driver I am using isn't very complete that is why
I specify the cap filter to define what the input format is.  Does
anyone have any ideas about what needs to be done to scale a raw video
source?

Thanks,
Gabe

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: videoscale fails with v4l2src

Gabriel Johnson
Thanks for the reply Zheng,


> Your driver doesn't implement ENUM_FRAMESIZES ioctl, so V4l2Src uses
> v4l2_ioctl (fd, VIDIOC_TRY_FMT, &fmt);
> v4l2_ioctl (fd, VIDIOC_S_FMT, &fmt);
> to probe formats that maybe applied to driver. That may not be accurate if your driver's implementation is not complete or not good.
I was thinking that the v4l2 driver might still be missing something

> V4l2src works well on many other places, so I doubt it's your driver's issue. And perhaps related to your resolution.
>
> Perhaps you could try
> `gst-launch v4l2src ! video/x-raw-rgb,bpp=16,depth=16,width=640,height=480 ! ffmpegcolorspace ! videoscale ! fakesink`
This doesn't work either.

I don't under stand why if I skip using videoscale and
ffmpegcolorspace it works fine.  It appears that if I use any other
plugins between the source and sink it fails.  What could
ffmpegcolorspace or videoscale be requiring from the v4l2src that it
doesn't provide?

I am going to try and implement ENUM_FRAMESIZES ioctl and see if that helps.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: videoscale fails with v4l2src

Zheng, Huan

When you implement ENUM_FRAMESIZES ioctl, take care of the resolution properly.

Best Regards, Zheng, Huan(ZBT)
OTC/SSD/SSG
Intel Asia-Pacific Research & Developement Ltd
Tel: 021-6116 6435
Inet: 8821 6435
Cub: 3W035
-----Original Message-----
From: Gabriel Johnson [mailto:[hidden email]]
Sent: Thursday, May 21, 2009 9:31 PM
To: Zheng, Huan
Cc: Discussion of the development of GStreamer
Subject: Re: [gst-devel] videoscale fails with v4l2src

Thanks for the reply Zheng,


> Your driver doesn't implement ENUM_FRAMESIZES ioctl, so V4l2Src uses
> v4l2_ioctl (fd, VIDIOC_TRY_FMT, &fmt);
> v4l2_ioctl (fd, VIDIOC_S_FMT, &fmt);
> to probe formats that maybe applied to driver. That may not be accurate if your driver's implementation is not complete or not good.
I was thinking that the v4l2 driver might still be missing something

> V4l2src works well on many other places, so I doubt it's your driver's issue. And perhaps related to your resolution.
>
> Perhaps you could try
> `gst-launch v4l2src ! video/x-raw-rgb,bpp=16,depth=16,width=640,height=480 ! ffmpegcolorspace ! videoscale ! fakesink`
This doesn't work either.

I don't under stand why if I skip using videoscale and
ffmpegcolorspace it works fine.  It appears that if I use any other
plugins between the source and sink it fails.  What could
ffmpegcolorspace or videoscale be requiring from the v4l2src that it
doesn't provide?

I am going to try and implement ENUM_FRAMESIZES ioctl and see if that helps.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel