[Ffmpeg-devel] question on rtsp with libavformat

sfjester at umd.edu sfjester
Thu Jun 22 17:42:55 CEST 2006


Hello all, 

I'm currently working on a program using the avformat and 
avcodec libraries that will take a video file and output a 
jpeg image for each frame.  It's working exactly as I want it 
so far except for one thing: it doesn't work for rtsp stream 
input.


Unfortunatly, I really don't have any choice but to write the 
program in VC++, so I've had to use the avformat.dll and 
avcodec.dll files, and since the .lib files are missing, I 
have to use run-time linking.

For the input portion of the code, I followed Martin B?hme's 
demo program closely. 

>From what I can tell (which isn't much), rtsp_init() is never 
called, or if it is, because of the run-time linking or 
similar problem it fails to accomplish what it's meant to.

When I call:
av_open_input_file(&pFormatCtx, stream, NULL, 0, NULL);

The actuall code being (all of this included for each 
function I mention):

typedef int (av_open_input_file)(AVFormatContext**, const 
char*, AVInputFormat*, int, AVFormatParameters*);
av_open_input_file * avOpen = (av_open_input_file*)
GetProcAddress(avFormat, "av_open_input_file");
	if(avOpen == NULL)
		cout<<"couldn't get function 'open 
file'"<<endl;
	if((i = avOpen(&pFormatCtx, stream,	pRTSP, 0, 
NULL))<0)
	{	
		cout<<"couldn't open the file, error 
code: "<<i<<endl;
        }

it returns with error code -2, AVERROR_IO, and in 
av_open_input_file, that can occur by failing the url_fopen 
call.

I then tried to pass the rtsp_demux AVInputFormat instance 
into av_open_input_file directly, after having tried to find 
it through av_find_input_format("rtsp"), but that didn't work 
either, av_find_input_format returned NULL.

I can't even call rtsp_init() myself, as a GetProcAddress to 
find it returns NULL as well.



I guess I have a number of questions:
1) Is rtsp input format supported for what I'm trying to do?
2) Is there a better way to open an rtsp stream than through 
av_open_input_file()?
3) If not, how do you open an rtsp stream through 
av_open_input_file()?
4) Are there better smaple programs to look at that 
output_example.c or the demo program I mentioned before?
5) Is there actually some way to accomplish this with these 
libraries, or am I better off trying something else?
6) Is there a way to get the missing .lib files so that I 
could try this program with static linking?


Thanks much,
-Scott




More information about the ffmpeg-devel mailing list