<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
    <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
    text="#000000">
    On 02/29/2012 03:59 AM, Zanelli Franco wrote:
    <blockquote
cite="mid:A95AF8BE97643040B04B87EF3ED776F435591C@server01.tecnosens.local"
      type="cite">
      <pre wrap="">int res;
AVFormatContext *fc = avformat_alloc_context();
res = avformat_open_input(&fc, <a class="moz-txt-link-rfc2396E" href="rtsp://10.0.0.204/media?tcp">"rtsp://10.0.0.204/media?tcp"</a>, NULL, NULL);

I found out that ?tcp option passed via rtsp URL is deprecated and now 
we use -rtsp_transport parameter, but how can I set this using ffmpeg 
apies? Is there a parameter in AVFormatContext or AVCodecContext that I 
have to set?</pre>
    </blockquote>
    This works for me:<br>
    <br>
    <pre>    AVDictionary *opts = 0;</pre>
    <pre>    av_dict_set(&opts, "rtsp_transport", "tcp", 0);</pre>
    <pre>    if (avformat_open_input(&context, <a class="moz-txt-link-rfc2396E" href="rtsp://10.20.30.40/video">"rtsp://10.20.30.40/video"</a>, 0, &opts) != 0) raise AVError("can't open input");</pre>
    <br>
    <br>
  </body>
</html>