using avformat_open_input
#1
Hey guys,

I'm trying to port some work I did on XBMC 10.0 to "Eden" but failing. I have a procedure that opens a video and checks for specific stream. The relevant part looks like that:

bool Scan(CStdString fileName)
{
DllAvFormat m_dllAvFormat;
DllAvCodec m_dllAvCodec;
DllAvUtil m_dllAvUtil;


// Register all formats and codecs
if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllAvFormat.Load()) {
CLog::Log(LOGERROR,"Failed to load ffmpeg libraries");
return false;
}

m_dllAvFormat.av_register_all();

// Open video file
if(m_dllAvFormat.av_open_input_file(&pFormatCtx, fileName.c_str(), NULL, 0, NULL)!=0)
{
CLog::Log(LOGERROR,"Failed to open video");
return false; // Couldn't open file
}

....
....

due to changes in ffmpeg, the method av_open_input_file was dropped, so I use instead:

int iErr = m_dllAvFormat.avformat_open_input(&pFormatCtx, fileName.c_str() , NULL, NULL);

I'm getting error -34 and can't solve that one. I'm testing it on MKV videos which worked perfectly on the older XBMC (my current build is the latest from git).

Anyone can direct me? Huh

Thanks.
Reply
#2
Did you register the codecs as well? I don't see m_dllAvCodec.avcodec_register_all() in your snapshot.

Reply
#3
Thanks for the answer.

I gave it a try and still getting the same -34 error. any idea what this error means?
Reply

Logout Mark Read Team Forum Stats Members Help
using avformat_open_input0