At 2017-01-06 19:28:31, "Gabor Alsecz" <[email protected]> wrote:
Hello Guys,
Do you have any up-to-date example how can i decode audio from h264 RTSP stream
and save to mp3? Thanks a lot!
br,
Gabor
If the audio from your RTSP stream is already mp3, you will just have too look
at remuxing.c example, add a few lines for RTSP support such as :
avformat_network_init();
AVDictionary *open_input_dict = NULL;
av_dict_set(&open_input_dict, "rtsp_transport", "tcp", 0);
avformat_open_input(&ifmt_ctx, in_filename, 0, &open_input_dict);
and filter audio packets, checking i for
AVFormatContext->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_AUDIO and
sorting the packets depending on their stream index.
If you also need to re-encode the audio, have a look at decoding_encoding.c and
other examples. Here are some details for the new enconding / decoding API :
https://blogs.gentoo.org/lu_zero/2016/03/29/new-avcodec-api/
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user