Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:01:46+00:00 2026-06-03T01:01:46+00:00

I am currently developing an application that needs to decode a UDP multicast RTSP

  • 0

I am currently developing an application that needs to decode a UDP multicast RTSP stream. At the moment, I can view the RTP stream using ffplay via

ffplay -rtsp_transport udp_multicast rtsp://streamURLGoesHere

However, I am trying to use FFMPEG to open the UDP stream via (error checking and cleanup code removed for the sake of brevity).

AVFormatContext* ctxt = NULL;
av_open_input_file(
    &ctxt,
    urlString,
    NULL,
    0,
    NULL
);

av_find_stream_info(ctxt);

AVCodecContext* codecCtxt;

int videoStreamIdx = -1;
for (int i = 0; i < ctxt->nb_streams; i++)
{
    if (ctxt->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
    {
        videoStreamIdx = i;
        break;
    }
}

AVCodecContext* codecCtxt = ctxt->streams[videoStreamIdx]->codec;
AVCodec* codec = avcodec_fine_decoder(codecCtxt->codec_id);
avcodec_open(codecCtxt, codec);

AVPacket packet;
while(av_read_frame(ctxt, &packet) >= 0)
{
    if (packet.stream_index == videoStreamIdx)
    {
        /// Decoding performed here
        ...
    }
}

...

This approach works fine with file inputs that consist of a raw encoded video stream, but for UDP multicast RTSP streams, it fails any error checking performed on av_open_input_file(). Please advise…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:01:47+00:00Added an answer on June 3, 2026 at 1:01 am

    It turns out that opening a multicast UDP RTSP stream can be performed via the following:

    AVFormatContext* ctxt = avformat_alloc_context();
    
    AVDictionary* options = NULL;
    av_dict_set(&options, "rtsp_transport", "udp_multicast", 0);
    avformat_open_input(
        &ctxt,
        urlString,
        NULL,
        &options
    );
    
    ...
    
    avformat_free_context(ctxt);
    

    Using avformat_open_input() in this manner instead of av_open_input_file() results in the desired behavior. I’m guessing that av_open_input_file() is either deprecated or was never intended to be used in this manner — more than likely the latter 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing an Android application that fetches images using http requests. It would
I am developing an application that currently has a View Controller (call it ViewControllerX).
Im currently developing an application that needs to store a 10 to 20 digit
I'm currently developing an application that needs to parse some (a big file of)
I'm currently developing an application that needs to communicate with a webservice on the
I'm currently developing a MVC3 web application that needs to require extranet users to
I'm currently developing an application that needs to store data in it's on database,
I am currently developing an application that needs to record audio, encode it as
I am currently developing an iOS application that needs a backend to pull data
I'm currently developing a C-module for a Java-application that needs some performance improvements (see

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.