[Freeswitch-users] youtube broadcast from freeswitch audio quality
Charlie DeTar
cfd-fs at fohn.org
Wed May 2 02:10:09 UTC 2018
Hi,
I'm trying to broadcast multiparty audio and video through youtube, using this stack:
Browser (Chrome) -> Custom webapp using Verto -> mod_conference -> record to rtmp -> youtube live
However, I'm getting poor audio quality on youtube in the live broadcast. Here's an example (this video is screen-capped from the live player, because youtube seems to clean up the recorded file after the fact. I've tested with multiple computers/browsers that this is how it sounds to everyone during the live broadcast.):
https://youtu.be/bO8t78YXxjc
That is using the "Low Latency" setting in youtube. The conference.conf.xml "interval" parameter seems to also have an effect; I have it set to 10 here as that seemed to get fewer pops than the default 20.
Using youtube's "Ultra-low latency" setting, things are even worse:
https://youtu.be/ShuitSWYy5A
The "Normal latency" setting is better, but still has more frequent popping than I'd like:
https://youtu.be/cyZQTWDctEs
The same configuration when pointed at UStream endpoint instead of YouTube produces fine audio quality (the following example is screencapped from a live ustream player then uploaded to youtube):
https://www.youtube.com/watch?v=Ng9boh_5_ik
I've been trying to tweak all of the audio parameters I can find to discern some magic combination that makes youtube happy -- but I haven't been able to find something that gets rid of the popping. The fact that UStream likes the audio just fine tells me that there's some incompatibility between freeswitch's stream and youtube, and not just brokenness on the webrtc or mux setup. I've tried 48kHZ, 44.1kHz, and lower; stereo and mono; various interval settings; and a lot of other parameters that appear to be unrelated (does rtmp.conf.xml get involved in recording a conference at all, or is that just for incoming rtmp calls?).
Any ideas on what I might need to change to make freeswitch-to-youtube live audio smooth?
The following is my conference.conf.xml in its entirety. Happy to share other configs if helpful.
<!-- http://wiki.freeswitch.org/wiki/Mod_conference -->
<!-- None of these paths are real if you want any of these options you need to really set them up -->
<configuration name="conference.conf" description="Audio Conference">
<!-- Advertise certain presence on startup . -->
<advertise>
<room name="3001@$${domain}" status="FreeSWITCH"/>
</advertise>
<!-- These are the default keys that map when you do not specify a caller control group -->
<!-- Note: none and default are reserved names for group names. Disabled if dist-dtmf member flag is set. -->
<caller-controls>
<group name="default">
<control action="deaf mute" digits="**"/>
<control action="mute" digits="0"/>
<control action="vmute" digits="*0"/>
<control action="vmute snap" digits="*1"/>
<control action="vmute snapoff" digits="*2"/>
<control action="energy up" digits="9"/>
<control action="energy equ" digits="8"/>
<control action="energy dn" digits="7"/>
<control action="vol talk up" digits="3"/>
<control action="vol talk zero" digits="2"/>
<control action="vol talk dn" digits="1"/>
<control action="vol listen up" digits="6"/>
<control action="vol listen zero" digits="5"/>
<control action="vol listen dn" digits="4"/>
<control action="hangup" digits="#"/>
</group>
</caller-controls>
<!-- Profiles are collections of settings you can reference by name. -->
<profiles>
<profile name="plenary-conference-profile">
<param name="domain" value="$${domain}"/>
<param name="rate" value="44100"/>
<param name="channels" value="2"/>
<param name="interval" value="10"/>
<param name="interval" value="10"/>
<param name="energy-level" value="0"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<!--
Concatenate some silence on the front of conf-alone so it doesn't get
cut off as it usually does. Syntax:
http://lists.freeswitch.org/pipermail/freeswitch-users/2013-February/093019.html
-->
<!--
Disable these sounds
<param name="alone-sound" value="file_string://silence_stream://5000!conference/conf-alone.wav"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
-->
<param name="moh-sound" value="silence"/>
<param name="comfort-noise" value="0"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="conference-flags" value="livearray-sync|minimize-video-encoding|livearray-json-status"/>
<!-- video params -->
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="overlaps-with-floor"/>
<param name="video-auto-floor-msec" value='10' />
<!--<param name="video-canvas-size" value="1920x1080"/>-->
<param name="video-canvas-size" value="1280x720"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="5mb"/>
<param name="video-fps" value="30" />
<param name='auto-record' value='rtmp://a.rtmp.youtube.com/live2/<... youtube secret streaming key ...>'/>
<param name='min-required-recording-participants' value='1'/>
</profile>
</profiles>
</configuration>
More information about the FreeSWITCH-users
mailing list