Hi, I need to extract audio packets from an rtsp stream and to listen them with
a Qt
program.
The examples are based on *avcodec_decode_audio4* function but it is deprecated.
Now I already have an audio packet. Now I have to trascode it in a format that
I can
manage with Qt, something like
*AVAudioResampleContext** resample_context_ = NULL;
av_opt_set_int(resample_context_, "in_channel_layout",
av_get_default_channel_layout(codec_context_->channels), 0);
av_opt_set_int(resample_context_, "out_channel_layout",
av_get_default_channel_layout(outputFormat_.channels), 0);
av_opt_set_int(resample_context_, "in_sample_rate",
codec_context_->sample_rate, 0);
av_opt_set_int(resample_context_, "out_sample_rate", outputFormat_.rate, 0);
av_opt_set_int(resample_context_, "in_sample_fmt", codec_context_->sample_fmt,
0);
av_opt_set_int(resample_context_, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
if (avresample_open(resample_context_) < 0) {
qDebug() << "Could not open resample context.";
avresample_free(&resample_context_);
return;
}
but *AVAudioResampleContext* but it is deprecated too.
Can someone suggest me a way from
while (av_read_frame(pAVFormatContext, &pAVPacket)>= 0 && DoStart) {
if (pAVPacket.stream_index== StreamAudio) {
...
..
??
Many thanks
+39.347.4070897
http://www.labcsp.com[1]
http://www.denisgottardello.it[2]
GMT+1
Skype: mrdebug
--------
[1] http://www.labcsp.com
[2] http://www.denisgottardello.it
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".