russelltg / wl-screenrec

High performance wlroots screen recording, featuring hardware encoding
Apache License 2.0
266 stars 9 forks source link

Audio in clip recorded with --history has long blank segment at end #20

Closed russelltg closed 9 months ago

russelltg commented 11 months ago
          Thank you very much for this fix, looks like the audio is in sync with video now, that is great. I'v noticed however one issue (sorry).

It looks like audio length is still of the original length and end of the clip is filled with silence (kind of).

I'm using this command to test it:

(sleep 15s; kill -USR1 wl-screenrec; sleep 10s; kill -INT wl-screenrec) &; cargo run -- -o DP-1 --audio --history 5  --audio-device "$(pactl get-default-sink).monitor"

What it does it starts recording with 5s buffer. After 15s sends USR1 (at this point clip should be 5 sec long). Sends INT after another 10 seconds. Should result with 15sec recording. What we get is 25s clip with first 15s of what we really want.

Then in mpv it just jumps from 15s to 25s, so ends correctly just displays wrong duration. When I import it to kdenlive I have 25s clip with 10s of silence and one still frame at the end.

I can easly trim video after with

ffmpeg -ss 0 -t 15 -i screenrecord.mp4 -c:a copy -c:v copy screenrecord_trimed.mp4

So I'm not too much bothered with that.

Once again thanks for the desync fix. I can create separate issue for this if you think that's better to have it separated.

Originally posted by @pbogut in https://github.com/russelltg/wl-screenrec/issues/19#issuecomment-1637592101

russelltg commented 11 months ago

I'm written a testcase that repros this--still need to sit down and fix it (tests/cmdline.rs)

russelltg commented 9 months ago

@pbogut I believe this is fixed now, so closing. Please re-open or comment if it seems broken for you