简体   繁体   中英

RTP AAC timestamps issue

I'm trying to stream AAC audio to Wowza server via RTP. I managed to make it work but I hear alternately the sound very fast and then a 1s blank. Sample rate is 22050 and frames per packet is 1024.

Currently my timestamps are generated like that :

long _timestamp;

//--- called each time I have to send a new AAC packet ---//
-(void) updateTimestamp{
    if(! _timestamp)
        _timestamp = random();
    else
        _timestamp += 1024;
    rtptime = big_endian(_timestamp);
}

is it correct ? I don't know why the output is that weird ans any help would be apreciated :)

是的,逻辑是正确的,但是使用unsigned long代替了long,因此可以在unsigned long达到最大值时舍入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM