[Libav-user] av_open_input_file returns -2 but file exists (libav in NS2)

florencka florencka at gmail.com
Sat Aug 6 14:19:13 CEST 2011


I try to make a simulation in NS2 in which i read in .wav files, encodes into
gsm and send them over the network. I already managed to make an application
that reads in .wav, encodes into gsm and stores on the hard drive (tested,
works fine). Now i try to do the same extending the Network Simulator 2 and
i have a problem with av_open_input_file which constantly says there is no
such file, although i had no problems with that file in my gsm encoding
application. The call i use:

av_open_input_file(&pFormatCtx, "/home/xxx/audio_samples/audio.wav", NULL,
0, NULL);

Already tried different files, hardcoding the path, absolute path, relative
path and putting "file://" in front because libav apparently uses some sort
of file protocol. Then I tried opening the file myself with:

int desc = open("/home/xxx/audio_samples/audio.wav", O_RDONLY, 0);

(found this call in file.c of libav that is supposed to be called by
av_open_input_file) No problems with opening the file like that, everything
seems to be ok, so now i have no idea what else could be wrong. 

Any suggestions?

Best regards,
florencka

--
View this message in context: http://libav-users.943685.n4.nabble.com/av-open-input-file-returns-2-but-file-exists-libav-in-NS2-tp3723236p3723236.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list