Selecting Video Input

Ian Davidson id012c3076 at blueyonder.co.uk
Tue Dec 11 05:35:01 PST 2012


The device is set to /dev/video0.  Looking in /dev, I can see 
/dev/video0 - but I cannot see anything else relevant.

xawtv uses /dev/video0 and then sets the input from "input = Television 
| Composite1 | S-Video | ..." - but I cannot see how to do that with 
v4l2src.  I think that it is defaulting to "Television".

Ian

On 11/12/2012 13:10, Krzysztof Konopko wrote:
> Have a look at the 'device' property. Your input should be represented
> as a device in the file system. You need to find out which one it is and
> set it through the 'device' property of the v4l2src element.
>
> Kris
>
> On 11/12/12 12:55, Ian Davidson wrote:
>> Actually, not 100% success.
>>
>> I reboot the computer and repeated the test and I think that this time,
>> it picked up the 'Television' input again, not the Composite1.
>>
>> I have listed the output from gst-inspect-1.0 below.  I do not see
>> anything which relates to the input selection.
>>
>> [ian at localhost ~]$ gst-inspect-1.0 v4l2src
>> Factory Details:
>>    Rank:        primary (256)
>>    Long-name:        Video (video4linux2) Source
>>    Klass:        Source/Video
>>    Description:        Reads frames from a Video4Linux2 device
>>    Author:        Edgard Lima <edgard.lima at indt.org.br>, Stefan Kost
>> <ensonic at users.sf.net>
>>
>> Plugin Details:
>>    Name:            video4linux2
>>    Description:        elements for Video 4 Linux
>>    Filename: /usr/lib64/gstreamer-1.0/libgstvideo4linux2.so
>>    Version:        1.0.3
>>    License:        LGPL
>>    Source module:    gst-plugins-good
>>    Source release date:    2012-11-21
>>    Binary package:    Fedora GStreamer-plugins-good package
>>    Origin URL:        http://download.fedoraproject.org
>>
>> GObject
>>   +----GInitiallyUnowned
>>         +----GstObject
>>               +----GstElement
>>                     +----GstBaseSrc
>>                           +----GstPushSrc
>>                                 +----GstV4l2Src
>>
>> Implemented Interfaces:
>>    GstURIHandler
>>    GstTuner
>>    GstColorBalance
>>    GstVideoOrientation
>>
>> Pad Templates:
>>    SRC template: 'src'
>>      Availability: Always
>>      Capabilities:
>>        video/x-raw
>>                   format: RGB15
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: RGB16
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: BGR
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: RGB
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: BGRx
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: RGBx
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: GRAY8
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: YVU9
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: YV12
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: YUY2
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: UYVY
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: Y42B
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: Y41B
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: NV12
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: NV21
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: YUV9
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: I420
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-bayer
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        image/jpeg
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        image/jpeg
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        image/jpeg
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-dv
>>             systemstream: true
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/mpegts
>>        video/x-h264
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-sonix
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-pwc1
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-pwc2
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>        video/x-raw
>>                   format: YVYU
>>                    width: [ 1, 32768 ]
>>                   height: [ 1, 32768 ]
>>                framerate: [ 0/1, 100/1 ]
>>
>>
>> Element Flags:
>>    no flags set
>>
>> Element Implementation:
>>    Has change_state() function: 0x7f1ee15510c0
>>
>> Element has no clocking capabilities.
>> Element has no indexing capabilities.
>>
>> URI handling capabilities:
>>    Element can act as source.
>>    Supported URI protocols:
>>      v4l2
>>
>> Pads:
>>    SRC: 'src'
>>      Implementation:
>>        Has getrangefunc(): gst_base_src_getrange
>>        Has custom eventfunc(): gst_base_src_event
>>        Has custom queryfunc(): gst_base_src_query
>>        Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
>>      Pad Template: 'src'
>>
>> Element Properties:
>>    name                : The name of the object
>>                          flags: readable, writable
>>                          String. Default: "v4l2src0"
>>    parent              : The parent of the object
>>                          flags: readable, writable
>>                          Object of type "GstObject"
>>    blocksize           : Size in bytes to read per buffer (-1 = default)
>>                          flags: readable, writable
>>                          Unsigned Integer. Range: 0 - 4294967295 Default:
>> 4096
>>    num-buffers         : Number of buffers to output before sending EOS
>> (-1 = unlimited)
>>                          flags: readable, writable
>>                          Integer. Range: -1 - 2147483647 Default: -1
>>    typefind            : Run typefind before negotiating
>>                          flags: readable, writable
>>                          Boolean. Default: false
>>    do-timestamp        : Apply current stream time to buffers
>>                          flags: readable, writable
>>                          Boolean. Default: false
>>    device              : Device location
>>                          flags: readable, writable
>>                          String. Default: "/dev/video0"
>>    device-name         : Name of the device
>>                          flags: readable
>>                          String. Default: "BT878 video (Pinnacle PCTV Stud"
>>    device-fd           : File descriptor of the device
>>                          flags: readable
>>                          Integer. Range: -1 - 2147483647 Default: -1
>>    flags               : Device type flags
>>                          flags: readable
>>                          Flags "GstV4l2DeviceTypeFlags" Default:
>> 0x00000000, "(none)"
>>                             (0x00000001): capture          - Device
>> supports video capture
>>                             (0x00000002): output           - Device
>> supports video playback
>>                             (0x00000004): overlay          - Device
>> supports video overlay
>>                             (0x00000010): vbi-capture      - Device
>> supports the VBI capture
>>                             (0x00000020): vbi-output       - Device
>> supports the VBI output
>>                             (0x00010000): tuner            - Device has a
>> tuner or modulator
>>                             (0x00020000): audio            - Device has
>> audio inputs or outputs
>>    brightness          : Picture brightness, or more precisely, the black
>> level
>>                          flags: readable, writable, controllable
>>                          Integer. Range: -2147483648 - 2147483647 Default: 0
>>    contrast            : Picture contrast or luma gain
>>                          flags: readable, writable, controllable
>>                          Integer. Range: -2147483648 - 2147483647 Default: 0
>>    saturation          : Picture color saturation or chroma gain
>>                          flags: readable, writable, controllable
>>                          Integer. Range: -2147483648 - 2147483647 Default: 0
>>    hue                 : Hue or color balance
>>                          flags: readable, writable, controllable
>>                          Integer. Range: -2147483648 - 2147483647 Default: 0
>>    norm                : video standard
>>                          flags: readable, writable
>>                          Enum "V4L2_TV_norms" Default: 0, "none"
>>                             (0): none             - none
>>                             (45056): NTSC             - NTSC
>>                             (4096): NTSC-M           - NTSC-M
>>                             (8192): NTSC-M-JP        - NTSC-M-JP
>>                             (32768): NTSC-M-KR        - NTSC-M-KR
>>                             (16384): NTSC-443         - NTSC-443
>>                             (255): PAL              - PAL
>>                             (7): PAL-BG           - PAL-BG
>>                             (1): PAL-B            - PAL-B
>>                             (2): PAL-B1           - PAL-B1
>>                             (4): PAL-G            - PAL-G
>>                             (8): PAL-H            - PAL-H
>>                             (16): PAL-I            - PAL-I
>>                             (224): PAL-DK           - PAL-DK
>>                             (32): PAL-D            - PAL-D
>>                             (64): PAL-D1           - PAL-D1
>>                             (128): PAL-K            - PAL-K
>>                             (256): PAL-M            - PAL-M
>>                             (512): PAL-N            - PAL-N
>>                             (1024): PAL-Nc           - PAL-Nc
>>                             (2048): PAL-60           - PAL-60
>>                             (16711680): SECAM            - SECAM
>>                             (65536): SECAM-B          - SECAM-B
>>                             (262144): SECAM-G          - SECAM-G
>>                             (524288): SECAM-H          - SECAM-H
>>                             (3276800): SECAM-DK         - SECAM-DK
>>                             (131072): SECAM-D          - SECAM-D
>>                             (1048576): SECAM-K          - SECAM-K
>>                             (2097152): SECAM-K1         - SECAM-K1
>>                             (4194304): SECAM-L          - SECAM-L
>>                             (8388608): SECAM-Lc         - SECAM-Lc
>>    io-mode             : I/O mode
>>                          flags: readable, writable
>>                          Enum "GstV4l2IOMode" Default: 0, "auto"
>>                             (0): auto             - GST_V4L2_IO_AUTO
>>                             (1): rw               - GST_V4L2_IO_RW
>>                             (2): mmap             - GST_V4L2_IO_MMAP
>>                             (3): userptr          - GST_V4L2_IO_USERPTR
>>
>> Element Signals:
>>    "prepare-format" :  void user_function (GstElement* object,
>>                                            gint arg0,
>>                                            guint arg1,
>>                                            guint arg2,
>>                                            guint arg3,
>>                                            gpointer user_data);
>> [ian at localhost ~]$
>>
>>
>> On 11/12/2012 12:15, Ian Davidson wrote:
>>> Thanks,
>>>
>>> I changed the command to
>>> gst-launch-1.0 v4l2src norm=PAL !
>>> 'video/x-raw,format=(string)I420,width=320,height=240,framerate=(fraction)25/1'
>>> ! queue ! mux. alsasrc num-buffers=440 ! audioconvert !
>>> 'audio/x-raw,rate=44100,channels=2' ! queue ! mux. avimux name=mux !
>>> filesink location=test.avi
>>> and that then captured the video.
>>>
>>> On 11/12/2012 11:32, Krzysztof Konopko wrote:
>>>> Try using 'device' property of the v4l2src element.
>>>>
>>>> For more info see:
>>>> gst-inspect-1.0 v4l2src
>>>>
>>>> Kris
>>>>
>>>> On 11/12/12 11:23, Ian Davidson wrote:
>>>>> I suspect that GStreamer is not defaulting to the Composite1 source,
>>>>> but
>>>>> some other - so how do I convince it to use the Composite1?
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> gstreamer-devel at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>>
>>> -- 
>>> -- 
>>> Ian Davidson
>>> /239 Streetsbrook Road, Solihull, West Midlands, B91 1HE/
>>> -- 
>>> Facts used in this message may or may not reflect an underlying
>>> objective reality. Facts are supplied for personal use only.
>>> Recipients quoting supplied information do so at their own risk. Facts
>>> supplied may vary in whole or part from widely accepted standards.
>>> While painstakingly researched, facts may or may not be indicative of
>>> actually occurring events or natural phenomena.
>>> The author accepts no responsibility for personal loss or injury
>>> resulting from memorisation and subsequent use.
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

-- 
--
Ian Davidson
/239 Streetsbrook Road, Solihull, West Midlands, B91 1HE/
--
Facts used in this message may or may not reflect an underlying 
objective reality. Facts are supplied for personal use only.
Recipients quoting supplied information do so at their own risk. Facts 
supplied may vary in whole or part from widely accepted standards.
While painstakingly researched, facts may or may not be indicative of 
actually occurring events or natural phenomena.
The author accepts no responsibility for personal loss or injury 
resulting from memorisation and subsequent use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121211/0ea2d806/attachment-0001.html>


More information about the gstreamer-devel mailing list