Skip to content

Add is-live=false mode (Blocking v buffer creation on OnPaint) - #105

Open
aiden-jeffrey wants to merge 4 commits into
centricular:masterfrom
aiden-jeffrey:aiden/raf-lock
Open

Add is-live=false mode (Blocking v buffer creation on OnPaint)#105
aiden-jeffrey wants to merge 4 commits into
centricular:masterfrom
aiden-jeffrey:aiden/raf-lock

Conversation

@aiden-jeffrey

@aiden-jeffrey aiden-jeffrey commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

We block create on a fresh OnPaint call - effectively frame locking the cefsrc output to 1 frame per requestAnimationFrame on the browser side. This can be tested with http://localhost:9000/raf_test.html?audioDelay=-1. For example:

gst-launch-1.0 -e cefsrc is-live=false url="http://localhost:9000/raf_test.html?audioDelay=-1" ! video/x-raw, width=1920, height=1080, framerate=60/1 ! cefdemux name=demux ! queue ! videoconvert ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=3000000000 ! x264enc ! queue ! mp4mux name=muxer ! filesink location='test.mp4' audiotestsrc do-timestamp=true is-live=true  volume=0.0 ! audiomixer name=mix ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=3000000000 ! audioconvert ! audiorate ! audioresample ! avenc_aac bitrate=128000 ! queue ! muxer. demux. ! queue ! mix.

NB: setting audioDelay=-1 in that test page turns off audio. This change doesn't play well with audio currently.

Note that as @MathieuDuponchelle suggested, this clogs up the audio side of things - I need to dig further into my audio PR to genuinely decouple the audio buffer creation from the video buffer creation.

Based on #104. So the actual diff is this commit.

There's also this commit - apparently we should return NO_PREROLL on state change to PAUSED https://gstreamer.freedesktop.org/documentation/additional/design/live-source.html?gi-language=c, but if we do this the pipeline never goes to playing.

@aiden-jeffrey aiden-jeffrey changed the title RAF lock - broken?? Return NO_PREROLL for state change to PAUSED - broken?? Dec 12, 2025
@aiden-jeffrey aiden-jeffrey changed the title Return NO_PREROLL for state change to PAUSED - broken?? Add is-live=false mode (Blocking v buffer creation on OnPaint) Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant