Opened 2 years ago

Closed 23 months ago

Last modified 20 months ago

#10114 closed defect (invalid)

audio sync lags while recording x11grab

Reported by: betlog Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords: x11grab pulseaudio
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by betlog)

ffmpeg version 4.4.2-0ubuntu0.22.04.1

Summary of the bug:
When recording desktop using x11grab the audio is several seconds behind the video
-effects Kubuntu 22.04
-does not effect Kubuntu 20.04
How to reproduce:

ffmpeg -v 9 -loglevel 99 \
         -hwaccel cuvid \
         -c:v h264_cuvid \
         -f pulse \
                 -acodec pcm_f32le  \
                 -probesize 32 \
                 -i $(pactl list sources short|grep 'analog.*stereo.*monitor'|awk '{print $2}') \
         -f x11grab \
                 -framerate 60.00 \
                 -video_size 1920x1080 \
                 -i :0.0+0,0 \
                 -g 60 \
         -map 1:v \
         -map 0:a \
         -c:v h264_nvenc -qp 18 \
         -c:a aac -ac 2 -channel_layout stereo -b:a 128k -r:a 48000  \
         "/media/user/video12/$(date +%Y-%m-%d--%H-%M-%S)_TEST.mkv"

Attachments (4)

_recordDesktop.sh.log.txt (727.2 KB ) - added by betlog 2 years ago.
info, ffmpeg log
2022-12-21--15-30-55_TEST_H264-veryslow_waveform.png (4.0 KB ) - added by betlog 2 years ago.
2022-12-21--15-30-55_TEST_H264-veryslow.mp4 (2.3 MB ) - added by betlog 2 years ago.
pactl-list.txt (1.3 KB ) - added by betlog 2 years ago.
correcting prior omissions

Change History (14)

by betlog, 2 years ago

Attachment: _recordDesktop.sh.log.txt added

info, ffmpeg log

by betlog, 2 years ago

Attachment: pactl-list.txt added

correcting prior omissions

comment:1 by betlog, 23 months ago

Description: modified (diff)
Keywords: pulseaudio added

comment:2 by Balling, 23 months ago

Your version is too old. We only care about master.

Last edited 23 months ago by Balling (previous) (diff)

in reply to:  2 comment:3 by betlog, 23 months ago

Replying to Balling:

You version is too old. We only care about master.

Are you saying that the default version for 22.04 LTS is badly broken and nobody cares?

comment:4 by Balling, 23 months ago

We do not have LTS releases, it is only planned. Ubuntu having version 4 is hilarious. Why does only Chrome follow the rule to update ffmpeg ASAP?? LOL.

in reply to:  4 ; comment:5 by betlog, 23 months ago

Replying to Balling:

Ubuntu having version 4 is hilarious.

Ludicrous, yes.

For anyone wanting to update 22.04LTS:

apt policy ffmpeg
Installed: 7:4.4.2-0ubuntu0.22.04.1
want: FFmpeg 5.1.2

[edit: CAUTION: See post below]

https://ubuntuhandbook.org/index.php/2022/02/install-ffmpeg-5-0-ubuntu/
apt policy ffmpeg
sudo add-apt-repository ppa:savoury1/ffmpeg4
sudo add-apt-repository ppa:savoury1/ffmpeg5
sudo apt update
sudo apt full-upgrade

Last edited 20 months ago by betlog (previous) (diff)

in reply to:  5 comment:6 by betlog, 23 months ago

Replying to betlog:
...and yes, it seems to work perfectly now.
That issue has prevented me from using 22.04 for nearly a year. Ludicrous.

Last edited 23 months ago by betlog (previous) (diff)

comment:7 by Balling, 23 months ago

Resolution: invalid
Status: newclosed

Closing then. Ubuntu needs to understand that we are no different with Chrome.

comment:9 by Balling, 20 months ago

We do not have LTS releases, it is only planned.

Btw, we have an LTS release now.

comment:10 by betlog, 20 months ago

I can't tell what that means.
Do you refer to the imminent release of 23.04?
Or did someone fix 4.2.2? Link?

Presumably that's good news for me/22.04?
The timing is a little schadenfreude though; I spent the last few days realising that pulseaudio being replaced in 22.10 means I need to first understand it and then revise my scripts to adapt to wireplumber. So instead I booted 22.04 again and spent some time today writing a post-processing script to repair recordings afflicted by the audio lag issue. Before you said that I planed to just use 22.04 until I again feel the need to update kubuntu.

Note: See TracTickets for help on using tickets.