Wowza Community

H.264 and AAC not working together (Native RTP streaming) !!!

Hi Charlie,

Currently, I am using the eval version of Wowza Media Server Pro 1.6.0 along with WowzaMediaServerPro1.6.0-patch19.

I am trying to stream H.264 and AAC to the Wowza server using the following SDP:

v=0

o=torosvi 0 0 IN IP4 200.201.202.181

s=videostream

c=IN IP4 200.201.202.181

t=0 0

m=audio 35012 RTP/AVP 97

a=sendrecv

a=rtpmap:97 MPEG4-GENERIC/11025/1

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;ndexdeltalength=3;config=1508

m=video 35014 RTP/AVP 98

a=sendonly

a=rtpmap:98 H264/90000

a=fmtp:98 packetization-mode=1

I could see from the Wowza logs that it receives both H.264 and AAC data but when I try to play the received data using the NativeRTPStreaming example, nothing seems to be played out.

NOTE: When I change the sdp to contain H.264 alone, Wowza receives the H.264 streams and I am able to play the received stream using the NativeRTPStreaming example.

Can you please check the above sdp information and point me if anything is wrong? I need both H.264 and AAC to be working together.

Regards,

Senthil

It looks like this SDP file is describing a stream that is not sending H.264 video (MPEG4-GENERIC). The Flash player only supports H.264 MPEG-4 video. It is not able to playback this format.

Charlie

I apologize. This is for AAC audio. I do see one problem with the data:

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;ndexdeltalength=3;config=1508

Should be:

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1508

Which encoder are you using? Can you try to turn on debug logging (edit [install-dir]/conf/log4j.properties and change the log level on the first line from INFO to DEBUG), play the stream for a while and send me the debug logs.

Charlie

My guess is that ffmpeg does not send out RTCP packets which are used to synchronize the audio and video data. Without this the audio and video timecodes are most likely not at all in sync. I would suggest that you try different values the RTP/AVSyncMethod in [install-dir]/conf/[application]/Application.xml. See if that helps.

Charlie

No, an flv container can only hold a single video and single audio stream.

Charlie

It looks like this SDP file is describing a stream that is not sending H.264 video (MPEG4-GENERIC). The Flash player only supports H.264 MPEG-4 video. It is not able to playback this format.

Charlie,

The following lines in sdp corresponds to AAC and not H.264:

m=audio 35012 RTP/AVP 97

a=sendrecv

a=rtpmap:97 MPEG4-GENERIC/11025/1

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1508

Can you please provide me a sample AAC sdp that is expected by Wowza server?

Regards,

Senthil

I apologize. This is for AAC audio. I do see one problem with the data:

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;ndexdeltalength=3;config=1508

Should be:

a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1508

Which encoder are you using? Can you try to turn on debug logging (edit

[install-dir]/conf/log4j.properties and change the log level on the first line from INFO to DEBUG), play the stream for a while and send me the debug logs.

Charlie

Hi Charlie,

‘i’ missing in “ndexdeltalength=3” is a copy-paste error when posting this question in the forum. Anyway, thanks for pointing that out.

We are using FFmpeg as the encoder.

Today, I could see that both H.264 and AAC are received by Wowza without any problems. But I noticed the following weird behavior whenever I send both H.264 and AAC to Wowza.

  1. With the stream type set to ‘rtp-live-record’, Wowza creates a FLV file with audio and video data. But, when I try to play the live data using the NativeRTPStreaming example, no audio is heard in Flash player (WIN 10,0,12,36) and the video display comes up very very late and seems to be quiet slow after that.

  2. When I try to play the .flv file created above, using the VLC player, only audio data is being played out by VLC and no video is seen.

  3. When I try to play the .flv file created above, using the Flash player (WIN 10,0,12,36) (via SimpleVideoStreaming example, only video data is being played out by Flash player and no audio could be heard.

  4. When I try to play the .flv file created above, using the Wimpy player, no audio is played out and the video display seems to be like fast forwarding.

IMPORTANT POINTS

  1. Whenever Wowza receives H.264 streams alone (without AAC), live playing using NativeRTPStreaming example seems to work out properly. Also, the flv file with H.264 data alone gets played out properly in VLC, Wimpy and Flash players.

  2. I could notice that the AAC data written by Wowza server in flv format could only be played out by VLC player and it fails with Wimpy FLV player, Flash Player etc.,.

  3. Live playing of the AAC data using NativeRTPStreaming example seems to be impossible.

  4. Whenever Wowza receives both H.264 and AAC, issues could be noticed in playing both the live and archived audio / video data (as explained above).

Do you have any idea on what could be the cause(s) for the issues noticed by me? Please let me know if I am missing something.

Regards,

Senthil

Hi Charlie,

Thanks for the reply. Changing the AVSyncmethod to rtptimecode solved the problem but not working always.

Also, I have a requirement wherein a half duplex video (video stream 1), and a full duplex video (audio stream 1 and audio stream 2) all need to be written into a single .flv file. Is that possible with the current archiving functionality available with Wowza?

Regards,

Senthil

Hi Charlie and Senpoc,

I’m having the exact same problem using the same approach:

ffmpeg to send h264+aac via rtp;

sdp generated by ffmpeg;

wowza only displays video, no audio;

Even when I try audio only, wowza doesn’t play anything. I’m using the LiveVideoStreaming example to play the stream.

I’ve tried several all the 3 modes for the AVSyncMethod parameter and none worked.

My sdp is similar to the one shown previously (also tried several different sdp settings):

o=- 0 0 IN IP4 127.0.0.1

t=0 0

s=No Name

a=tool:libavformat 52.34.0

c=IN IP4 192.168.1.102

m=video 60007 RTP/AVP 96

b=AS:200

a=rtpmap:96 H264/90000

a=fmtp:96 packetization-mode=1

m=audio 60009 RTP/AVP 96

c=IN IP4 192.168.1.102

b=AS:64

a=rtpmap:96 MPEG-4-GENERIC/44100/2

a=ftmp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexltalength=3; config=1210

In the logs (DEBUG mode) I don’t see any error, but shouldn’t the “rtp[audio:xxxx]…” line also have some processing lines after that, like the “rtp[video:xxxx]…” ones?

DEBUG server comment - rtp[video:317] {80 e0 14 2a 00 80 35 da 00 00 00 00 41 9a 21 30 }

DEBUG server comment - SINGLE: end:true tc:8402394 sz:305

DEBUG server comment - nalUnit: hdr:41 sz:230:234 typ:SLICE

DEBUG server comment - sliceType:5 frameType:2

DEBUG server comment - writePacket[vid]: sz:239 tc:1246528975775:8399391:1246528975770 key:false

DEBUG server comment - checkFlush[false,false,50]: tc:1246528975775>1246528975792 || rt:1246528975771>1246528975787

DEBUG server comment - rtp[audio:1288] {80 e0 02 3b 00 3e a8 00 00 00 00 00 00 70 06 a0 }

DEBUG server comment - rtp[video:379] {80 e0 14 2b 00 80 41 95 00 00 00 00 41 9a 31 b0 }

DEBUG server comment - SINGLE: end:true tc:8405397 sz:367

DEBUG server comment - nalUnit: hdr:41 sz:305:309 typ:SLICE

DEBUG server comment - sliceType:5 frameType:2

DEBUG server comment - writePacket[vid]: sz:314 tc:1246528975808:8402394:1246528975806 key:false

DEBUG server comment - checkFlush[true,false,50]: tc:1246528975808>1246528975792 || rt:1246528975807>1246528975787

DEBUG server comment - flush: notify:false tSize:2 dataObjs:17 time:70 tOffset:-7

Can anyone give me some help with this? I’m really stuck and running out of ideas…

Thanks,

Francisco

Forget all this…

This was just one big mistake I’ve made:

a=fmtp:96 packetization-mode=1

should be FTMP instead :o

After some hours trying different approachs and solutions, I was totally overlooking this…

Mental note: when having persistent problems, take a break and review everything after that.

:o:o:o