Setting frame size on v4l2src

Keith Lawson keith at nowhere.ca
Mon Sep 1 12:55:07 PDT 2014


 

Hello, 

I'm working on a gstreamer application intended to simultaneously
playback and save video from a Pinnacle Dazzle. I'm having troubles with
my caps filter. If I run the following pipeline video displays but it's
not the correct resolution so the aspect ratio looks off: 

gst-launch -v v4l2src device=/dev/video0 ! xvimagesink 

When I play from the capture card with mplayer it plays back at 640x480:


mplayer -tv driver=v4l2:norm=NTSC:input=0 tv://
Failed to read /etc/mplayer/mplayer.conf.local: No such file or
directory
Warning unknown option include at line 177
MPlayer SVN-r37232 (C) 2000-2013 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote
control.

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: Pinnacle Dazzle DVC 90/100/101/
 Capabilities: video capture read/write streaming
 supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR; 4
= NTSC-443; 5 = PAL; 6 = PAL-BG; 7 = PAL-H; 8 = PAL-I; 9 = PAL-DK; 10 =
PAL-M; 11 = PAL-N; 12 = PAL-Nc; 13 = PAL-60; 14 = SECAM; 15 = SECAM-B;
16 = SECAM-G; 17 = SECAM-H; 18 = SECAM-DK; 19 = SECAM-L; 20 = SECAM-Lc;
 inputs: 0 = Composite1; 1 = S-Video;
 Current input: 0
 Current format: YUYV
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
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] This driver only supports the 3Dfx Banshee, Voodoo3 and
Voodoo 5.
s3fb: Couldn't map S3 registers: Operation not permitted
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared
object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
Movie-Aspect is undefined - no prescaling applied.
VO: [XV] 640X480 => 640X480 PACKED YUY2 
Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
==========================================================================
Audio: no sound
Starting playback...

So I'm trying to correct that with a caps filter. v4l2-ctl tells me it
supports 640x480: 

v4l2-ctl --all
Driver Info (not using libv4l2):
 Driver name : em28xx
 Card type : Pinnacle Dazzle DVC 90/100/101/
 Bus info : usb-0000:00:14.0-2
 Driver version: 3.14.15
 Capabilities : 0x85000001
 Video Capture
 Read/Write
 Streaming
 Device Capabilities
 Device Caps : 0x05000001
 Video Capture
 Read/Write
 Streaming
Priority: 2
Video input : 0 (Composite1: ok)
Video Standard = 0x0000b000
 NTSC-M/M-JP/M-KR
Format Video Capture:
 Width/Height : 640/480
 Pixel Format : 'YUYV'
 Field : Interlaced
 Bytes per Line: 1280
 Size Image : 614400
 Colorspace : Broadcast NTSC/PAL (SMPTE170M/ITU601)
Streaming Parameters Video Capture:
 Frames per second: 29.970 (30000/1001)
 Read buffers : 4

User Controls

 brightness (int) : min=0 max=255 step=1 default=128 value=128
flags=slider
 contrast (int) : min=0 max=127 step=1 default=64 value=64 flags=slider
 saturation (int) : min=0 max=127 step=1 default=64 value=64
flags=slider
 hue (int) : min=-128 max=127 step=1 default=0 value=0 flags=slider
 red_balance (int) : min=-48 max=48 step=1 default=0 value=0
flags=slider
 blue_balance (int) : min=-48 max=48 step=1 default=0 value=0
flags=slider
 sharpness (int) : min=0 max=15 step=1 default=0 value=0 flags=slider
 chroma_agc (bool) : default=1 value=1 flags=update
 chroma_gain (int) : min=0 max=127 step=1 default=40 value=42
flags=inactive, slider, volatile 

So I'm trying to fix the gstreamer output with a filter cap but getting
"Could not negotiate format": 

gst-launch -v v4l2src device=/dev/video0 !
'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
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(2830): gst_base_src_start ():
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ... 

I've seen other threads[1] on the mailing list about these types of
issues with the Dazzles but can't seem to find a working solution.
v4l2-ctl doesn't seem to be listing all supported formats and the video
capture format is different sometimes. Am I missing something in
configuring the capture card to produce the correct output before I
start the gstreamer pipeline or is the filter cap supposed to do that? 

Thanks, 

Keith. 

1:
http://lists.freedesktop.org/archives/gstreamer-devel/2013-February/039548.html
[1] 

 

Links:
------
[1]
http://lists.freedesktop.org/archives/gstreamer-devel/2013-February/039548.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140901/8dfd26f0/attachment.html>


More information about the gstreamer-devel mailing list