Fix Video Speed and Smoothness

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix Video Speed and Smoothness

davis.jacobj
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

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?

Thanks,
Jake
Reply | Threaded
Open this post in threaded view
|

Re: Fix Video Speed and Smoothness

Baby Octopus
Administrator
You seem to be capturing raw data. Is that what you want to do? Raw data can be of high datarate and your disk should support write of that. That could be one issue. You might want to reduce the framerate using videorate

Also, check if your v4l2driver is giving a proper timestamp. Check v4l2src ! fakesink silent=0 -v and see if the PTS is matching with the running time
Reply | Threaded
Open this post in threaded view
|

Re: Fix Video Speed and Smoothness

Rafael Sierra
In reply to this post by davis.jacobj

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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel