Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video recording freezes using MediaRecorder #1682

Open
Spisor opened this issue Jun 20, 2024 · 0 comments
Open

Video recording freezes using MediaRecorder #1682

Spisor opened this issue Jun 20, 2024 · 0 comments

Comments

@Spisor
Copy link

Spisor commented Jun 20, 2024

Hi!

Thank you for implementing this component; I found it really useful!

I am having some trouble recording the input video using the cookbooks/examples provided in the code.

My current code looks like this:

from aiortc.contrib.media import MediaRecorder

from streamlit_webrtc import WebRtcMode, webrtc_streamer


def app():
    def recorder_factory() -> MediaRecorder:
        return MediaRecorder("test1.mp4")
    
    webrtc_streamer(
        key="loopback",
        mode=WebRtcMode.SENDRECV,
        rtc_configuration={"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]},
        media_stream_constraints={
            "video": True,
            "audio": True,
        },
        in_recorder_factory=recorder_factory
    )

if __name__ == "__main__":
    app()

This code is similar to the example provided. However, after a few seconds, the video recording freezes and only the audio continues to record.

The error I am receiving is:

[libx264 @ 000001f7b1525180] non-strictly-monotonic PTS
[mp4 @ 000001f78f20b940] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 22016 >= 22016

Should I use some other options in the MediaRecorder from the aiortc library?

I noticed that some people encounter the same error with aiortc MediaRecorder when using HLS, but that is not my case.

Thank you for your assistance!

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

No branches or pull requests

1 participant