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

A/V desync with rtmp output #75

Open
russelltg opened this issue May 31, 2024 · 3 comments
Open

A/V desync with rtmp output #75

russelltg opened this issue May 31, 2024 · 3 comments

Comments

@russelltg
Copy link
Owner

          Thank you so much for the work @russelltg  ! I missed it because the issue was closed.

So it indeed works locally, there is sound and video working.

There are two caveats left.

When I read the stream in local host, mpv reports :

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).
Consider trying `--profile=fast` and/or `--hwdec=auto-safe` as they may help

Second, when trying to send the audio/video stream to an actual endpoint (twitch in my case), wl-screenrec reports:

[rtmp @ 0x610046453ac0] Cannot open connection tcp://live.twitch.tv:1935?listen&listen_timeout=-1000&tcp_nodelay=0
thread 'main' panicked at src/main.rs:1306:87:
called `Result::unwrap()` on an `Err` value: ffmpeg::Error(99: Cannot assign requested address)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Originally posted by @hraytilakhealthcare in #73 (comment)

@hraytilakhealthcare
Copy link

Let me know if I can do anything else to add info to the issue. I tried looking at the code, but this is way above my head, sorry.

@russelltg
Copy link
Owner Author

No problem--I'm pretty sure this is because the file open command hangs until a client connects, and I think the A/V desync duration is the same as how long it took for someone to connect? Not totally sure :)

@hraytilakhealthcare
Copy link

Hey, I tested with the latest version you published. Running the command locally works perfectly, audio and video :

wl-screenrec --geometry "1920,0 1920x1080" --audio --ffmpeg-muxer flv --codec avc --ffmpeg-muxer-options "listen=1" --audio-codec aac --filename "rtmp://localhost:1234"

While the one I'd use to stream still produces an error:

wl-screenrec --geometry "1920,0 1920x1080" --audio --ffmpeg-muxer flv --codec avc --ffmpeg-muxer-options "listen=1" --audio-codec aac --filename "rtmp://live.twitch.tv/app/live_xxx_xxxx"

[rtmp @ 0x5bd7bb7dbdc0] Cannot open connection tcp://live.twitch.tv:1935?listen&listen_timeout=-1000&tcp_nodelay=0
thread 'main' panicked at src/main.rs:1323:87:
called `Result::unwrap()` on an `Err` value: ffmpeg::Error(99: Cannot assign requested address)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried with a remote client connected, but I assume twitch must do some kind of buffering or something. Maybe ? I don't know. Let me know if I can test more stuff !

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

2 participants