Wowza Community

Audio transcoding

Is it possible to use the wowza engine transcoder to change audio sample rate and number of channels?
More specific: AAC 1 channel 44100Hz -> opus 2 channels 48000Hz

Thanks
Yossi

Yes, we now support resampling of sample rates and channels.

You’ll need to go to this document and scroll down to the section for Set up an RTMP source for a transcoded video and audio stream and click on " SEE THE STEPS."

You’ll see this in that section:



That is the correct way of setting the channels to 2 & adjusting the sample rate.

1 Like

Thanks! Yet it doesn’t work for me.
After following the document and adding the relevant parameters to the existing audioonly.xml, when I’m trying to play WebRTC I’m getting stream is not ready error.
I also see error in the logs: JNI:AudioEncoderOpus.initialize[_defaultVHost_:live/_definst_/test:opus]: Sample rate is not supported [8KHz, 12KHz, 16KHz, 24KHz, 48KHz]: 44100
Log lines added at the end.

  • I can play the original stream with WebRTC without audio of course.
  • If I resample + stereo before sending to the engine - the transcoder (without the extra parameters of resampling in the transcoder) works fine and I can play it with audio on the WebRTC player.

Log:
#Version: 1.0
#Start-Date: 2021-01-06 12:47:32 UTC
#Software: 4.8.8.01 build20201216140014
#Date: 2021-01-06

UTC comment server I2021-01-06 14:23:28NFO 200 - MediaCasterStreamValidator.init[live/definst]: Started defaultVHost - - 1003.23 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:29 UTC app-start application INFO 200 definst live/definst defaultVHost live definst 1003.378 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:29 UTC connect-pending session INFO 100 10.200.10.10 - defaultVHost live definst 0.794 [any] 1935 rtmp://100.127.42.218:1935/live 10.200.10.10 rtmp - FMLE/3.0 (compatible; Lavf58.65.100) 1323550232 3230 3073 - - - - - - - - - - - - - rtmp://100.127.42.218:1935/live -
2021-01-06 14:23:29 UTC connect session INFO 200 10.200.10.10 - defaultVHost live definst 0.81 [any] 1935 rtmp://100.127.42.218:1935/live 10.200.10.10 rtmp - FMLE/3.0 (compatible; Lavf58.65.100) 1323550232 3230 3073 - - - - - - - - - - - - - rtmp://100.127.42.218:1935/live -
2021-01-06 14:23:29 UTC create stream INFO 200 - - defaultVHost live definst 0.017 [any] 1935 rtmp://100.127.42.218:1935/live 10.200.10.10 rtmp - FMLE/3.0 (compatible; Lavf58.65.100) 1323550232 3357 3413 1 0 0 0 - - - - - - rtmp://100.127.42.218:1935/live rtmp://100.127.42.218:1935/live - rtmp://100.127.42.218:1935/live -
2021-01-06 14:23:30 UTC publish stream INFO 200 test - defaultVHost live definst 0.526 [any] 1935 rtmp://100.127.42.218:1935/live 10.200.10.10 rtmp - FMLE/3.0 (compatible; Lavf58.65.100) 1323550232 3403 3602 1 0 0 0 test - - - - - rtmp://100.127.42.218:1935/live/test rtmp://100.127.42.218:1935/live/test - rtmp://100.127.42.218:1935/live -
2021-01-06 14:23:30 UTC comment server INFO 200 - LiveReceiver.init[live/definst/test]: sortPackets:false flushInterval:50 onFlushNotifyClients:true sendSetDataFrame:false sendUpdatedOnMetaData:false audioLag:0 videoLag:0 defaultVHost live definst 1004.759 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - TranscoderSessionNative.loadLibrary: Load transcoder list file: /usr/local/WowzaStreamingEngine/lib-native/linux64/transcoder.list defaultVHost live definst 1004.776 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:VideoEncoderH264QuickSyncHost.VideoEncoderH264QuickSyncHost[global]: Could not load shared library: libva.so.1: cannot open shared object file: No such file or directory defaultVHost live definst 1005.032 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:VideoEncoderH264QuickSyncHost.VideoEncoderH264QuickSyncHost[global]: Could not load shared library: libva-x11.so.1: cannot open shared object file: No such file or directory defaultVHost live definst 1005.033 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - LiveStreamTranscoder.init[live/definst/test]: Load transcoder template: file:///usr/local/WowzaStreamingEngine/transcoder/templates/No Video.xml defaultVHost live definst 1005.053 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:TranscoderSession.isCUDAAvailable[defaultVHost:live/definst/test]: NVidia hardware acceleration is NOT available defaultVHost live definst 1005.142 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:TranscoderSession.isQuickSyncAvailable[defaultVHost:live/definst/test]: Intel Quick Sync hardware acceleration is NOT available. defaultVHost live definst 1005.143 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:TranscoderSession.isBeamrAvailable[defaultVHost:live/definst/test]: Beamr4 is available: ENC[H264] DEC[H264], build:5.53003 defaultVHost live definst 1005.143 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:TranscoderSession.isBeamrAvailable[defaultVHost:live/definst/test]: Beamr5 is available: ENC[H265] DEC[H265], build:4.5 defaultVHost live definst 1005.144 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - JNI:TranscoderSession.isIntrinsicScalerAvailable[defaultVHost:live/definst/test]: Intrinsic scaler is available defaultVHost live definst 1005.144 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC transcoder-start transcoder INFO 200 test {“encoder”:false, “sortBufferEnable”:true, “sortBufferSize”:750, “sortBufferFlushInterval”:75} defaultVHost live definst 2.101 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC create stream INFO 200 - - - - - 0.005 - - - - - - - - - - 1 0 0 0 - - - - - - - - - - -
2021-01-06 14:23:30 UTC publish stream INFO 200 test_opus - - - - 0.013 - - - - - - - - - - 1 0 0 0 test_opus - - - - - /test_opus /test_opus - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - MediaStreamMap.getLiveStreamPacketizer[live/definst/test]: Create live stream packetizer: mpegdashstreamingpacketizer:test - - - 1005.233 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.init[live/definst/test]: chunkDurationTarget: 10000 - - - 1005.261 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.init[live/definst/test]: chunkDurationTolerance: 500 - - - 1005.261 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:30 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.init[live/definst/test]: playlistChunkCount:4 - - - 1005.262 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - JNI:TranscoderSession.audioDecoderCreate[defaultVHost:live/definst/test]: Create audio decoder: AAC: default - - - 1005.294 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC decoder-audio-start transcoder INFO 200 test {“codec”:“AAC”, “objectType”:“LC”, “sampleRate”:44100, “channels”:1, “resample”:false} - - - 1005.295 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - JNI:TranscoderSession.audioEncoderAdd[defaultVHost:live/definst/test:opus]: Create audio encoder: OPUS: default - - - 1005.31 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server ERROR 500 - JNI:AudioEncoderOpus.initialize[defaultVHost:live/definst/test:opus]: Sample rate is not supported [8KHz, 12KHz, 16KHz, 24KHz, 48KHz]: 44100 - - - 1005.315 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerPacketHandler.startStream[live/definst/test][a/v] - - - 1005.336 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - MediaStreamMap.getLiveStreamPacketizer[live/definst/test]: Create live stream packetizer: sanjosestreamingpacketizer:test - - - 1005.345 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - SanJosePacketHandler.startStream[live/definst/test] - - - 1005.351 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.handlePacket[live/definst/test]: Video codec: H264 - - - 1005.351 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.handlePacket[live/definst/test]: Audio codec: AAC - - - 1005.352 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - MediaStreamMap.getLiveStreamPacketizer[live/definst/test]: Create live stream packetizer: smoothstreamingpacketizer:test - - - 1005.386 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.startStream[live/definst/test] - - - 1005.394 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.init[live/definst/test]: chunkDurationTarget: 10000 - - - 1005.426 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.init[live/definst/test]: audioGroupCount: 3 - - - 1005.428 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.init[live/definst/test]: playlistChunkCount:3 - - - 1005.434 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - MediaStreamMap.getLiveStreamPacketizer[live/definst/test]: Create live stream packetizer: cupertinostreamingpacketizer:test - - - 1005.435 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - CupertinoPacketHandler.startStream[live/definst/test] - - - 1005.436 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.handlePacket[live/definst/test]: Video codec:H264 isCompatible:true - - - 1005.437 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.handlePacket[live/definst/test]: Audio codec:AAC isCompatible:true - - - 1005.437 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.handlePacket[live/definst/test][avc1.42c01e]: H.264 Video info: {H264CodecConfigInfo: codec:H264, profile:Baseline, level:3.0, frameSize:720x1520, displaySize:720x1520, frameRate:6.0} - - - 1005.447 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.handlePacket[live/definst/test][mp4a.40.2]: AAC Audio info: {AACFrame: codec:AAC, channels:1, frequency:44100, samplesPerFrame:1024, objectType:LC} - - - 1005.465 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.handlePacket[live/definst/test]: Fragment durations: [0.6,1.8,1.9] - - - 1005.733 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.flushPendingVideo: Bitrate[live/definst/test]: 318068 - - - 1005.734 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:0 count:1 duration:654 - - - 1005.784 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveReceiver.init[live/definst/test_opus]: sortPackets:false flushInterval:50 onFlushNotifyClients:true sendSetDataFrame:false sendUpdatedOnMetaData:false audioLag:0 videoLag:0 - - - 1005.981 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerPacketHandler.handlePacket[live/definst/test][a/v]: Video codec:H264 isCompatible:true - - - 1005.992 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerPacketHandler.handlePacket[live/definst/test][a/v]: Audio codec:AAC isCompatible:true - - - 1005.993 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerPacketHandler.handlePacket[[live/definst/test][a/v]][mp4a.40.2]: AAC Audio info: {AACFrame: codec:AAC, channels:1, frequency:44100, samplesPerFrame:1024, objectType:LC} - - - 1005.994 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerPacketHandler.handlePacket[[live/definst/test][a/v]][avc1.42c01e|avc1.66.30]: H.264 Video info: {H264CodecConfigInfo: codec:H264, profile:Baseline, level:3.0, frameSize:720x1520, displaySize:720x1520, frameRate:6.0} - - - 1006.008 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.flushPendingAudio: Bitrate[live/definst/test]: 63738 - - - 1006.021 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:0 count:87 duration:2020 - - - 1006.101 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:31 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:1 count:12 duration:1857 - - - 1006.181 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:1 count:87 duration:2020 - - - 1006.288 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:2 count:12 duration:1984 - - - 1006.515 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:3 count:12 duration:1852 - - - 1006.83 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:2 count:87 duration:2020 - - - 1006.832 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.endChunkTS[live/definst/test]: Add chunk: id:1 mode:TS[H264,AAC] a/v/k:144/61/6 duration:10013 - - - 1006.854 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:32 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.endChunkTS[live/definst/test]: Add chunk: id:1 a/v/k:433/62/6 duration:10013 - - - 1006.861 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:33 UTC comment server INFO 200 - MPEGDashWriterHandler.createSegmentM4S[live/definst/test][a/v]: Add segment: id:1 type:m4s_audio a:432 start:0 duration:10031 - - - 1007.468 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:33 UTC comment server INFO 200 - MPEGDashWriterHandler.createSegmentM4S[live/definst/test][a/v]: Add segment: id:1 type:m4s_video v/k:61/6 start:0 duration:10013 - - - 1007.469 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:33 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:4 count:12 duration:1991 - - - 1007.812 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:33 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:3 count:87 duration:2020 - - - 1007.916 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:35 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:5 count:12 duration:1675 - - - 1009.788 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:35 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:4 count:87 duration:2020 - - - 1009.8 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:37 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:6 count:12 duration:1841 - - - 1011.697 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:37 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:5 count:87 duration:2020 - - - 1011.921 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:39 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:7 count:12 duration:2010 - - - 1013.729 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:39 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:6 count:87 duration:2020 - - - 1013.934 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:41 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:8 count:12 duration:1992 - - - 1015.594 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:41 UTC comment server INFO 200 - WebSocketSession.create[2012597295] - - - 1015.617 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:41 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:7 count:87 duration:2020 - - - 1015.94 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:41 UTC comment server WARN 200 - WebRTCCommands.getOffer[live/definst/test_opus]: STATUS_STREAM_NOT_READY: test_opus - - - 1015.952 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:43 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:video id:9 count:12 duration:1960 - - - 1017.618 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:43 UTC comment server INFO 200 - LiveStreamPacketizerSanJose.endChunkTS[live/definst/test]: Add chunk: id:2 a/v/k:505/73/6 duration:11701 - - - 1017.62 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:43 UTC comment server INFO 200 - LiveStreamPacketizerCupertino.endChunkTS[live/definst/test]: Add chunk: id:2 mode:TS[H264,AAC] a/v/k:168/72/6 duration:11701 - - - 1017.62 - - - - - - - - - - - - - - - - - - - - - - - - -
2021-01-06 14:23:43 UTC comment server INFO 200 - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/test]: Add chunk: type:audio id:8 count:87 duration:2020 - - - 1017.838 - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks
Yossi

Well that stinks, I don’t see anything jumping out at me as far as why not in the logs and why it doesn’t like that 44100Hz. It will require the change to stereo as well for the audio to work, did you change that as well?

If your source isn’t configured to send stereo audio, in the <Decode> / <Audio> container, set the default.scaleChannels parameter to 2 to force any mono audio frames to stereo by duplicating the mono stream for both the left and right channels.

WebRTC can be a complicated protocol for a lot of reasons that aren’t always your fault. The engineers are requesting a support ticket so they can further investigate this issue.

They’ll need to replicate and test which means uploading your files and logs through a ticket here:

https://www.wowza.com/support/open-tickethttps://www.wowza.com/support/open-ticket

They can quickly identify what the problem is here @Yossi_Dar

I think I am seeing it is only 1 channel though in the logs, it needs to be stereo for webrtc audio to work. Also disable B frames in the encoder settings for a better WebRTC stream, it doesn’t like B-frames.