Record webcam and keep audio-video sync

Nicolas Dufresne nicolas at ndufresne.ca
Wed Aug 30 11:41:24 UTC 2023


Hi,

Le mer. 30 août 2023, 03 h 15, Aviv Hurvitz via gstreamer-devel <
gstreamer-devel at lists.freedesktop.org> a écrit :

> I'm using Gstreamer to record audio+video from a webcam to a file, and
> their sync is
> off. I can see a delay in playback from the MKV file.
>
> Note: It's important that I don't lose any frames over time from audio or
> video.
>
> Can someone see a problem with my command?
>
> C:\gstreamer\1.0\msvc_x86_64\bin\gst-launch-1.0 -m -e -v
> mfvideosrc device-name="Logitech MeetUp"  do-timestamp=true
> ! "image/jpeg," "width=3840," "height=2160," "framerate=30/1," "pixel-aspect-ratio=1/1"
> ! queue ! nvjpegdec ! queue ! nvh264enc preset=hp qp-min=23 ! queue ! h264parse ! queue ! mkv.
>
> wasapisrc device="{audio_device_stringified}"
> ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! mkv.
>
> matroskamux name=mkv
> ! queue max-siz see-buffers=0 max-size-time=0 max-size-bytes=0
>
>  ! filesink location=out.mkv
>
> I don't see anything wrong with the pipeline. I would suspect a timestamp
bug in wasapisrc or mfvideosrc. The only way to achieve lipsync is to have
these two elements produce time that correlate. If it's not the case, it's
likely a bug (or missing platform feature).

P.s. if the delay is constant, you can probably workaround with a ts-offset
setting.


>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230830/b9d1fff4/attachment-0001.htm>


More information about the gstreamer-devel mailing list