Twitch-Streamer-Linux
Twitch-Streamer-Linux copied to clipboard
Audio always out of sync
Tried streaming using your scripts on Ubuntu 13.10 and it always puts my audio out of sync.
add -async <int seconds> to resync the audio. it's a ffmpeg/avconv problem.
an example:
... -ac 2 -ar $AUDIO_RATE -async 1 -vcodec libx264 ...
please always define the script used.
liamdawe looks like there was a strange problem with the -r option. can you try again with the new script?
I tried the latest version of the script, and still have sync issues. I think the issue is more complex than it looks.
If I don't use -async, audio on the twitch player will be a bit faster the the source, then go silent. After a while audio playback starts again, and repeats the process. It can happen 2 or 3 times, then the stream will crash.
If I use -async, streaming the desktop is ok, but most games will crash the stream on start with this error :
Non-monotonous timestamps, dropping whole buffer..88 bitrate= 507.5kbits/s
[flv @ 0x1c47be0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 5419 >= 5138
av_interleaved_write_frame(): Invalid argument
It really looks like a conflict between 48000Hz pulseaudio output and avconv/libmp3lame 44100Hz output. Somehow, bitrate conversion fails, but i don't know where... The issue makes it impossible for me to stream audio. Video, on the other hand is working perfectly.
install libflac and open the script, then change the codec from libmp3lame to flac and set the frequency to 48000
It doesn't seem possible with a 48000Hz samplerate :
[flv @ 0x16e0d20] flv does not support that sample rate, choose from (44100, 22050, 11025).
then the most simple thing you can do is edit the etc/pulse/daemon.conf and set the frequency of pulseaudio to 44100
; default-sample-format = s16le
; default-sample-rate = 44100
PS: you will need to restart the server by writing on the terminal: pulseaudio -k