Synchronized virtual cameras
Marianna Smidth Buschle
msb at qtec.com
Thu Mar 9 07:12:31 UTC 2023
Hi,
I can't say anything on the sync and NTP stuff, but I have "simulated"
cameras using files.
I haven't tried to stream those, only feed to other pipelines.
On my experience the key to proper playback speed is the 'sync' property.
Generally if you are using a sink with 'sync=true', the 'filesrc' should
produce frames at the proper rate.
|filesrc name=replay location=/home/msb/test.ts ! decodebin !
videoconvert ! ximagesink sync=0|
Produces frames as fast as possible
|filesrc name=replay location=/home/msb/test.ts ! decodebin !
videoconvert ! ximagesink sync=1|
Produces frames with the proper timing
Using an '|identity sync=true|' or '|clocksync|' have the same effect
|filesrc location=/home/msb/test.ts ! decodebin ! identity sync=true !
videoconvert ! ximagesink sync=0|
||filesrc location=/home/msb/test.ts ! decodebin ! clocksync !
videoconvert ! ximagesink sync=0||
Both should produce frames at the correct rate
However, note that it only works when the data is demuxed (needs to be
placed after the 'tsdemux' in my case)
|filesrc| location=/home/msb/test.ts ! tsdemux : identity sync=true !
h264parse ! avdec_h264 ! video/x-raw,framerate=30/1 ! videoconvert !
ximagesink sync=0 |filesrc| location=/home/msb/test.ts ! tsdemux :
identity sync=true ! fakesink sync=0
Best Regards
Marianna
On 08.03.2023 17.39, gstreamer-devel-request at lists.freedesktop.org wrote:
> Thank you Andrew!
>
> I do wonder though if this will do the trick, it is quite similar to
> what we are trying today.
> What we need is the content of the two files we stream to line up as
> if they where watching the same thing live.
> So the first video frame from the first file should align, as well as
> possible, and be synced with the first frame from the second file and
> keep that sync wthout drift.
> There is no `is-live` property on a filesrc as far as I know, so it is
> a bit tricky for us how to do this ...
>
> ... we need to throttle the sending of file content I guess?
> ... and we need someway to make sure that the content of the files
> line up and is synced, and that sync is kept.
>
> If we "just" make sure the pipeline is synced to NTP clock and the RTP
> bin uses capture time, is that really enough?
> What happens when the files are read and sent with a slight difference
> in time? How to we correlate the capture times?
>
> Do I make sense? I hardly do to myself:)
>
> All the best
> Jonas
--
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230309/eaef74eb/attachment.htm>
More information about the gstreamer-devel
mailing list