问题
I am using a camera which supports 1080 and 720p videos at both 30 and 25 frames per second. I can get the webcam to stream with the following gstreamer command on my ARM board
gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw, width=1920,
height=1080, format=(string)YUY2, framerate=30/1" ! xvimagesink sync=false -e
However, I find that I cannot change any of these parameters. For example, if I change the framerate
to 25/1
, I get the error:
error: streaming task paused, reason not-negotiated (-4)
I wonder if this may be a hardware issue or am I using gstreamer incorrectly and there might be a better way to do this.
回答1:
To know details you can look at the debug logs, GST_DEBUG=3,v4l*:6 should give you quite some information.
But in summary, the problem is that your camera driver does not want to provide GStreamer something with those caps and e.g. 25fps instead of 30fps. If you change other things, it might also be a problem with the sink not accepting those caps btw, you might want to put a videoconvert and videoscale in front of xvimagesink to prevent that.
来源:https://stackoverflow.com/questions/35879746/cannot-change-output-format-in-gstreamer