Fix Video Speed and Smoothness

Rafael Sierra tt.babyvitals.01 at gmail.com
Mon Jun 19 03:54:25 UTC 2017


On 2017年06月16日 10:58, davis.jacobj wrote:
> I'm new to using GStreamer and I'm attempting to use gst-launch to take video
> from a webcam and store it as a video file. The webcam is a 1080p/30fps
> camera and the input device is a RaspberryPi3 So far, I've come up with the
> following command:
> gst-launch-1.0 v4l2src device=/dev/video0 video/x-raw, width=1280,
> height=720, framerate=30/1 ! queue ! avimux ! filesink location=video.avi
Raw 720 video at 30fps needs a lot of USB bandwidth. Have you made sure 
your camera can output that?
Do you mind if I ask you about your camera maker/model?

> When I playback this file on a Windows PC with VLC, I'm noticing two
> problems:
> 1.) The video plays back at 2x or 4x the realistic speed
> 2.) Some frames are missing so the video skips
>
> Does anyone have suggestions for how I can troubleshoot and fix these
> issues?

I have a couple of suggestions. I assume your camera can actually output 
what's being requested; or
perhaps you can try with a lower resolution first:

1. Discard storage issues: if you have a display, try just showing the 
video:
gst-launch-1.0 v4l2src device=/dev/video0 video/x-raw, width=1280,
height=720, framerate=30/1 ! autovideosink

2. Ensure your pipeline gets properly terminated: if you don't add a an 
"End Of Stream" marker
to your pipeline, the avi file created will be missing it's index. Add 
it like this: (-e flag)
gst-launch-1.0 -e v4l2src device= ...

* Note that I've also reported an issue with the -e flag and a specific 
camera model. I hope you don't run into the same issue.

I hope it helps.

Rafael



More information about the gstreamer-devel mailing list