Closed roman-miniailov closed 5 years ago
Did you try to set extradata field for AVCodecContext ? Your RawAACFrame has ConfigSegment property, you need to use it.
Doesn't worked...
Using same code as for video codec.
if (rawAudioFrame is RawAACFrame rawAacFrame)
{
if (rawAacFrame.ConfigSegment.Array != null &&
!_extraData.SequenceEqual(rawAacFrame.ConfigSegment))
{
if (_extraData.Length != rawAacFrame.ConfigSegment.Count)
_extraData = new byte[rawAacFrame.ConfigSegment.Count];
Buffer.BlockCopy(rawAacFrame.ConfigSegment.Array, rawAacFrame.ConfigSegment.Offset,
_extraData, 0, rawAacFrame.ConfigSegment.Count);
fixed (byte* initDataPtr = &_extraData[0])
{
resultCode = FFmpegPInvoke.SetDecoderExtraData(_decoderHandle,
(IntPtr)initDataPtr, _extraData.Length);
if (resultCode != 0)
throw new DecoderException(
$"An error is occurred while setting audio extra data, {_audioCodecId} codec, code: {resultCode}");
}
}
}
Mr BogdanovKirill.
My friend ~!~! Cheer up!
i wating for your reply^^
and Thanks anything ~!
i wating for your reply^^
Do you have the same issue?
I need RTSP server with AAC audio. I could make some research on nearest saturday or sunday
I'm using the following URL for tests - rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov
Thank you!
@roman-minyaylov
Yep !! +.+
Any news? May I help?
Can I pay you something to resolve this issue?
(Have same problem with AMCREST IP camera)
@roman-minyaylov
Sorry, I don't have free time now. I will try to make it at this weekend. You could support me through paypal or could make your offer directly to bogdanov.kv@bk.ru
Hi guys,
Thank you for your work. Today I've fixed bug in AAC parser (new version of nuget package is available): https://github.com/BogdanovKirill/RtspClientSharp/commit/8069d3c87d682c078c1612f92846032092284306 That should resolve all decoding problems with AAC frames. Also I've written audio decoder for SimpleRtspPlayer in master branch. You could get all this code to use it in your projects: https://github.com/BogdanovKirill/RtspClientSharp/commit/0eec11dd5bfafde68c0444a77f7149eec8a22059 Please start from "RealtimeAudioSource" class. It will give you PCM frames which could be played by NAudio or something else. Later I will write playback logic by myself.
안녕 얘들 아,
당신의 일에 감사드립니다. 오늘 AAC 파서에서 버그를 수정했습니다 (새로운 버전의 Nuget 패키지를 사용할 수 있습니다) : 8069d3c AAC 프레임의 모든 디코딩 문제를 해결해야합니다. 또한 master 브랜치에 SimpleRtspPlayer 용 오디오 디코더를 작성했습니다. 이 코드를 모두 프로젝트에서 사용할 수 있습니다 : 0eec11d "RealtimeAudioSource"클래스부터 시작하십시오. NAudio 또는 다른 어떤 것으로 재생할 수있는 PCM 프레임을 제공합니다. 나중에 나는 스스로 재생 논리를 쓸 것이다.
Thanks !!!!!!!!!!!!!!!!!!!! Mr. !!
i hope your life is Happy !!
It seems that we could close that issue
I'm trying to add AAC audio decoding to your player sample app.
I'm using 86018 as audio codec ID (AAC), avcodec_find_decoder gave me ff_aac_decoder.
I'm using code like in your sample but for audio buffer:
len is AVERROR_INVALIDDATA after method call.
I'm using classic AVERROR_INVALIDDATA stream.
Used data is
byte* rawBufferPtr = &rawAudioFrame.FrameSegment.Array[rawAudioFrame.FrameSegment.Offset]
Am I doing something wrong here (maybe FFMPEG wrong usage)?