Is it possible to copy the audio codec for re-publish ?

burak guder

Member
I would like to provide rtmp re-publish function to my customer. When I send the video image as h264, CPU usage is working low and well, but when I send also the audio besides the image, then the CPU increases. I think webrtc acc kodec cannot be used. How can I send the file as acc? I don’t want the audio file to the transcode process.
 

Max

Administrator
Staff member
Good day.
From browser, WebRTC can only be published with Opus audio codec. RTMP, in its turn, can be published with AAC or Speex audio. So, if you republish WebRTC stream as RTMP, there will be audio transcoding.
To escape audio transcoding, you should publish RTMP stream with AAC audio, and republish it to a target server also as RTMP. In this case, you should setup custom SDP for publishing (flash_handler_publish.sdp)
Code:
v=0
o=- 1988962254 1988962254 IN IP4 0.0.0.0
c=IN IP4 0.0.0.0
t=0 0
a=sdplang:en
m=video 0 RTP/AVP 119
a=rtpmap:119 H264/90000
a=fmtp:119 profile-level-id=42e01f;packetization-mode=1
a=sendonly
m=audio 0 RTP/AVP 102 103 104 105 106 107 108 109 110
a=rtpmap:102 mpeg4-generic/48000/1
a=rtpmap:103 mpeg4-generic/44100/1
a=rtpmap:104 mpeg4-generic/32000/1
a=rtpmap:105 mpeg4-generic/24000/1
a=rtpmap:106 mpeg4-generic/22050/1
a=rtpmap:107 mpeg4-generic/16000/1
a=rtpmap:108 mpeg4-generic/12000/1
a=rtpmap:109 mpeg4-generic/11025/1
a=rtpmap:110 mpeg4-generic/8000/1
a=sendonly
and republishing (media_transponder.sdp)
Code:
v=0
o=- 1988962254 1988962254 IN IP4 0.0.0.0
c=IN IP4 0.0.0.0
t=0 0
a=sdplang:en
m=video 0 RTP/AVP 95 96
a=rtpmap:95 H264/90000
a=fmtp:95 profile-level-id=42e01f;packetization-mode=0
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42e01f;packetization-mode=1
a=recvonly
m=audio 0 RTP/AVP 103 96 97 98 99 100 102 108 104
a=rtpmap:108 mpeg4-generic/48000/1
a=rtpmap:96 mpeg4-generic/8000/1
a=rtpmap:97 mpeg4-generic/11025/1
a=rtpmap:98 mpeg4-generic/12000/1
a=rtpmap:99 mpeg4-generic/16000/1
a=rtpmap:100 mpeg4-generic/22050/1
a=rtpmap:104 mpeg4-generic/24000/1
a=rtpmap:102 mpeg4-generic/32000/1
a=rtpmap:103 mpeg4-generic/44100/1
a=recvonly
 
Top