[Libav-user] rtsp over tcp by apies

Zanelli Franco fzanelli at tecnosens.it
Thu Mar 1 09:23:23 CET 2012

thank you very much, it works for me too.


Il 29/02/2012 18:44, Camera Man ha scritto: 

	On 02/29/2012 03:59 AM, Zanelli Franco wrote: 

		int res;
		AVFormatContext *fc = avformat_alloc_context();
		res = avformat_open_input(&fc, "rtsp://" <rtsp://> , 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?

	This works for me:
	    AVDictionary *opts = 0;
	    av_dict_set(&opts, "rtsp_transport", "tcp", 0);
	    if (avformat_open_input(&context, "rtsp://" <rtsp://> , 0, &opts) != 0) raise AVError("can't open input");

	Libav-user mailing list
	Libav-user at ffmpeg.org



Ing. Franco Zanelli
Sviluppo Software - Divisione Sistemi Videosorveglianza 
Software Engineer - Videosecurity System Division 

Via Vergnano, n.16, 25125 BRESCIA - ITALIA
Tel: +39 030.3534144 Fax: +39 030.3530815
Email: fzanelli at tecnosens.it
Web: http://www.tecnosens.it <http://www.tecnosens.it/>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120301/eb3c31fc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: immagini1
Type: image/png
Size: 8557 bytes
Desc: immagini1
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120301/eb3c31fc/attachment.png>

More information about the Libav-user mailing list