I created an app that uses rtmp and ffmppeg and youtube api for streaming to youtube,
when i stream and i go to youtube i face sound issues, the sound of the live sounds laggy and robotic.
this is my configuration :
const commonOutputOptions = [
‘-c:v libx264’,
‘-c:a aac’,
‘-preset veryfast’,
‘-crf 30’,
‘-b:v 3500k’,
‘-b:a 128k’,
‘-ac 2’,
‘-ar 44100’,
‘-g 48’,
‘-keyint_min 48’,
‘-pix_fmt yuv420p’,
‘-x264-params keyint=48:min-keyint=48:scenecut=-1’,
‘-flvflags no_duration_filesize’,
‘-probesize 32’,
‘-analyzeduration 0’,
‘-f flv’,
];
i tried to change it to :
const commonOutputOptions = [
‘-re’, // Enable real-time mode for streaming.
‘-c:v libx264’,
‘-c:a aac’,
‘-preset veryfast’,
‘-crf 23’, // Improved quality setting.
‘-b:v 4500k’, // Adjusted bitrate for better quality.
‘-b:a 160k’, // Higher audio bitrate.
‘-ac 2’,
‘-ar 48000’, // Updated sample rate.
‘-g 48’,
‘-keyint_min 48’,
‘-pix_fmt yuv420p’,
‘-x264-params keyint=48:min-keyint=48:scenecut=-1’,
‘-flvflags no_duration_filesize’,
‘-f flv’,
‘-movflags +faststart’, // Improved streaming compatibility.
];
and to this :
const commonOutputOptions = [
‘-c:v libx264’,
‘-c:a aac’,
‘-preset veryfast’,
‘-crf 30’,
‘-b:v 3500k’,
‘-b:a 128k’,
‘-ac 2’,
‘-ar 48000’, // Updated sampling rate
‘-g 48’,
‘-keyint_min 48’,
‘-pix_fmt yuv420p’,
‘-x264-params keyint=48:min-keyint=48:scenecut=-1’,
‘-flvflags no_duration_filesize’,
‘-f flv’,
];
i tried differnt configurations and nothing makes the sound normal.
when i stream to facebook and twitch the sound is perfect.
2
Answers
Same problem here.
I would love to get a solution.
I also encountered the same problem, I would appreciate an update