I'm a beginner in Gstreamer and encountered an issue that I'm not able to figure out:
I use these two commands:
gst-launch-1.0 v4l2src ! autovideosink
gst-launch-0.10 v4l2src ! autovideosink
The 1.0 version displays the video with 1 frame per second, while the 0.10 version displays a smooth video (not sure about exact frame rate).
I'd like to have the same smooth video with gstreamer 1.0, can you help me figure out the exact syntax? I guess I'm missing some parameter?
Thanks!
Well, a few more googling gave me the answer:
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480,framerate=15/1' ! autovideosink
That provides a smooth video with 1.0.
Related
I'm trying to create screenshot (i.e. grab one frame) from RTSP camera stream using gstreamer pipeline.
The pipeline used looks like this:
gst-launch-1.0 rtspsrc location=$CAM_URL is_live=true ! decodebin ! videoconvert ! jpegenc snapshot=true ! filesink location=/tmp/frame.jpg
Problem is that the result image is always gray, with random artifacts. It looks like it's grabbing the very first frame, and it doesn't wait for the key frame.
Is there any way how can I modify the pipeline to actually grab first valid frame of video? Or just wait long enough to be sure that there was at least one key frame already?
I'm unsure why, but after some trial and error it is now working with decodebin3 instead of decodebin. Documentation is still bit discouraging though, stating decodebin3 is still experimental API and a technology preview. Its behaviour and exposed API is subject to change.
Full pipeline looks like this:
gst-launch-1.0 rtspsrc location=$CAM_URL is_live=true ! decodebin3 ! videoconvert ! jpegenc snapshot=true ! filesink location=/tmp/frame.jpg
I am trying to get a camera that uses Gstreamer to capture images in a specific interval of time, while searching in the web I found the following line:
gst-launch-1.0 -v videotestsrc is-live=true ! clockoverlay font-desc="Sans, 48" ! videoconvert ! videorate ! video/x-raw,framerate=1/3 ! jpegenc ! multifilesink location=file-%02d.jpg
I believe it would work great, but unfortunately, I don't know how to get it to work with my specific camera, meaning I don't know how to identify my video source in RPi4 and if that is the only thing I have to change to get it to work. I would appreciate either help with the video source, or any other method to get those images.
0
The objective I am trying to achieve is streaming 1080p video from Raspberry pi camera and record the video simultaneously.
I tried recording the http streaming as source but didn't work on 30fps. A lot of frames were missing and almost got 8fps only.
As a second approach, I am trying to record the file directly from camera and then streaming the "recording in progress/buffer" file. For the same I am trying to use GStreamer. Please suggest if this is good option or should I try any other?
For Recording using GStreamer I used
gst-launch-1.0 -v v4l2src device=/dev/video0 ! capsfilter caps="video/x-raw,width=1920,height=1080,framerate=30/1" !
videoflip method=clockwise ! videoflip method=clockwise ! videoconvert ! videorate ! x264enc! avimux ! filesink location=test_video.h264
Result : recorded video shows 1080p and 30fps but frames are dropping heavily.
For Streaming the video buffer I have used UDP in Gstreamer as,
gst-launch-1.0 -v v4l2src device=/dev/video0 ! capsfilter caps="video/x-raw,width=640,height=480,framerate=30/1" ! x264enc ! queue ! rtph264pay ! udpsink host=192.168.5.1 port=8080
Result : No specific errors on terminal but can't get stream on vlc.
Please suggest the best method here.
I am trying to create virtual web camera using GStreamer and v4l2loopback. The problem is that I want to use Playbin but the video speed is too fast when I use it. For instance, it happens when I execute the following command:
gst-launch-1.0 -v playbin uri=file:/vagrant/test.avi
video-sink="videoconvert
! videoscale
! video/x-raw,format=YUY2,width=320,height=320
! v4l2sink device=/dev/video0"
Adding "framerate=20/1" to the caps throws "Not negotiated error" while setting it to "30/1" works but doesn't help to fix the issue with the speed.
On the other hand, I am getting normal speed when executing the following command:
gst-launch-1.0 -v filesrc location=/vagrant/test.avi
! avidemux
! decodebin
! videoconvert
! videoscale
! "video/x-raw,format=YUY2,width=320,height=320"
! v4l2sink device=/dev/video0
I tried a lot of combinations with filters from the last example with the Playbin but none of them helped.
Any help would be highly appreciated!
The problem was with the virtual machine running on top of the VirtualBox. To be more precise - I had 3d acceleration turned on, which resulted in all the videos to play at speed 2x.
Turning off 3d acceleration by setting --accelerate3d=off helped to solve the issue.
I'm trying to stream the native H264 video from a Logitech C920 camera using GStreamer 1.2.4:
gst-launch-1.0 v4l2src ! video/x-h264,width=640,height=480,framerate=10/1 ! \
h264parse ! decodebin ! videoconvert ! ximagesink sync=false
This produces an image output which is a kind of a relief:
As soon as add more movement to the scene, the image quality improves but is still far away from being sufficent. I seems that anyhow the stable parts of the video stream are not decoded.
Any ideas?
I'm using gstreamer 1.2.4 on a Banana PI (Debian Wheezy)